Members of windows group

  • Yogeshwar Phull

    Default port

    Points: 1434

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

  • free_mascot

    One Orange Chip

    Points: 27168

    Easy one, thanks.

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

  • paul s-306273

    SSChampion

    Points: 10615

    free_mascot (3/12/2014)


    Easy one, thanks.

    +1

  • Ed Wagner

    SSC Guru

    Points: 286982

  • david.gugg

    SSCertifiable

    Points: 5693

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


    [font="Tahoma"]Personal blog relating fishing to database administration:[/font]

    [font="Comic Sans MS"]https://davegugg.wordpress.com[/url]/[/font]

  • Mike Hays

    SSCommitted

    Points: 1871

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

  • Andy sql

    SSCrazy Eights

    Points: 9401

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

  • Koen Verbeeck

    SSC Guru

    Points: 258965

    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

  • dfortier

    SSC-Addicted

    Points: 411

    You made my day, thanks!

  • SQLRNNR

    SSC Guru

    Points: 281243

    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

  • Anoo S Pillai

    Mr or Mrs. 500

    Points: 547

    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. 😉

  • TomThomson

    SSC Guru

    Points: 104773

    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

  • Thomas Abraham

    SSChampion

    Points: 10761

    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

  • george sibbald

    SSC Guru

    Points: 104200

    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?

    😀

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

  • PChiragS

    SSCarpal Tunnel

    Points: 4965

    nice and easy..

    thanks for the question.

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

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