|
发表于 2009-10-29 17:48:03
|
显示全部楼层
; 生成于 AutoIt Scriptomatic
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
$strComputer = "localhost"
$Output=""
$Output = $Output & "Computer: " & $strComputer & @CRLF
$Output = $Output & "==========================================" & @CRLF
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_UserAccount", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) then
For $objItem In $colItems
$Output = $Output & "AccountType: " & $objItem.AccountType & @CRLF
$Output = $Output & "Caption: " & $objItem.Caption & @CRLF
$Output = $Output & "Description: " & $objItem.Description & @CRLF
$Output = $Output & "Disabled: " & $objItem.Disabled & @CRLF
$Output = $Output & "Domain: " & $objItem.Domain & @CRLF
$Output = $Output & "FullName: " & $objItem.FullName & @CRLF
$Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF
$Output = $Output & "LocalAccount: " & $objItem.LocalAccount & @CRLF
$Output = $Output & "Lockout: " & $objItem.Lockout & @CRLF
$Output = $Output & "Name: " & $objItem.Name & @CRLF
$Output = $Output & "PasswordChangeable: " & $objItem.PasswordChangeable & @CRLF
$Output = $Output & "PasswordExpires: " & $objItem.PasswordExpires & @CRLF
$Output = $Output & "PasswordRequired: " & $objItem.PasswordRequired & @CRLF
$Output = $Output & "SID: " & $objItem.SID & @CRLF
$Output = $Output & "SIDType: " & $objItem.SIDType & @CRLF
$Output = $Output & "Status: " & $objItem.Status & @CRLF
if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
$Output=""
Next
$objItem.Rename('admin') =>重命名
Else
Msgbox(0,"WMI 输出","No WMI Objects Found for class: " & "Win32_UserAccount" )
Endif
Func WMIDateStringToDate($dtmDate)
Return (StringMid($dtmDate, 5, 2) & "/" & _
StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _
& " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2))
EndFunc |
|