How to get back the SharePoint WebServices applicaion in IIS if deleted, SharePoint 2010

How to get back the SharePoint WebServices applicaion in IIS if deleted, SharePoint 2010

  • Comments 7
  • Likes

In SharePoint 2010, if you have deleted or some how removed the Sharepoint Webservice site unknowingly.

its hard to get it back, in spite of running psconfig we would not able to get the SharePoint Webservice back.

It is the same SharePoint webservice application which we see in Sharepoint 2007

Here is is powershell script which can help us to get all the running service back under IIS with their GUID.

 

$webservice = [System.Type]::GetType("Microsoft.SharePoint.Administration.SPIisWebServiceSettings, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")

 

 

$Instance = $webservice::Default

$Method = $webservice.GetMethod("ProvisionLocal", "Instance, NonPublic", $null, @(), $null)

$Method.Invoke($Instance, $null)

$Method = $webservice.GetMethod("Provision", "Instance, Public", $null, @(), $null)

$Method.Invoke($Instance, $null)

Once we are done with about script we should have “SharePoint Web Service” under IIS with only few information.

now we need to get all the respective VD in IIS.

Get-SPServiceApplication | ForEach-Object {$_.Provision()}

 

Above steps should helps us to get the missing VD and Sharepoint Webservice back in IIS.

Comments
  • Thanks for the above guide, I'm still having the problem that after executing the final

    $Method.Invoke($Instance, $null)

    PowerShell seems to hang showing no activity, allthough the site is created in IIS, it only seems partially there as none of the asp files are present and when exploring the directories, all the content is blank.  Running the Get-SPServiceApplication | ForEach-Object {$_.Provision()} makes no difference either, and again seems to han

  • sorry for my poor English reading, i think it means although we have run psconfig, it is still not get back.

    and a typo:

    $Method = $werbservice.GetMethod("ProvisionLocal", "Instance, NonPublic", $null, @(), $null)

    should be:

    $Method = $webservice.GetMethod("ProvisionLocal", "Instance, NonPublic", $null, @(), $null)

  • I've seen this method posted around the Net a few times, but having suffered the same fate as few others, I too have lost the SharePoint Web Services Application in IIS and have beeen trying to recreate it.

    Unfortunately I cannot get past the $Method.Invoke($Instance, $null) as it throws an error every time I execute it.

    Has their been any updates on this script?

    I have opened up PowerShell and just started typing the commands one by one. Is this the corect way?

    Craig

  • Hi Craig,

    Apologize for delayed response.

    I have retested it and it works fine on my machine.

    if you are still facing the issue, could paste the error message here.

    Regards,

    Vinit

  • Even i have the same issues when i run  cmdlets

    $Method.Invoke($Instance, $null)

    Error:

    Exception calling "Invoke" with "2" argument(s): "Non-static method requires a target."

    At line:1 char:15

    + $Method.Invoke <<<< ($Instance, $null)

       + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

       + FullyQualifiedErrorId : DotNetMethodException

    Vinit let me know if you have any suggestions  in this,

    Kind Regards,

    Chaitanya.

  • It throws the same error twice, when the invoke method is called; Exception calling "Invoke" with "2" argument(s): "A configuration file cannot be created for the requested Configuratio n object." At line:1 char:15 + $Method.Invoke <<<< ($Instance, $null) + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodTargetInvocation

  • Thanks! This worked for me in multi-tier SharePoint 2013 farm. Just make sure you create the root folder on all WFEs.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment