I would like to manage a service on a remote machine via cmd (or powershell) using sc
, e.g.
sc \\hostname query service_name
I need to use a specific user account to make this connection, which I understand I can do by logging into my workstation as the user and running cmd
from that context.
However, I want to specify the account to use in the command line, something like:
sc username:password \\hostname query service_name
Is this possible? sc
appears to use the current windows-authentication implicitly, and I'm not sure how to switch this easily, or in fact what is doing this authentication (and therefore where to look to find out how to change current user for a single specific command).
Thanks for any help