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??