Counter

Adding Organizational Unit In Domain with PowerShell Command

Copy the following command in Notepad:

$basedn = "ou=Test,dc=yourdomain,dc=com"
New-ADOrganizationalUnit -Name "Test1" -Path $basedn ProtectedFromAccidentalDeletion $false
New-ADOrganizationalUnit -Name "Test2" -Path $basedn -ProtectedFromAccidentalDeletion $false
New-ADOrganizationalUnit -Name "Test3" -Path $basedn -ProtectedFromAccidentalDeletion $false


Note: Suppose your ou name "Employee" and your domain name is yourdomain.com.au. Edit it like "ou=Employee,dc=yourdomain,dc=com,dc=au". Test1, Test2, Test3 are tree OU.

Now Save the file as "test OU.ps1".


Right click on the file and click on "Run as PowerShell".
Type Y and press Enter.
Now you can see the desired OU in Active Directory Users and Computers.




Comments

Total Viewer

Popular posts from this blog

Installing Distribution Point in SCCM using PowerShell

How to fix NSLOOKUP Default Server: UnKnown?