更新 Active Directory 中的全名
我已经陷入 Active Directory 的深渊(我是一名 Web 开发人员,请参阅)我有一个用户,我已经更改了名字/姓氏,但全名没有更改,这导致了问题共享 BCM 数据库。我如何刷新它以便更新全名。
我不知道 AD 是如何工作的,但出于某种原因,上级决定这是我的工作。
任何帮助将非常感激。
I've been thrust into the deep end with Active Directory (I'm a web developer, go fig) I have a user that I've changed first/last name on but the Full Name hasn't changed which is causing issues with sharing off a BCM database. How do I refresh it so the Full Name is updated.
I have no idea how AD works but for some reason the higher ups have decided it's my job.
Any help would be really appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用的是 .NET 3.5 吗?如果是这样,请查看这篇 MSDN 文章:管理 .NET 中的目录安全主体框架3.5。
查看这篇 CodeProject 文章:Howto:(几乎)通过 C# 实现 Active Directory 中的所有内容
查看 MSDN 上 System.DirectoryServices 的代码示例列表。
如果您认真对待 C# 或 VB.NET 中的 Active Directory 编程,请购买这本书:
目录服务编程 .NET 开发人员指南
更新“全名”(实际上是:DisplayName)应该像(在 .NET 3.5 上)一样简单:
就是这样! :-)
请注意:您需要将 NetBIOS 域名(例如“MICROSOFT”) - 而不是 DNS 样式名称 (microsoft.com) 传递给 PrimaryContext 的构造函数。
希望这有帮助!
Marc
.NET 2.0 的更新:
如果您在 .NET 2.0 上运行,并且需要更新用户的“displayName”,给定他的“SAMAccountName”(没有域的用户名,基本上):
Are you on .NET 3.5 ? If so, go check out this MSDN article: Managing Directory Security Principals in the .NET Framework 3.5.
Check out this CodeProject article: Howto: (Almost) Everything In Active Directory via C#
Check out this list of Code Samples for System.DirectoryServices on MSDN.
If you're serious about Active Directory Programming in C# or VB.NET, go buy this book:
The .NET Developer's Guide to Directory Services Programming
Updating the "full name" (really: DisplayName) should be as easy as (on .NET 3.5):
That's it! :-)
Mind you : you need to pass in the NetBIOS domain name (e.g. "MICROSOFT") - not a DNS-style name (microsoft.com) to the constructor of the PrincipalContext.
Hope this helps!
Marc
UPDATE for .NET 2.0:
Here's the code if you're running on .NET 2.0 and need to update the "displayName" for a user, given his "SAMAccountName" (his username without the domain, basically):