PowerShell for Non-N00bs: Adding a User to a Group (with Script)


Here’s the one-liner:


([ADSI]“WinNT://$computerName/$localGroupName,group”).Add(“WinNT://$domainName/$userName”);


But a script may be more useful for execution.   


 


 


 

Add-UserToGroup.ps1

Comments (0)