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.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Here's the one-liner:
([
ADSI]"WinNT://$computerName/$localGroupName,group").Add("WinNT://$domainName/$userName");
But a script may be more useful for execution.