
Changing the Address in AD
Quote:
> I need to know the best way to change the Address in an OU without having
to
> do this manually, anyone know of a way to do this.
Hi,
Many of the attributes available for user objects are available for OU
objects. The common address attributes are:
LDAP attribute Available Available
Description Name for Users for OU's
----------- -------------- --------- ---------
Street streetAddress yes no
Street street yes yes
P.O.Box postOfficeBox yes yes
City l yes yes
State st yes yes
Zip postalCode yes yes
Bind to the OU object and set the attributes desired:
Set objOU = GetObject("LDAP://ou=Sales,dc=MyDomain,dc=com")
objOU.street = "123 Main St."
objOU.l = "Dover"
objOU.st = "Delaware"
objOU.description = "Sales Department OU"
objOU.SetInfo
To set the country to "US", you would set 3 attributes, as follows:
objOU.c = "US"
objOU.Co = "UNITED STATES"
objOU.CountryCode = 840
--
Richard
Microsoft MVP Scripting and ADSI
http://www.rlmueller.net
--