0

We have recently migrated from Sybase/SAP ASE to MSSQL Server. master..syslogins in sybase has two columns name and fullname. Name would be AD alias name and fullname is Full Name of the user. Example...Dan Brown is the user and his AD alias would be BrownD. Now, in SQL Server i created logins using their AD alias. How would i get the full name from the alias name in SQL Server. Is there any function/sp available in SQL Server? Thanks for your help.

  • 2
    There is nothing built in to get anything from AD for the field. Is there a specific need for it? The domain sid should be sufficient for auditing. – Sean Gallardy Aug 12 at 19:30
  • yes, this is part of auditing as they are looking similar to Sybase details....select suid, status, accdate, totcpu, totio, spacelimit, timelimit, resultlimit, dbname, name, language, pwdate, audflags, fullname, srvname, logincount from master..syslogins – Kris Aug 12 at 19:37
  • I usually end up writing a PowerShell script for such use cases, because as Sean mentioned nothing OOTB in MSSQL gives you this data. – LowlyDBA Aug 12 at 19:55
  • ok....Thanks to Sean and LowlyDBA.... – Kris Aug 12 at 19:58
  • 1
    You are able to query AD data using ADSI, link. Create a function which returns that you want using login name as an input parameter. – Denis Rubashkin Aug 13 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.