Directory Services |
The sales organization has moved to a new organization — "Sales and Support." Julie Bankert has been promoted to vice president and will lead the new organization. Joe Worden, the enterprise administrator, must move Sales OU to a new OU, Sales and Support.
Set dom = GetObject("LDAP://DC=Fabrikam, DC=COM") Set salesSupport = dom.Create("organizationalUnit", "CN=Sales and Support") Set sales = salesSupport.MoveHere("LDAP://OU=Sales, DC=Fabrikam, DC=COM", vbNullString)
With this code example, all objects in the sales organizational unit, including the sub-organizational units, are moved to the new organizational unit.
Now, Joe can move Julie into the Sales and Support organizational unit.
Set usr = salesSupport.MoveHere("LDAP://CN=Julie Bankert, OU=Sales, OU=Sales and Support, DC=Fabrikam,DC=COM") usr.Put "title", "Vice President" usr.SetInfo
Be aware that the manager-direct report link between Julie Bankert and Chris Gray is automatically updated by Active Directory.
To create a report
To create an Active Directory report:
SELECT Name,telephoneNumber FROM 'LDAP://DC=Fabrikam,DC=com' WHERE objectCategory='Person' AND objectClass='user'
The Command object is created. Add the Command object to the report.