Thursday, August 6, 2009

Can not find property “mobile” in Active Directory

While developing an application used to import mobile phone numbers from a CSV file to Active Directory I discovered that the attribute “mobile” did not exist for users where this property never had been used before (Never been updated by other tools such as the Active directory MMC snap-in etc.)

The application uses the standard System.DirectoryServices.ActiveDirectory assembly shipped with .NET 2.0. (See the article on CodeProject Howto: (Almost) Everything In Active Directory via C# for more code)

mobile

The source code after gathered the Directory Entry for a user. Is used to update the mobile attribute:

mobile

Do not forget to CommitChanges, Close and Dispose…

No comments: