Solved

Windows 2003 Local Users accounts

Posted on 2009-05-03
2
264 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 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