开发者

How to programmatically add UPN Suffix in Active Directory Domains and Trusts in .NET?

I think the Question title basically s开发者_JAVA百科ums it up. Manually, I would open Active Directory Domains and Trusts, right click on top node in Explorer tree, and add domain UPN suffix.


Sure. You need to modify the upnSuffixes attribute of the CN=Partitions,CN=Configuration,DC=ForestRootDomain,DC=com object. Keep in mind there's a rough limit of about 1300 values stored in there.

Something like this should work - just wrote the code in the textbox though so might need a bit of tweaking:

DirectoryEntry partitionsContainer = new DirectoryEntry("LDAP://CN=Partitions,CN=Configuration,DC=ForestRootDomain,DC=com");
partitionsContainer["upnSuffixes"].Add("foosuffix.net");
partitionsContainer.CommitChanges();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