Hey guys what am I doing wrong?
I want to have my code loop thru and array...how do I do that with wmi?
I am looking for the wmi object that can give me pcname and locally loggedon person...man is it hard to find these attributes that match the object class???help do you guys know which object class has the pcname and locally logged on person? that is all I need grrrr help!

 Quote:


Break On
$Branch = "emsr8", "emsr7"

For each $Element in $Branch
$strComputer = $Element
$objWMIService = GetObject("winmgmts:\\" + $strComputer + "\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_Account",,48)
For each $objItem in $colItems
"Caption: " + $objItem.Caption ?
"Description: " + $objItem.Description ?
"Domain: " + $objItem.Domain ?
"InstallDate: " + $objItem.InstallDate ?
"LocalAccount: " + $objItem.LocalAccount ?
"Name: " + $objItem.Name ?
"SID: " + $objItem.SID ?
"SIDType: " + $objItem.SIDType ?
"Status: " + $objItem.Status ?
?
Next
Next




_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin