Solved

Windows 2003 Local Users accounts

Posted on 2009-05-03
2
263 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

Suggested Solutions

Title # Comments Views Activity
home folder path for users 4 97
Dentrix G4 1 85
Windows 2008 set profile 9 44
Moving a windows 7 install to new hardware 9 81
I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

680 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