Advanced Windows PowerShell Scripting Video Training

Advanced Windows PowerShell Scripting Video Training
Advanced Windows PowerShell Scripting Video Training

Monday, July 20, 2009

Can you create an OU while executing a Script from a regular machine?

Yes you can. The user who is logged in on the client must be a member of the Domain Administrators or Enterprise Administrators group. The code below was used.

Set objdomain = GetObject("LDAP://DC=fourthcoffee,dc=com")
Set objou = objDomain.Create("OrganizationalUnit", "ou=HR")
ObjOU.SetInfo

To get this code to work in your environment, change line 1 after the LDAP:// statement to reflect your domain.

No comments: