Solved

Windows 2003 Local Users accounts

Posted on 2009-05-03
2
259 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
Comment Utility
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
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

18 Experts available now in Live!

Get 1:1 Help Now