Extracting a detailed user list

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need some insight on creating a detailed list of users from a 2000 server.
The only thing I came up with was the net user command with the username, is
ther any way to generate the same information for all users in one step or do
I have to do it one at a time?

TIA
 
Rob said:
I need some insight on creating a detailed list of users from
a 2000 server. The only thing I came up with was the net user
command with the username, is ther any way to generate the same
information for all users in one step or do I have to do it one
at a time?
Hi,

You could e.g. use a VBScript (.vbs file) to feed the user names
to the net user command command, and redirect the output to a file:


'--------------------8<----------------------

' File where output from "net user" ends up
sLogFile = "c:\userinfo.txt"

Set oShell = CreateObject("WScript.Shell")
Set oWMI = GetObject("winmgmts:\\.\root\cimv2")

Set colAccounts = oWMI.ExecQuery("SELECT Name FROM Win32_UserAccount")

oShell.Run "%ComSpec% /c Echo Logging started " & Now _
& " >""" & sLogFile & """", 0, True

For Each oAccount in colAccounts
oShell.Run "%ComSpec% /c net.exe user " & oAccount.Name _
& " >>""" & sLogFile & """", 0, True
Next

MsgBox "Finished extracting user information", _
vbInformation + vbSystemModal, "User information"

'--------------------8<----------------------


WSH 5.6 documentation (local help file) can be downloaded from here
if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp
 
Back
Top