Created
March 1, 2020 20:31
-
-
Save iyre/564a61ced11aefd018edba4c553025fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$target = read-host "Target" | |
$group = read-host "Group" | |
$user = read-host "User" | |
Invoke-Command -ComputerName $target -ScriptBlock { | |
net localgroup $(args[0]) $(args[1]) /add | |
#With PS5 | |
#Add-LocalGroupMember -Group $(args[0]) -Member $(args[1]) | |
} -ArgumentList $group,$user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment