Source Code and Samples

Thursday 8 February 2007

Create an OU in a domain

Description

Here we can see how to create an OU in a domain.

Source Code

$Domain= New-Object DirectoryServices.DirectoryEntry "LDAP://DC=powershellscripts,DC=blogspot,DC=com"
$OU = $Domain.Create("organizationalUnit", "ou=PowerShell")
$OU.SetInfo()

No comments: