Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Help with exclusion list!!

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,64131
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help with exclusion list!!
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Help with exclusion list!! - 9/8/2008 7:45:38 PM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
I have a script that checks all the PC's within our domain for the installation of a pieceof software and if detected that it is running.

Now the script works fine but I need to add an exclusion list of PC's that we know do not have the software installed.

I can build the exclusion list by creating an array on the fly from a txt file.

But this is where I'm getting lost. I can't figure out how to put my loop command in.

I've put the loop in various parts of the scrript with no joy. And I've also a funny feeling that the following will happen.....

2000pc's in domain with around 200 exclusions.

So 1st array entry will check against all 2000 PC's. Then loop round to second entry for all 2000pc's.etc..etc.. My script will take days to finish.

Is there an easier way???

I'll copy the code minus the LOOP command for reading through the array.


      

< Message edited by ninjamaster -- 9/8/2008 7:51:19 PM >
 
 
Post #: 1
 
 RE: Help with exclusion list!! - 9/8/2008 9:21:06 PM   
  ginolard


Posts: 1066
Score: 21
Joined: 8/10/2005
Status: online
Ok, before I address this, I would make a suggestion regarding your PingPC function. 

At the moment, there's no point in it being a Function because you don't return a value.  I would change it to this


      

Then, you can just do the following in your Loop


      

Now, as for your exclusion list I would use a Dictionary object instead of an Array.  And use the Exists method to check whether or not the PC you want to check is in the Dictionary

You would do that check after this line


      

Go and read up on Dictionaries and have a bash at it.  If you still need help, come back here

_____________________________

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

(in reply to ninjamaster)
 
 
Post #: 2
 
 RE: Help with exclusion list!! - 9/8/2008 9:25:34 PM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
Excellent. I was hoping there would be an easier way!

And thanks for the PCPing rewrite ;)

(in reply to ginolard)
 
 
Post #: 3
 
 RE: Help with exclusion list!! - 9/8/2008 10:26:29 PM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
Hhhm. Ok I have the following. But PC's I have in the exclusion file and showing as included when ran? :#


      

< Message edited by ninjamaster -- 9/8/2008 10:28:02 PM >

(in reply to ginolard)
 
 
Post #: 4
 
 RE: Help with exclusion list!! - 9/8/2008 11:18:32 PM   
  ninjamaster

 

Posts: 107
Score: 0
Joined: 1/23/2007
Status: offline
It's OK. Got it. Me being stupid!

If dicExclusionList.Exists(strComputer) Then


should of course read

If objDictionary.Exists(strComputer) Then

:)

(in reply to ninjamaster)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help with exclusion list!! Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts