Windows PowerShell Home
Promblem with ProvisionGlobally() when using Management Framework on Windows 2003
Mattias J Karlsson
2/5/2010 4:34:37 AM
User(s) can reproduce this bug
This has earlier been reported as a Microsoft Case (SRZ091204000273) but without a resolution.
The problem we have is that on our Windows 2003 R2 SP2 SharePoint farm (3 WFE) we have created a PowerShell script to be able to recreate Web Applications in case of a disaster and recovery. The script worked fine until we installed Windows Management FrameWork Core. We then start to get the following error:
"ProvisionGlobally" with "0" argument(s): "Object reference not set to an instance of an object."
If you remove the Framework and reboot the script starts to work again. In our MS case we hade we used on request by MS to try the simpliest script to create a web application and provision it:
$spFarm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$appBuilder = New-Object Microsoft.SharePoint.Administration.SPWebApplicationBuilder $spFarm
$spWebApp = $appBuilder.Create()
The above code does not work either when you have a farm. What happens is that on the machine where you run the script the IIS website and application pool is created but only on the local machine.
The same script on a singel server installation works fine and when using the Provision() or ProvisionGlobally()
In the MS case we tried the same code as a console application written i C# and that works fine. Using Central Administration is also working fine.
In addition we have also tried on several SharePoint farms and not only one.
How often does this happen?
Have you seen this problem before in this product?
No, this is new to the most recent version
Have a SharePoint Serve 2007 Sp2 farm (2 WFE or more) installed on windows 2003 R2 Sp2 and PowerShell 1.0 installed.
Try running the script mentioned in the description and it will work.
Install Windows Management FrameWork Core that will update PowerShell version on all machines and restart the servers.
Run the script again mentioned in the description and you will not be able to ProvisionGlobally()
The Same script works on a 2008 machine with PowerShell 2.0. However for Windows 2003 a separate download for PowerShell 2.0 is not available.
to post a comment.
Please enter a comment.
on 4/14/2010 at 1:24 PM
I am also seeing the same problem. Script failure when using Provision(). We are going to have to hold off on the deployment of PowerShell 2.0 until this is resolved, which is a shame as we were hoping to use some of the new features...
to post a workaround.
Please enter a workaround.
© 2014 Microsoft