Tuesday, October 12, 2021

Assign local admin rights remotely

To view the local admin users of  the PC you are currently using: 

net localgroup administrators



After downloading and saving PSTools to a folder, which include psexec.exe, and making it available globally through System Variables -> Path, you can run the "net locagroup" command on remote PCs, given that you already have local admin rights to those PCs.

To view the local admin users of another PC remotely, try

psexec  \\<ip_address>  net  localgroup administrators




To add a user to the local admin group remotely: 

psexec \\<ip_address>  net localgroup administratos "<domain_name>\<username>" /add




To remove a user from the local admin group remotely:

psexec \\<ip_address>  net localgroup administratos "<domain_name>\<username>" /delete


No comments: