Solved

Windows 2003 Local Users accounts

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

So you have two Windows Servers and you have a directory/folder/files on one that you'd like to mirror to the other?  You don't really want to deal with DFS or a 3rd party solution like Doubletake. You can use Robocopy from the Windows Server 200…
Learn about cloud computing and its benefits for small business owners.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

810 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