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

PowerShell: Check Servers on Domain to Locate A Domain Account Being Set to Run Services and Scheduled Tasks

# Obtain the name of the default domain Administrator account (this account is expected to…

How To Increase WordPress Memory Limit

It's are lesser known fact that WordPress overrides PHP's memory_limit settings. Thus, it is possible…

Quick 1-liner Generate List of Active Directory users

# Discover domain controller:echo %LOGONSERVER%# Display Users:dsquery user -limit 0 | dsget user -display -dept…