Announcement

Collapse
No announcement yet.

Domain users who are members of the Administrators on local workstations

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Domain users who are members of the Administrators on local workstations

    Dear All,

    I need to extract a list of all domain users who are members of the administrators group on their local workstations. How can I do this.

    Kind regards, Tuso

  • #2
    Re: Domain users who are members of the Administrators on local workstations

    You can't directly - this information is stored within the workstations, not in AD.

    ALTHOUGH

    If your local Admins group is controlled via the Restricted Groups policy, then you just need to list the members of the group which the policy works from.

    If however you do not, then you will need a script (in the workstation startup script I would suggest) which logs to a text file the contents of the local admins group and puts the text file on a network share which you can access. You can then collate and sort the data using Excel or whatever.

    Reported for move to "Scripting" forum where it might get a better response.


    Tom
    For my own and your protection, I do not provide support by private message under any circumstances. All such messages will be deleted and ignored.

    Anything you say will be misquoted and used against you

    Comment


    • #3
      Re: Domain users who are members of the Administrators on local workstations

      hey try this

      Const ForWriting = 2
      Set objNetwork = CreateObject("Wscript.Network")
      Set objFSO = CreateObject("Scripting.FileSystemObject")
      strComputer = objNetwork.ComputerName

      Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators")
      Set objFile = objFSO.OpenTextFile("\\server\scripts\T.txt", ForWriting)
      For Each objUser in objGroup.Members
      objFile.WriteLine objUser.Name
      Next
      objFile.WriteLine vbCrLf & vbCrLf
      objFile.Close

      if run it as a login script change the line
      Const ForWriting = 2

      to:
      Const ForWriting = 8

      and add this line:
      objFile.WriteLine strComputer
      before this one:
      For Each objUser in objGroup.Members
      Last edited by largo; 20th November 2008, 11:32. Reason: improvments
      Any advice is given in good faith and without warranty.
      Please give reputation points where appropriate.

      Comment

      Working...
      X