Source Code and Samples

Thursday, 8 February 2007

Create users in a OU

Description

Here we can see how to create users in a Organizational Unit (OU).

Source Code

$OU= New-Object DirectoryServices.DirectoryEntry "LDAP://OU=SampleMustExists,DC=powershellscripts,DC=blogspot,DC=com"
$User=$OU.Create("user","CN=John")
$User.put("profilepath","\\server\share")
$User.SetInfo()

No comments: