script to find service and start them

I need to find all the machine on the domain to see if computer browser and Remote registry is started or not. if not I need to start them

how can i do this with powershell?

July 2nd, 2013 6:12pm

Get-service, start-service and invoke-command should do it.

If ((get-service -name whatever -computername Target).status -notlike 'running') { invoke-command -computername target start-service -name whatever }


Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2013 6:20pm

Get-service, start-service and invoke-command should do it.

If ((get-service -name whatever -computername Target).status -notlike 'running') { invoke-command -computername target start-service -name whatever }

July 2nd, 2013 6:51pm

how do I do a get 2 services from get-service cmdlet?
Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2013 8:14pm

Just separate them with commas

get-service -name service1,service2

Start-Service -name service1,service2


July 2nd, 2013 10:46pm

Give srver names in  server.txt file and service name in service.txt file

 one server name in a line

 one server name in a line

Get-Service -name (gc "C:\Users\Administrator\Desktop\service.txt") -ComputerName (gc"C:\Users\Administrator\Desktop\Server.txt")

Status   Name               DisplayName
------   ----               -----------
Running  Schedule           Task Scheduler
Running  Schedule           Task Scheduler
Running  Themes             Themes
Running  Themes             Themes

Home this will help you

Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2013 11:13pm

Hi,

Just checking in to see if the suggestions were helpful. Please let us know if you would like further assistance.

 

If you have any feedback on our support, please click here .

 

July 4th, 2013 2:54am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics