在使用OutLook时,自己的座位变了,电话号码也就变了,在OutLook中是修改不了的。
发现使用ADExplorer(SysinternalsSuite)可以修改,再一想使用.net提供的DirectoryEntry应该也没有问题吧。
尝试了一下,No Problem!

Code
void ModifyTelNO(string aDPath,string telNO)
{
DirectoryEntry de = new DirectoryEntry();
de.Path = aDPath;
DirectorySearcher dSearcher = new DirectorySearcher(de);
dSearcher.Filter = String.Format("(sAMAccountName={0})", Environment.UserName);
dSearcher.PropertiesToLoad.AddRange(new string[] { "displayname", "telephoneNumber" });
SearchResult result = dSearcher.FindOne();
DirectoryEntry entry = result.GetDirectoryEntry();
entry.InvokeSet("telephoneNumber", telNO);
}
ModifyTelNO("LDAP://", "");