Get OS Group membership

From: CC&JM (CCJM_at_discussions.microsoft.com)
Date: 02/11/05


Date: Fri, 11 Feb 2005 09:53:03 -0800

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: administrator on box also on domain?
    ... > administrators group at the PC then it shows something like: ... > domain_name\Domain Admins ... so we add the user to the local Administrators ...
    (microsoft.public.windows.server.active_directory)
  • Re: User rights
    ... This issue is with SBS automatically pulling the local user account into ... Will it still migrate that user up to SBS? ... are automatically Sharepoint Administrators. ... > to remove the Power Users group from the Sharepoint Administrators group. ...
    (microsoft.public.windows.server.sbs)
  • Odd behaviour with user accounts (accounts "hidden")
    ... installation), dad and kids. ... "Administrators" group. ... As soon as I remove "kids" from the administrators group the account ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Confused
    ... Administrators group so they are administrators of the child domain, ... By default the Domain Admins of a domain are member of the ...
    (microsoft.public.win2000.active_directory)
  • Re: What are the necessary rights to install SQL Server?
    ... You need full administrator rights to install SQL server. ... > indirect membership of the local Administrators group, ...
    (microsoft.public.sqlserver.setup)