With this little Powershell Script you can run Powershell Commands on multiple Remotehosts even if those are not in an Active Directory.
# Config $Servers = @("Server01", Server02) $Cred = Get-Credential # Add Credentials for all Servers (Domain or non-Domain) # Run Command (for example Get-Service | Where-Object {$_.Name -eq "BITS"} foreach ($Server in $Servers) { Invoke-Command -ComputerName $Server -Credential $Cred {Get-Service | Where-Object {$_.Name -eq "BITS"}} }
Important:
You have to enable Powershell Remoting on the Remotehost with Enable-PSRemoting
Tags: -ComputerName, command, Enable-PSRemoting, Invoke-Command, Microsoft, PowerShell, Powershell Remoting, remote, Remotehost, Run, script, Windows Powershell Last modified: January 18, 2011