Re: Get OS Group membership

From: Sue Hoegemeier (Sue_H_at_nomail.please)
Date: 02/14/05


Date: Mon, 14 Feb 2005 09:57:17 -0700

If the builtin\administrators group still has a login in SQL
Server (it is by default but you could remove it),
you can get the members of the local admin group with:
EXEC xp_logininfo 'BUILTIN\Administrators', 'MEMBERS'
Another would be using openquery with ADSI:
INFO: Performing a SQL Distributed Query by Using ADSI
http://support.microsoft.com/?id=299410

-Sue

On Fri, 11 Feb 2005 09:53:03 -0800, "CC&JM"
<CCJM@discussions.microsoft.com> wrote:

>Hello,
>
>Im using the 'xp_cmdshell' to know all users that belong to the local
>administrators group and i'm using the 'net use localgroup' to get the output
>into my report.
>Here is the code and the Output:
>
>set nocount on
>exec xp_cmdshell 'net use localgroup'
>go
>set nocount off
>
>OUTPUT:
>output
>
>
>
>------------------------------------
>Alias name administrators
>Comment Administrators have..
>NULL
>Members
>
>NULL
>------------------------------------
> Administrator
> DOMAINXXX\Domain Admins
> DOMAINXXX\usera
> DOMAINXXX\userb
>The command completed successfully.
>
>NULL
>NULL
>
>Is there any way to avoid lines where appear:
>output
>------------------------------------
>Alias name administrators
>Comment Administrators have..
>NULL
>
>and all the information that is not part of the group membership?
>Do you know other way to get this information?
>
>Thanks,
>Best regards
>



Relevant Pages

  • Re: I CALL BULL SHIT ON MIKE PAYNES "UPA Members Call to Action" artical.....
    ... The stategy should be to get general info from a larger ... members giving feedback no one knows ANYTHING about what the majority ... upa administrators just fine. ... dosent it seem odd to you that upa administrators have never seen fit ...
    (rec.sport.disc)
  • Re: [Full-Disclosure] UTTER HORSESHIT: [was January 15 is Personal Firewall Day, help the cause]
    ... > ever heard for not using security products. ... Many of the people on here care nothing about security, ... >> If Annie's weren't members of Administrators, ... >> Administrators would not have access to apps like IE and OE, ...
    (Full-Disclosure)
  • Re: Help needed setting up roaming administrator
    ... >Administrators group (just type in Administrators, don't browse for it, ... >add your Roaming Local Admins group to the Members of this group section ... GPO associated with the OU that contains the computers I want to use ... restricted group and to define the groups the restricted group will ...
    (microsoft.public.win2000.security)
  • Re: SQL Server Service account rights
    ... SQL is one of a few ... the MSSQL dbas. ... account change, it will delegate a lot of the rights to you. ... SQL Agent runs under should not be in the local administrators group of the ...
    (microsoft.public.sqlserver.security)
  • Re: Domain Users to have Local Admin rights
    ... members inside the Restricted Group, but it still doesn't wanna work. ... all machines that are with scope of the GPO carrying the Restricted ... their local Administrators group. ... group you define a Restricted Group definition, ...
    (microsoft.public.windows.server.security)