Workflow to create a new AD group and add a user to the group
Here are the commands for a workflow to create a new AD group and add a user to the group.
Nothing fancy but saves you the time to find the command next time.. 🙂
1 2 3 |
New-ADGroup -GroupCategory Security -GroupScope Global -Name "Name of the group" -PassThru -path "OU=Security Groups,OU=Groups,OU=company,DC=company,DC=nl" Add-ADGroupMember -Identity "Name of the group" -members UserToAdd get-aduser UserToCheck -Properties memberof |