Last active
April 29, 2021 21:45
-
-
Save colindooley11/4cf930a2f70e62157470 to your computer and use it in GitHub Desktop.
#powershell Powershell - Get services
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$computers = @("distributorserver","workeraserver","workerbserver") | |
foreach ($computer in $computers) | |
{ | |
foreach ($service in Get-Service -Name OrganisationRootNamespace.* -ComputerName $computer) | |
{ | |
Get-Service -ComputerName $computer -ServiceName $service.Name | Start-Service | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment