Automation

 View Only
  • 1.  Restart Service using Powercli

    Posted Sep 06, 2012 08:35 AM

    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.



  • 2.  RE: Restart Service using Powercli

    Posted Sep 06, 2012 12:17 PM

    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?