I have several Servers where the Service for an application was mis-configured to Log On (Log On As) a Domain\Account.
I need to set these Services on each Server back the the Default Setting Log On (Log On As) Local System Account.
I have found the example of finding the order for the WMI change i.e.-
PS C:\> $svc = get-wmiobject win32_service -filter "name='Service_Name'"
PS C:\> $svc.GetMethodParameters("change")
But I cannot find an example to set the StartName back to the Default Setting.
Would this all be a $null ??
PS C:\> $svc | Invoke-WmiMethod -Name Change -ArgumentList @($null,$null,$null,$null,$null,$null,$null,$null,$null,$null,$null)
Or would the correct way to be using LocalSystem?
PS C:\> $svc | Invoke-WmiMethod -Name Change -ArgumentList @($null,$null,$null,$null,$null,$null,$null,$null,$null,"LocalSystem",$null)
I know this can easily be done with the CIM as this example from Jeff Hicks
PS C:\> Get-CimInstance win32_service -filter "name='yammmsvc'" | Invoke-CimMethod -Name Change -Arguments @{StartName=".\Jeff";StartPassword="P@ssw0rd"}
But I do not know what to use for StartName...