Erro recebido:
Connecting to remote server xxxxxx failed with the following error message : WinRM cannot process the request. The following error with errorcode 0x80090322 occurred while using Kerberos authentication: An unknown security error occurred.
Script usado:
[Void][Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")
Import-Module WebAdministration
$Sm=Get-Content -path D:\script\sites.txt
write-host "list" $Sm
$serverslist=get-content -path D:\script\servers.txt
foreach($server in $serverslist)
{
write-host "currentserver" $server
foreach($site in $sm)
{
Invoke-Command -ComputerName $server {Remove-Item -recurse "IIS:\Sites\$site"}
}
}
Tags iis