Posted On September 30, 2022

PowerShell: Quickly Start Windows Services on Remote Computers

kimconnect 0 comments
blog.KimConnect.com >> Codes >> PowerShell: Quickly Start Windows Services on Remote Computers
$computernames=@(
	"COMPUTER1",
	"COMPUTER2"
)
$serviceName='windows_exporter'

get-service $serviceName -computername $computernames|start-Service
get-service $serviceName -computername $computernames|select MachineName,Name,Status
Sample output:

MachineName    Name              Status
-----------    ----              ------
COMPUTER1      windows_exporter Running
COMPUTER2      windows_exporter Running

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Basic HTML and HTML5: Uncomment HTML

<!--<h1>Hello World</h1><h2>CatPhotoApp</h2><p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase…

Basic HTML and HTML5: Create an Ordered List

<h2>CatPhotoApp</h2><main><p>Click here to view more <a href="#">cat photos</a>.</p><a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying…

Deploying LDAP / Active Directory Self Service Password Portal

Overview: There are several choices of platforms to deploy Password Manager: Kubernetes, Docker, Windows, and…