VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get the list of User accounts and its properties using Win32_UserAccount WMI Class

by Karthikeyan (187 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Unknown Difficulty
Originally Published: Tue 11th May 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Get the list of User accounts and its properties using Win32_UserAccount WMI Class

Rate Get the list of User accounts and its properties using Win32_UserAccount WMI Class



'Generated using 'WMI Win32 Class Autoscript Generator' - Developed by Karthikeyan
'Homepage: http://www.geocities.com/marskarthik

On Error Resume Next
Computer = "."
Set OutFile = CreateObject("WScript.Shell")
Const ForAppending = 2
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile ("c:\Win32_UserAccount.txt", ForAppending, True)
TextFile.WriteLine "Script for Win32_UserAccount Class by Karthikeyan"
TextFile.WriteLine 
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set Items = WMIService.ExecQuery("Select * from Win32_UserAccount",,48)
For Each SubItems in Items
TextFile.WriteLine "********************************************************************"
    TextFile.WriteLine "AccountType: " & SubItems.AccountType
    TextFile.WriteLine "Caption: " & SubItems.Caption
    TextFile.WriteLine "Description: " & SubItems.Description
    TextFile.WriteLine "Disabled: " & SubItems.Disabled
    TextFile.WriteLine "Domain: " & SubItems.Domain
    TextFile.WriteLine "FullName: " & SubItems.FullName
    TextFile.WriteLine "InstallDate: " & SubItems.InstallDate
    TextFile.WriteLine "LocalAccount: " & SubItems.LocalAccount
    TextFile.WriteLine "Lockout: " & SubItems.Lockout
    TextFile.WriteLine "Name: " & SubItems.Name
    TextFile.WriteLine "PasswordChangeable: " & SubItems.PasswordChangeable
    TextFile.WriteLine "PasswordExpires: " & SubItems.PasswordExpires
    TextFile.WriteLine "PasswordRequired: " & SubItems.PasswordRequired
    TextFile.WriteLine "SID: " & SubItems.SID
    TextFile.WriteLine "SIDType: " & SubItems.SIDType
    TextFile.WriteLine "Status: " & SubItems.Status
TextFile.WriteLine "********************************************************************"
Next
TextFile.Close
OutFile.Run "notepad.exe c:\Win32_UserAccount.txt",1,True


Download this snippet    Add to My Saved Code

Get the list of User accounts and its properties using Win32_UserAccount WMI Class Comments

No comments have been posted about Get the list of User accounts and its properties using Win32_UserAccount WMI Class. Why not be the first to post a comment about Get the list of User accounts and its properties using Win32_UserAccount WMI Class.

Post your comment

Subject:
Message:
0/1000 characters