I get the members of a AD group, but instead of the user name, im getting the display name. How can i get the user name?
我得到一个AD组的成员,但不是用户名,我得到显示名称。我怎样才能获得用户名?
2 个解决方案
#1
Look for sAMAccountName in the properties you get back.
在您获得的属性中查找sAMAccountName。
#2
Well, i think this might be impossible, as the only users related property is the "members". So as a workaround i used the DirectoryService with the "member" property value to fetch the user again from the AD and get it's sAMAaccoundName. I'll be happy to hear about another solution to save the call to the AD for each user except the first call. Thanks
好吧,我认为这可能是不可能的,因为唯一与用户相关的财产是“成员”。因此,作为一种解决方法,我使用带有“member”属性值的DirectoryService来再次从AD获取用户并获取它的sAMAaccoundName。我很高兴听到另一个解决方案,除第一次通话外,为每个用户保存AD的呼叫。谢谢
#1
Look for sAMAccountName in the properties you get back.
在您获得的属性中查找sAMAccountName。
#2
Well, i think this might be impossible, as the only users related property is the "members". So as a workaround i used the DirectoryService with the "member" property value to fetch the user again from the AD and get it's sAMAaccoundName. I'll be happy to hear about another solution to save the call to the AD for each user except the first call. Thanks
好吧,我认为这可能是不可能的,因为唯一与用户相关的财产是“成员”。因此,作为一种解决方法,我使用带有“member”属性值的DirectoryService来再次从AD获取用户并获取它的sAMAaccoundName。我很高兴听到另一个解决方案,除第一次通话外,为每个用户保存AD的呼叫。谢谢