powershell script to remove IPphone from AD
Posted on 2013-01-28
i need to clear the IPphone field from our disabled users OU in active directory.
the disabled Accounts OU lives inside the Users OU.
our AD structure looks like this
--Users (all active users are here)
-----Disabled Accounts (need to remove IPphone details from here only)
-----and one more
i have created the following script but im unsure if the OU setting is correct...
can somebody please confirm if the following code looks correct?
Const ADS_PROPERTY_CLEAR = 1
Set objUser = GetObject _
("LDAP://cn=USERNAME, ou=/ASIA/Australia/Sydney/Users/Disabled Accounts, dc=domain, dc=com")
objUser.PutEx ADS_PROPERTY_CLEAR, "IPphone", 0