MSFN Forum: extract users - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

extract users Rate Topic: -----

#1 User is offline   Michael_C 

  • Newbie
  • Group: Members
  • Posts: 22
  • Joined: 05-September 05

  Posted 13 December 2006 - 08:40 AM

Hi,

Do any of you have a script that extract users + description
from windows 2003 Local users and groups.

This post has been edited by Michael_C: 13 December 2006 - 08:41 AM



#2 User is offline   cluberti 

  • Gustatus similis pullus
  • Group: Supervisor
  • Posts: 11,001
  • Joined: 09-September 01
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 13 December 2006 - 06:24 PM

This might help you (script is about halfway down the page):
http://www.planet-source-code.com/vb/scrip...03&lngWId=1

Next time, consider posting this question in the Programming section of the forums for a quicker answer. Moving post there.

#3 User is offline   Michael_C 

  • Newbie
  • Group: Members
  • Posts: 22
  • Joined: 05-September 05

Posted 14 December 2006 - 04:01 AM

Iam not that god to vb.

i cant get it to work i recive this.

C:\Documents and Settings\Administrator\Desktop>cscript top.vbs
Microsoft ® Windows Script Host Version 5.6
Copyright © Microsoft Corporation 1996-2001. All rights reserved.

C:\Documents and Settings\Administrator\Desktop\top.vbs(1, 9) Microsoft VBScript
compilation error: Expected identifier

????

#4 User is offline   Michael_C 

  • Newbie
  • Group: Members
  • Posts: 22
  • Joined: 05-September 05

Posted 15 December 2006 - 08:20 AM

I have found this at it work

On Error Resume Next

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery _
("Select * from Win32_UserAccount Where LocalAccount = True")

For Each objItem in colItems
Wscript.Echo "Account Type: " & objItem.AccountType
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Disabled: " & objItem.Disabled
Wscript.Echo "Domain: " & objItem.Domain
Wscript.Echo "Full Name: " & objItem.FullName
Wscript.Echo "Local Account: " & objItem.LocalAccount
Wscript.Echo "Lockout: " & objItem.Lockout
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Password Changeable: " & objItem.PasswordChangeable
Wscript.Echo "Password Expires: " & objItem.PasswordExpires
Wscript.Echo "Password Required: " & objItem.PasswordRequired
Wscript.Echo "SID: " & objItem.SID
Wscript.Echo "SID Type: " & objItem.SIDType
Wscript.Echo "Status: " & objItem.Status
Wscript.Echo
Next

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy