Re: Get OS Group membership
From: Sue Hoegemeier (Sue_H_at_nomail.please)
Date: 02/14/05
- Next message: Param R.: "Re: db maintanence plan failure"
- Previous message: Phillip MacPherson-Cox: "Re: guidelines for SQL Server coding and design"
- In reply to: CC&JM: "Get OS Group membership"
- Messages sorted by: [ date ] [ thread ]
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
>
- Next message: Param R.: "Re: db maintanence plan failure"
- Previous message: Phillip MacPherson-Cox: "Re: guidelines for SQL Server coding and design"
- In reply to: CC&JM: "Get OS Group membership"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|