locked
SharePoint Foundation 2010 | Add-PSSnapin : The Windows PowerShell snap-in 'Microsoft.SharePoint.PowerShell' is not installed on this computer. RRS feed

  • Question

  • On entering the SharePoint Shell Manangement 2010,we 're unable to resolve the error "Add-PSSnapin : The Windows PowerShell snap-in
    'Microsoft.SharePoint.PowerShell' is not installed on this computer. " as well as we're facing some issues in SharePoint Central Admin url ,well we have attached  the document below.

    Windows PowerShell : 

    Add-PSSnapin : The Windows PowerShell snap-in
    'Microsoft.SharePoint.PowerShell' is not installed on this computer.
    At C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1:5 char:1
    + Add-PSSnapin "Microsoft.SharePoint.PowerShell"
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (Microsoft.SharePoint.PowerShel
       l:String) [Add-PSSnapin], PSArgumentException
        + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.Ad
       dPSSnapinCommand

    Add-PsSnapin : The Windows PowerShell snap-in
    'Microsoft.SharePoint.PowerShell' is not installed on this computer.
    At C:\Program Files\Common Files\Microsoft Shared\Web Server
    Extensions\15\CONFIG\POWERSHELL\Registration\SharePoint.ps1:3 char:1
    + Add-PsSnapin Microsoft.SharePoint.PowerShell
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (Microsoft.SharePoint.PowerShel
       l:String) [Add-PSSnapin], PSArgumentException
        + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.Ad
       dPSSnapinCommand

    PS C:\Users\Administrator> New-SPConfigurationDatabase
    New-SPConfigurationDatabase : The term 'New-SPConfigurationDatabase' is not
    recognized as the name of a cmdlet, function, script file, or operable
    program. Check the spelling of the name, or if a path was included, verify
    that the path is correct and try again.
    At line:1 char:1
    + New-SPConfigurationDatabase
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (New-SPConfigurationDatabase:Str
       ing) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException

    PS C:\Users\Administrator>

    SharePoint Foundation 2010 Central admin url logs:(Filter by - show only errors)

    06/17/2020 13:28:16.93 OWSTIMER.EXE (0x091C) 0x0944 SharePoint Foundation General ahjnc Unexpected SPReaderWriterLock named [SPInitializeOnceLock] held for 359 milliseconds. Call stack:    at Microsoft.SharePoint.Utilities.SPReaderWriterLock.SPReaderWriterLockScope.Dispose()     at Microsoft.SharePoint.Administration.SPConfigurationDatabase.get_Local()     at Microsoft.SharePoint.Administration.SPFarm.FindLocal(SPFarm& farm, Boolean& isJoined)     at Microsoft.SharePoint.Administration.SPFarm.get_Local()     at Microsoft.SharePoint.Administration.SPServer.get_Local()     at Microsoft.SharePoint.Utilities.SPServerPerformanceInspector.GetLocalWebApplications()     at Microsoft.SharePoint.Utilities.SPServerPerformanceInspector..ctor()     at Microsoft.SharePoint.Utilities.SPServerPerformanceInspector..cctor()     at Microsoft.SharePoint.Administration.SPTimerStore.InitializeTimer(Int64& cacheVersion, Object& jobDefinitions, Int32& timerMode, Guid& serverId, Boolean& isServerBusy)     at Microsoft.SharePoint.Administration.SPNativeConfigurationProvider.InitializeTimer(Int64& cacheVersion, Object& jobDefinitions, Int32& timerMode, Guid& serverId, Boolean& isServerBusy) 
    06/17/2020 13:28:18.48 OWSTIMER.EXE (0x091C) 0x0944 SharePoint Foundation General ahjnc Unexpected SPReaderWriterLock named [Process Context Lock] held for 390 milliseconds. Call stack:    at Microsoft.SharePoint.Utilities.SPReaderWriterLock.SPReaderWriterLockScope.Dispose()     at Microsoft.SharePoint.SPProcessContext.Get[T]()     at Microsoft.SharePoint.Administration.SPConfigurationDatabase.get_Farm()     at Microsoft.SharePoint.Administration.SPFarm.FindLocal(SPFarm& farm, Boolean& isJoined)     at Microsoft.SharePoint.Administration.SPFarm.get_Local()     at Microsoft.SharePoint.Administration.SPServer.get_Local()     at Microsoft.SharePoint.Utilities.SPServerPerformanceInspector.GetLocalWebApplications()     at Microsoft.SharePoint.Utilities.SPServerPerformanceInspector..ctor()     at Microsoft.SharePoint.Utilities.SPServerPerformanceInspector..cctor()     at Microsoft.SharePoint.Administration.SPTimerStore.InitializeTimer(Int64& cacheVersion, Object& jobDefinitions, Int32& timerMode, Guid& serverId, Boolean& isServerBusy)     at Microsoft.SharePoint.Administration.SPNativeConfigurationProvider.InitializeTimer(Int64& cacheVersion, Object& jobDefinitions, Int32& timerMode, Guid& serverId, Boolean& isServerBusy) 
    06/17/2020 13:28:18.48 OWSTIMER.EXE (0x091C) 0x0944 SharePoint Foundation General ahjnc Unexpected SPReaderWriterLock named [Process Context Lock] held for 390 milliseconds. Call stack:    at Microsoft.SharePoint.Utilities.SPReaderWriterLock.SPReaderWriterLockScope.Dispose()     at Microsoft.SharePoint.SPProcessContext.Get[T]()     at Microsoft.SharePoint.Administration.SPConfigurationDatabase.get_Farm()     at Microsoft.SharePoint.Administration.SPFarm.FindLocal(SPFarm& farm, Boolean& isJoined)     at Microsoft.SharePoint.Administration.SPFarm.get_Local()     at Microsoft.SharePoint.Administration.SPServer.get_Local()     at Microsoft.SharePoint.Utilities.SPServerPerformanceInspector.GetLocalWebApplications()     at Microsoft.SharePoint.Utilities.SPServerPerformanceInspector..ctor()     at Microsoft.SharePoint.Utilities.SPServerPerformanceInspector..cctor()     at Microsoft.SharePoint.Administration.SPTimerStore.InitializeTimer(Int64& cacheVersion, Object& jobDefinitions, Int32& timerMode, Guid& serverId, Boolean& isServerBusy)     at Microsoft.SharePoint.Administration.SPNativeConfigurationProvider.InitializeTimer(Int64& cacheVersion, Object& jobDefinitions, Int32& timerMode, Guid& serverId, Boolean& isServerBusy) 
    06/17/2020 13:37:40.31 w3wp.exe (0x1390) 0x16EC SharePoint Foundation Runtime tkau Unexpected System.Web.HttpException: Request timed out. b5625d9f-c966-201b-0000-0b14581b795b
    06/17/2020 13:38:57.28 w3wp.exe (0x1390) 0x16EC SharePoint Foundation DistributedCache ah24q Unexpected SPDistributedCachePointerWrapper::InitializeDataCacheFactory - No cache hosts are present in the farm. b5625d9f-c966-201b-0000-0b14581b795b
    06/17/2020 13:38:57.29 w3wp.exe (0x1390) 0x16EC SharePoint Foundation DistributedCache ah24w Unexpected Unexpected Exception in SPDistributedCachePointerWrapper::InitializeDataCacheFactory for usage 'DistributedViewStateCache' - Exception 'System.InvalidOperationException: SPDistributedCachePointerWrapper::InitializeDataCacheFactory - No cache hosts present in the farm.     at Microsoft.SharePoint.DistributedCaching.SPDistributedCachePointerWrapper.InitializeDataCacheFactory()'. b5625d9f-c966-201b-0000-0b14581b795b



    • Edited by ColleenF123456 Wednesday, June 17, 2020 2:57 PM Replacing SharePoint Management Shell 2010 by Windows PowerShell
    Wednesday, June 17, 2020 8:54 AM

