Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Script for list out all local user's attribute in csv

Reply
 
Old 08-24-2009   #1 (permalink)


XP
 
 

Script for list out all local user's attribute in csv

Is there any VBscript can do the following:

List out all local user(not domain)'s attribute (Like the command "net user xxx" output)
1) User name
2) Full Name
3) Comment
4) Account active
5) Account expires
6) Password last set
7) Password expires
8) Last logon
9) User may change password
10) Local Group Memberships

And export to a csv or excel file?

Thanks all big brother !!

Stepheny

My System SpecsSystem Spec
Old 08-25-2009   #2 (permalink)
Richard Mueller [MVP]


 
 

Re: Script for list out all local user's attribute in csv

stepheny wrote:
Quote:

> Is there any VBscript can do the following:
>
> List out all local user(not domain)'s attribute (Like the command "net
> user xxx" output)
> 1) User name
> 2) Full Name
> 3) Comment
> 4) Account active
> 5) Account expires
> 6) Password last set
> 7) Password expires
> 8) Last logon
> 9) User may change password
> 10) Local Group Memberships
>
> And export to a csv or excel file?
>
This example VBScript program can be used to document all attributes of an
object:

http://www.rlmueller.net/Document%20Attributes.htm

The program is designed for AD objects but works fine with local objects as
well. You pass the AdsPath of the object to the program. For a local user
named jsmith on computer MyComputer the syntax would be:

cscript //nologo DocumentProperties.vbs WinNT://MyComputer/jsmith,user >
jsmith.txt

The above command should be entered at a command prompt. You should be in
the folder where the VBScript program DocumentProperties.vbs is saved, or
you must specify the full path to the file. I have redirected the output to
a text file called jsmith.txt. The UserFlags property indicates several
flags, like if the password expires. To document all local groups the user
is a direct member of you code similar to:
===========
' Bind to local user jsmith on computer MyComputer:
Set objUser = GetObject("WinNT://MyComputer/jsmith,user")

' Enumerate direct group memberships.
For Each objGroup In objUser.Groups
Wscript.Echo objGroup.Name
Next

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Why this script list a local administrator group members? PowerShell
Deleted corrupt attribute list entry Vista performance & maintenance
Re: Removing me from another user's contact list... Live Messenger
Interactive local logon script VB Script
Get a list of all my user's UNC printer connections? Vista print fax & scan


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46