This project has moved and is read-only. For the latest updates, please go here.

Error "Loading SharePoint PowerShell Snapin..."

Topics: Support
Apr 3, 2014 at 9:00 PM
Edited Apr 3, 2014 at 9:03 PM

I have found a really frustrating issue that has really held me up today. I have an known good Autospinstaller directory structure which I have used to build 2 sharePoint 2013 /windows 20018R2 dev servers. .

So what could be easier than to take use the same script to build a live server farm albeit with different server names. Well that was the theory.

Everything seems to go well until I see
 - __Loading SharePoint Powershell Snapin__

__The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered. 
- Attempting to join farm on "AutoSP2013Inst_Config"...
 - No existing farm found.
 - Creating config database "AutoSP2013Inst_Config"...
 - Done creating configuration database for farm.
 - Configuring the SharePoint farm/server...
 - Installing Help Collection...
 - Securing Resources...
 - Installing Services...
At this point it script attempts to load my root site which fails. ( I have commented out Mystites and an HNC ) ... It looks like that although SharePoint 2013 and March CU are installed, everything else does not: so no web services, no features , no services and service applications. I do get my config db and a very unstable central admin!

I have check all the obvious permissions and I have unistalled / reinstalled a number of times.

I have now asked IT to nuke the server and I will personally patch so I know I can trust the installation. I would like to know what caused this issue since this really the only thing that differs from my other installatons
Apr 4, 2014 at 7:34 PM
Are you referring to this:
The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered
That's a perfectly normal and expected message to get if you don't actually have a farm created yet, which seems to be the case above.

As for your other issue, it's not really clear what's going on, but I strongly suspect there's something missing or incorrect in your XML. Can you scrub and post it for review?

Apr 6, 2014 at 4:47 PM
Edited Apr 6, 2014 at 4:56 PM

Yes thanks for your reply. You are right, I was trying to see a marker for this issue and I can see the this occurs before

Essentially for this Live install has been very problematic for various reasons e.g roaming profile problems and storage resources. Anyway, what I have seen
is a partially created farm that has my main web app , but no site collections. I notice the none of the SharePoint web services are installed. Server given to me with SP1 but I did notice some unsuccessful windows updates.

When the server is in this state you get this sort of error the script attempts to install a site collecton
Creating Site Collection Http://
Exception        :system.UnathorisedAcessException:  <nativehr>0x80070005<nativehr>
Due to time constraints, I had the server rebuilt and the script worked unchanged.
Perhaps there is a need for a status check to test what is the minimum infrastructure that should be in place ( before the first Sc is created) on top of the config database being connected to:
  • Test valid end points for xyx SharePoint Web Services
  • test the xyx SharePoint / windows services are in place
  • test the features that should be been enabled note Install-Features didn't show any errors when I ran it once my script bombed out.
happy to volunteer if needed to develop / test/
Apr 8, 2014 at 4:11 PM
Edited Apr 8, 2014 at 5:08 PM


I have had to refactor the script to accommodate a requirement where there is only one web apps / external url .
Hence, I ran the script a few times today. I do see some consistent behaviour which means the code path
doesn't check the existence of web applications and site collections. Often it will simply go straight the stuff below. which with the exception of Central admin all fail. If the web apps get validated and site collections get also checked then the service applications start to be provisioned. Ok what if you get an error see in the BDC service application such as s db timeout. You run the script and this time the neither the web nor site collections get verified, and the script goes straight the open urls as shown below . I have deleted the BDC but there is no attempt to recreate because of the this issue.

You can get this behaviour when there is something really wrong with the server - such as missing windows SP1 . Maybe the script needs a "ForceCheck" flag which will go and see if the anything needs to be recreated

 Loading SharePoint Powershell Snapin...
 Checking farm membership for SOURCE in "AutoSP2013InsXYZtLive_Config"...
 Wizzy intranet is already joined to farm on "AutoSP2013InstXYZLive_Config".
 Configuring the SharePoint farm/server...
 Securing Resources...
 Installing Services...
 Updating Central Admin branding text to "Live"...
 Launching Central Admin...
 Launching http://clientintranet...
 Launching http://clientintranet/mysites...
 etc etc
 C:\Windows\system32> Script Now stops 
I ran the script a final time unchanged ( same account, not restarts, perhaps I got up to get a drink!) straight after but this time it doesn't bother opening the urls .....
- Updating Central Admin branding text to "Live"...
- Checking Default Web Site...Already stopped.
- Done initial farm/server config.
- Configuring SharePoint diagnostic (ULS) logging...
- C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS
s already compressed.
- Adding Managed Accounts...
- Enabling Secondary Logon service...
.... fantasctic .. I know the site collections and web apps will be checked ..... and hopefully my service app gets recreated!!!!