Asked By
Eliot Meyer
0 points
N/A
Posted on - 06/13/2017
Hi all,
I have a query regarding powershell add domain user to a local group. How can I use a single line command in PowerShell for this purpose?
If someone knows, please share your suggestions.
Thank you.
Learn About Powershell Add Domain User In Brief.
I am not sure if you’re going to get that command for local groups in PowerShell, but I may be wrong as well. Honestly speaking, there is nothing “wrong” with executing “net localgroup Administrators /add DomainA\User1” from PowerShell.
You might get fancier and pass that instruction to Invoke-Expression, although I guess that’s not what you desire.
You can run the 2 lines for the purpose:
You may even wrap this up in a single line.
Good luck!