All replies

  • You don't have to run "Add-PSSnapin Microsoft.SharePoint.PowerShell" on SharePoint Management Shell 2010 it's already have these snapins installed, just run the commands you need by excluding this command, you only have to run this command on default windows Powershell / ISE. if you get this error on windows powershell/ISE make sure you open X64-Bit.

    Thanks & Regards,


    sharath aluri

    Wednesday, June 17, 2020 1:51 PM
  • also please keep in mind that you may run Sharepoint Management Shell (or add Microsoft.SharePoint.PowerShell) only on those servers which are part of your Sharepoint farm - WFE or app servers. I.e. those servers which have Sharepoint instance installed on them.

    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - https://github.com/sadomovalex/camlex

    Wednesday, June 17, 2020 3:42 PM
  • Hi,
    I am checking to see how things are going there on this issue. Please let us know if you would like further assistance.
    You can mark the helpful post as answer to help other community members find the helpful information quickly. 
    You can also share your own solution here and mark it as answer, so it may help others who has similar requirement.
    Best Regards,
    Lee


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, June 19, 2020 7:47 AM
  • @Sharath After trying another approach,I'm still facing the same error;could you please assist me to resolve the issue?

    PS C:\Windows\System32> Add-PsSnapin Microsoft.SharePoint.PowerShell
    Add-PsSnapin : The Windows PowerShell snap-in 'Microsoft.SharePoint.PowerShell' is not installed on this computer.
    At line:1 char:1
    + Add-PsSnapin Microsoft.SharePoint.PowerShell
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (Microsoft.SharePoint.PowerShell:String) [Add-PSSnapin], PSArgumentException
        + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

    Regards,

    Colleen 


    Friday, June 19, 2020 5:25 PM
  • what do you mean another approach ? trying it in windows powershell ? Make sure your SharePoint Server is Connected to SharePoint Farm. Open Central Admin check your Manage Servers in Farm.

    Thanks & Regards,


    sharath aluri

    Friday, June 19, 2020 5:45 PM