VMware Cloud Community
Pilu1978
Enthusiast
Enthusiast

Restart Service using Powercli

Hi,

There is a requirement to restart the lwiod, lsassd and netlogond daemon services on all the ESXi 4.1 host in the environment.

Normally inside the ESXi 4.1 we run the following command to restart the above daemons.

/etc/init.d/lsassd restart

/etc/init.d/lwiod restart

/etc/init.d/netlogond restart

Just wanted to know if the same is possible using powercli.

0 Kudos
1 Reply
mattboren
Expert
Expert

Hello, Pilu1978-

Thanks to the Restart-VMHostService cmdlet, this is pretty straight forward:

Get-VMHost | Get-VMHostService | ?{"lsassd","lwiod","netlogond" -contains $_.Key} | Restart-VMHostService

That will restart those three (3) services on all VMHosts in the environment(s) to which you are connected in your PowerShell session.  Does that do it for you?

0 Kudos