How to get the service status for a remote computer that needs a user name and password to log in?
I am trying to find a solution using the following code:
Just like Morton's answer, but using New-PSDrive for the share and Remove the share to tidy up.
New-PSDrive -Name tempDriveName –PSProvider FileSystem –Root “\\server\c$” -Credential $Cred $service = Get-Service -Name $serviceName -ComputerName $MachineName Remove-PSDrive -Name tempDriveName