Below is the command to provision or un-provision any service
Add-PSSnapin microsoft.sharepoint.powershell
Get-SPServiceInstance | Where-Object {$_.Server.Name -eq "NameofServer"} | Sort-Object TypeName | Format-Table -AutoSize
$si = Get-SPServiceInstance | Where-Object {($_.TypeName -match "NameOfServiceApplication") -and ($_.Server.Name -eq "NameOfServer")}
$si | fl
$si.Unprovision()
$si.Provision()
$si.Status
While ($si.Status -eq "Provisioning")
{
Start-Sleep 3
Write-Host "." -NoNewline
$si = Get-SPServiceInstance | Where-Object {($_.TypeName -match "NameOfServiceApplication") -and ($_.Server.Name -eq "NameOfServer")}
}
No comments:
Post a Comment