Learn About Powershell Add Domain User In Brief.

Asked By 0 points N/A Posted on -
qa-featured

Hi all,

Image result for powershell add domain user

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.

SHARE
Answered By 0 points N/A #299305

Learn About Powershell Add Domain User In Brief.

qa-featured

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!

Related Questions