I'm trying to use
Set-WSS-Contact-List-From-ActiveDirectory to sync user information from AD to a Sharepoint Contact List using SharePoint Foundation 2010.
Doing this I get this error:
New-Object : Exception calling ".ctor" with "1" argument(s): "The Web application at
http://servername/ could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application."
At C:\Tools\Set-WSS-Contact-List-From-ActiveDirectory.ps1:156 char:23
+ $Thesite = new-object <<<< Microsoft.SharePoint.SPSite($WebURL)
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
I give the application name exaclty as shown in Web Applications Management as
http://servername/ . If I type the url into a browser it works fine, also when I try this with the same user that runs the Powershell srcipt.
Is this script incompatible with SharePoint Foundation 2010 or do I make a mistake?
Any help would be very appreciated.