Members of windows group

  • Comments posted to this topic are about the item Members of windows group

  • Easy one, thanks.

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • free_mascot (3/12/2014)


    Easy one, thanks.

    +1

  • Wow, I never knew this existed. This is very helpful.

    Be still, and know that I am God - Psalm 46:10

  • Good Question, I did not know about this one...

  • Likewise, I did not know about this option. I was surprised it works! But good to know. Thanks for the question.

  • Nice question, had me to do some research.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • You made my day, thanks!

  • Based on the wording of the question, I have to throw this out there too!

    xp_cmdshell 'net localgroup administrators'

    GO

    xp_cmdshell 'WMIC USERACCOUNT LIST BRIEF'

    GO

    xp_cmdshell 'WMIC USERACCOUNT LIST FULL'

    GO

    Which extended stored procedure can be used to find members of a Windows group?

    By that wording alone, we have multiple correct answers.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • SQLRNNR (3/13/2014)


    Based on the wording of the question, I have to throw this out there too!

    xp_cmdshell 'net localgroup administrators'

    GO

    xp_cmdshell 'WMIC USERACCOUNT LIST BRIEF'

    GO

    xp_cmdshell 'WMIC USERACCOUNT LIST FULL'

    GO

    Which extended stored procedure can be used to find members of a Windows group?

    By that wording alone, we have multiple correct answers.

    I got it right, but xp_cmdshell too can be a right answer. 😉

  • The call in the explanation doesn't give all memers of the group - members of a group G1 which is itself a member of a group G are automatically members of G, but will not be listed by calling xp_login 'G', 'members'. So one has to recurse down the tree to get all members of G. There was a connect item about this a while back, closed as "won't fix".

    The AD Users and Computers tool has the same problem - it doesn't recurse.

    So in effect there isn't any means of getting all the members of a group by a simple xp call, you have to provide the recursion yourself.. Unfortunately I misunderstood the question as asking for that, so I got it wrong.

    Tom

  • TomThomson (3/13/2014)


    The call in the explanation doesn't give all memers of the group - members of a group G1 which is itself a member of a group G are automatically members of G, but will not be listed by calling xp_login 'G', 'members'. So one has to recurse down the tree to get all members of G. There was a connect item about this a while back, closed as "won't fix".

    The AD Users and Computers tool has the same problem - it doesn't recurse.

    So in effect there isn't any means of getting all the members of a group by a simple xp call, you have to provide the recursion yourself.. Unfortunately I misunderstood the question as asking for that, so I got it wrong.

    Sometimes we can be too smart for our own good! 😉

    Thanks to Yogeshwar for the question.

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • SQLRNNR (3/13/2014)


    Based on the wording of the question, I have to throw this out there too!

    xp_cmdshell 'net localgroup administrators'

    GO

    xp_cmdshell 'WMIC USERACCOUNT LIST BRIEF'

    GO

    xp_cmdshell 'WMIC USERACCOUNT LIST FULL'

    GO

    Which extended stored procedure can be used to find members of a Windows group?

    By that wording alone, we have multiple correct answers.

    fancy an argument about using xp_cmdshell?

    😀

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

  • nice and easy..

    thanks for the question.

Viewing 15 posts - 1 through 15 (of 18 total)

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