Skip to main content
added the sql-server tag
Link
Marcello Miorelli
  • 16.6k
  • 53
  • 170
  • 311
replaced http://dba.stackexchange.com/ with https://dba.stackexchange.com/
Source Link

As per this questionthis question, I use the following SP to see the members within an AD Group that's been added as a "login" in my database server.

EXEC master.dbo.xp_logininfo 'MyDomain\ADGROUPNAME' , 'members'

The issue is that, the resultant data gives me only up to 30 characters of the user's account name. This is because in the Active Directory, there are two sets of account names, one that says pre-windows-2000 , and another is for post-windows 2000. The pre one is truncated and that's the one I get.

For example, if the user account in the AD group is: MyDomain\ShortName, I get MyDomain\ShortName. But if the account name is: MyDomain\HasOverThirtyCharacters, then I get MyDomain\HasOverThirtyCharact

How do I overcome this limitation? What can I use instead of xp_logininfo??

As per this question, I use the following SP to see the members within an AD Group that's been added as a "login" in my database server.

EXEC master.dbo.xp_logininfo 'MyDomain\ADGROUPNAME' , 'members'

The issue is that, the resultant data gives me only up to 30 characters of the user's account name. This is because in the Active Directory, there are two sets of account names, one that says pre-windows-2000 , and another is for post-windows 2000. The pre one is truncated and that's the one I get.

For example, if the user account in the AD group is: MyDomain\ShortName, I get MyDomain\ShortName. But if the account name is: MyDomain\HasOverThirtyCharacters, then I get MyDomain\HasOverThirtyCharact

How do I overcome this limitation? What can I use instead of xp_logininfo??

As per this question, I use the following SP to see the members within an AD Group that's been added as a "login" in my database server.

EXEC master.dbo.xp_logininfo 'MyDomain\ADGROUPNAME' , 'members'

The issue is that, the resultant data gives me only up to 30 characters of the user's account name. This is because in the Active Directory, there are two sets of account names, one that says pre-windows-2000 , and another is for post-windows 2000. The pre one is truncated and that's the one I get.

For example, if the user account in the AD group is: MyDomain\ShortName, I get MyDomain\ShortName. But if the account name is: MyDomain\HasOverThirtyCharacters, then I get MyDomain\HasOverThirtyCharact

How do I overcome this limitation? What can I use instead of xp_logininfo??

Source Link

Why does xp_logininfo truncates AD user account names? How to overcome this?

As per this question, I use the following SP to see the members within an AD Group that's been added as a "login" in my database server.

EXEC master.dbo.xp_logininfo 'MyDomain\ADGROUPNAME' , 'members'

The issue is that, the resultant data gives me only up to 30 characters of the user's account name. This is because in the Active Directory, there are two sets of account names, one that says pre-windows-2000 , and another is for post-windows 2000. The pre one is truncated and that's the one I get.

For example, if the user account in the AD group is: MyDomain\ShortName, I get MyDomain\ShortName. But if the account name is: MyDomain\HasOverThirtyCharacters, then I get MyDomain\HasOverThirtyCharact

How do I overcome this limitation? What can I use instead of xp_logininfo??