how to validate a windows login in domain through SQL queries

  • how to validate a windows login in domain through SQL queries

  • sureshrajan (3/28/2012)


    how to validate a windows login in domain through SQL queries

    not sure what you mean...do you want to test if mydomain\sureshrajan has a login or has access to a server/ database?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Yes. When you create a login in SQL, it should validate through a script whether it is valid windows login.

  • the CREATE LOGIN process already does that.

    for example if you try this command:

    CREATE LOGIN [fakedomain\fakeuser] FROM WINDOWS WITH DEFAULT_DATABASE=[master]

    you get this error:

    Msg 15401, Level 16, State 1, Line 1

    Windows NT user or group 'fakedomain\fakeuser' not found. Check the name again.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • SSRfromChennai (3/28/2012)


    how to validate a windows login in domain through SQL queries

    use the stored procedure xp_logininfo

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Perry Whittle (3/28/2012)


    SSRfromChennai (3/28/2012)


    how to validate a windows login in domain through SQL queries

    use the stored procedure xp_logininfo

    xp_logininfo only validates windows accounts after the SQL Server Login is created.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply