Solved

Windows 2003 Local Users accounts

Posted on 2009-05-03
2
260 Views
Last Modified: 2012-06-21
Hi,
There's a few local accounts on a win 2003 server. I need to know a way to run a report on which groups each of these local accounts belong to.
Please provide example of utility to use, command line example, etc.
Thanks
0
Comment
Question by:lurezero
2 Comments
 
LVL 4

Accepted Solution

by:
Macros82 earned 500 total points
ID: 24291706
I got this VB code from:

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24055724.html      


'set path to server folder where output file will be saved
      'this should be changed for your environment
      'i.e. \\myserver\mainfolder\subfolder\targetfolder\
strPath="\\myserver\mainfolder\subfolder\targetfolder\"
 
'do not modify below this line
 
      'get local computer name
Set objNet = CreateObject("WScript.Network")
strComputer=objNet.ComputerName
 
      'build output file path and name
strOutputFile=strPath & "LocalAccts_" & strComputer & ".txt"
 
      'set constant for OpenTextFile of FileSystemObject - set to append
Const ForAppending = 8
      
      'create output file
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
    (strOutputFile, ForAppending, True)
 
Set colGroups = GetObject("WinNT://" & strComputer & "")
colGroups.Filter = Array("group")
 
For Each objGroup In colGroups
    For Each objUser in objGroup.Members
        objTextFile.WriteLine(strComputer & vbTab & objGroup.Name & vbTab & _
            objUser.Name)
    Next
Next
 
objTextFile.Close

   
0
 

Author Comment

by:lurezero
ID: 24337766
Thanks. Is there a way to generate the complete user name - first name and last name.
I am very new to vbscript....
Thanks
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Batuhan Cetin In this article I will be guiding through the process of removing a failed DC metadata from Active Directory (hereafter, AD) using the ntdsutil tool in a Windows Server 2003 environment. These steps are not necessary in a Win…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now