Login | |
|
 |
RE: Sometimes I really hate WMI - 4/18/2008 12:23:42 AM
|
|
 |
|
| |
dm_4ever
Posts: 2641
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
|
I queried my laptop (vista) and my other box (winxp) and Listing 2 is the same or faster than listing 1. Maybe if you show us how you measured the difference in speed I can try that.
_____________________________
dm_4ever My philosophy: K.I.S.S - Keep It Simple Stupid Read Me: http://www.visualbasicscript.com/m_24727/tm.htm Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: Sometimes I really hate WMI - 4/18/2008 12:25:04 AM
|
|
 |
|
| |
TNO
Posts: 1247
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
You could probably think of it like this: Dim Table : Table = Win32_UserAccount For Each Name in Table If LocalAccount = True Then 'Add to collection End If Next For Each SID in Table If (LocalAccount = True) AND (Name='Administrator') Then 'Add to collection End If Next At least that's how I imagine it occurring.
_____________________________
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
| |
|
|
|
 |
RE: Sometimes I really hate WMI - 4/18/2008 5:02:49 AM
|
|
 |
|
| |
ginolard
Posts: 1051
Score: 21
Joined: 8/10/2005
Status: offline
|
I just ran both scripts in Primalscript. Listing 1 came back with results almost immediately. Listing 2 sat there for about 30 seconds before I cancelled it. Of course, now that I run it on my PC here at home there is little to no difference in the speed. I wonder if it's only on machines in an AD domain that it has this issue?
< Message edited by ginolard -- 4/18/2008 5:04:51 AM >
_____________________________
Author of ManagePC - http://managepc.net AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm
|
|
| |
|
|
|
 |
RE: Sometimes I really hate WMI - 4/18/2008 7:17:10 AM
|
|
 |
|
| |
ginolard
Posts: 1051
Score: 21
Joined: 8/10/2005
Status: offline
|
Hmm, OK, maybe I'll try that. I can't query for a specific SID because I don't know the SID I want, that's the point. I need to get the SID of the logged on user (of remote machines) That's easy enough if it's a domain user, I can just can get it from AD but this seems the best way to get it for local users.
_____________________________
Author of ManagePC - http://managepc.net AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm
|
|
| |
|
|
|
|
|