gistfile1.txt
· 516 B · Text
Raw
# Create the group in the same OU
New-ADGroup -Name "EUC-Support" `
-SamAccountName "EUC-Support" `
-GroupCategory Security `
-GroupScope Global `
-Path "OU=AD_PowerShell,DC=Xceed,DC=com"
# Add the user to the group
Add-ADGroupMember -Identity "EUC-Support" -Members "HS"
# Create the new OU
New-ADOrganizationalUnit -Name "EUC-Admin" -Path "DC=Xceed,DC=com"
# Move the EUC-Support group to the new OU
Get-ADGroup -Identity "EUC-Support" | Move-ADObject -TargetPath "OU=EUC-Admin,DC=Xceed,DC=com"
1 | # Create the group in the same OU |
2 | New-ADGroup -Name "EUC-Support" ` |
3 | -SamAccountName "EUC-Support" ` |
4 | -GroupCategory Security ` |
5 | -GroupScope Global ` |
6 | -Path "OU=AD_PowerShell,DC=Xceed,DC=com" |
7 | |
8 | # Add the user to the group |
9 | Add-ADGroupMember -Identity "EUC-Support" -Members "HS" |
10 | |
11 | # Create the new OU |
12 | New-ADOrganizationalUnit -Name "EUC-Admin" -Path "DC=Xceed,DC=com" |
13 | |
14 | # Move the EUC-Support group to the new OU |
15 | Get-ADGroup -Identity "EUC-Support" | Move-ADObject -TargetPath "OU=EUC-Admin,DC=Xceed,DC=com" |
16 |