Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell one-liner to add domain user to a local group

$
0
0

I'm looking for a one liner that can be typed in to add a domain user to a local group.  I know it can be done using net.exe but with the trend to move admin controls to powershell I doubt net.exe will be around much longer.  (It has issues with multiple domains anyway.)

So I'm looking for a powershell equivalent to this:

   net localgroup administrators /add DomainA\User1

v3 for Win8/2012 is fine, this is for new stuff.

I've seen a 2004 blog post for a script to do this but I'm looking for a oneliner about the size of the net command.

Thanks!


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>