Couple of other things to point out in the code:
If you're going to use a counter, be sure to set it to some known value (usually 0). That's just a neatness item, but it helps.
When you search with that method (enumerate) then you're trying to enumerate every user in the domain and return those with the value of blue bell in the description field that are users. When you meet up with an OU, then re-enter the function. You are passing two variables to the function that only accepts one however. I suspect you'll want to fix that.
I also don't think you're taking into account the proper types. You took into account what to do if you ran into an OU, but not a CN. Why not?
Finally, if it were me, I'd use a different method. Using that enumeration works fine if you have plenty of time to wait and if you know the OU/CN you want to query in the first place. If you don't, I think you'd do better with adsi type calls instead.
My $0.04 worth (USD)
On 9/15/06, joe <[EMAIL PROTECTED]> wrote:
However this isn't a query, it is an enumeratiion, no 1000 record limit here...There could be various issues. I don't code in _vbscript_ enough to catch issues at a glance especially with recursive functions which can introduce nice oddities. The OP doesn't indicate the number of users he considers "too high" but if there were a rollover going on, it would be quite odd if the count actually resulted in zero versus some other positive or negative number which you normally get with integer overflow.My recommendation would be to add in what are called debug or trace statements which simply output status generously that tell you the count every time it is updated as well as info about when a new OU is being opened up. More than likely, you will see the code dumping out at some point.Writing this as an ADO query would be substantially faster over enumeration and recursion.And if you are curious... :o)adfind -default -f "&(samaccounttype=805306368)(description=Blue Bell)" -cjoe
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of [EMAIL PROTECTED]
Sent: Friday, September 15, 2006 4:13 PMSubject: Re: [ActiveDir] Slightly OT: Modifying AD _vbscript_
You are almost assuredly running into the default return limit of 1000 items. AD queries will only return that many items per query by default. In order to retrieve more information you need to use paging. I personally use SQL style syntax because I know SQL and that is what the MS script center has available for learning. Therefore the relevant code for me is objCommand.Properties("Page Size") = 1000, I am unsure how you would modify your query to use paging, perhaps someone else can chime in with the syntax needed.
Thanks,
Andrew Fidel
"Alex Alborzfard" <[EMAIL PROTECTED] >
Sent by: [EMAIL PROTECTED]09/15/2006 12:28 PM
Please respond to
ActiveDir@mail.activedir.org
To<ActiveDir@mail.activedir.org> cc Subject[ActiveDir] Slightly OT: Modifying AD _vbscript_
I'm sure this can be done more elegantly with joeware's tools or others, but in the spirit of learning, I whipped up this primer _vbscript_ with the help from a site.
What I want to do is to modify it, so it can count # of employees in each location and output it to a simple text/csv file.
In our AD, we enter the location name in the Description field.
Also when the number is too high, the script doesn't return anything. I think I have to change the variable type of intCounter to something that can hold bigger values,
but don't know what.
Can some one take a look and help me or give me pointers?
TIA
Alex
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Alex Alborzfard
Sent: Wednesday, September 13, 2006 9:22 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] OT: Management Solutions
What is the largest environment WSUS can be deployed effectively? At what point you're better off going with something like Shavlik or Patchlink?
What do they give you that WSUS doesn't?
We're trying to put in place a patch management solution for a company that's midsize (~1700 users), but with offices scattered all over the world.
But we're not sure how to architect the whole thing (how many servers, layers, and where-what's the cutoff point:bandwidth, # of users?-).
The other issue is the industry we're in: healthcare. We're constantly audited and for every single task we have to test, write validation and justification.
So we're not sure how can we do this, with so many patches MS puts out every Tuesday, without going insane! And this is just for desktops; servers are
a whole different ball of wax.
Anybody out there had to deal with similar issues?
Alex
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Brian Desmond
Sent: Monday, September 11, 2006 9:34 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] OT: Management Solutions
I use WSUS for patching in some decent size places. My strategy has been to combine a variety of free products into a single system – I've gotten good at it and I've also written glue when I need to. My overall feeling is that I get more flexibility just gluing things together than with a single baked product.
Thanks,
Brian Desmond
[EMAIL PROTECTED]
c - 312.731.3132
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Robert Rutherford
Sent: Monday, September 11, 2006 6:31 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] OT: Management Solutions
I agree with Brian that Ghost does tend to be the front runner for imaging (IMHO).. I've tested and used many but Ghost is a mature project which does what it says on the tin. You'll be surprised how forgiving it is and how much you can do with varying software and hardware with a little work.
In terms of helpdesk… well it's a minefield and a road of I have travelled many times. I have actually found that most of the time it's actually easier to get a dev guy to come in and build a system which actually meets your requirements. I have found this to be cheaper (most of the time) in the larger organisations as every organisation has different SLA's, contracts, processes, methods, etc.
I just recommend going onto sourceforge.net and typing 'helpdesk' initially. This should get you going and you may find something that suits your needs or something you can amend to fit. Yes, you can go for the bigger boys, i.e. Hornbill but you'll pay for it….. have a sniff around and see what fits your requirements.
In terms of patch deployment… I do like Patchlink. It will give you patch deployment across most applications with good reporting. You also get software and hardware inventory included in the price.
Cheers,Rob
Robert Rutherford
QuoStar Solutions LimitedT: +44 (0) 8456 440 331
F: +44 (0) 8456 440 332
M: +44 (0) 7974 249 494
E: [EMAIL PROTECTED]
W: www.quostar.com
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Brian Desmond
Sent: 11 September 2006 20:26
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] OT: Management Solutions
I have a lot of experience using Ghost for all of that but helpdesk. Helpdesk I have worked with Peregrine (will empty your check book & very complex), TrackIt (kind of basic but folks seem to like it), and customized free open source package called Liberum (so far my favorite).
Thanks,
Brian Desmond
[EMAIL PROTECTED]
c - 312.731.3132
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Alan J. Gendron
Sent: Monday, September 11, 2006 3:16 PM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] OT: Management Solutions
I would love some feedback from those that actually use some of these products. We initially started looking at a Helpdesk solution. It has now evolved into an asset management, OS deployment, patch management and license compliance package. I can't tell you whether it's evolved to this because the package we are looking at has it or because it was decided we could use the additional functionality. The current front-runner is Altiris. Could anyone provide some helpful insight into this package or a comparable solution we could look at? If we're going to spend the money, I'd like to see us spend it wisely. Thank you in advance.
Alan
Alan J. Gendron
Senior Network SpecialistLutheran Church Extension Fund
Sunset Corporate Center
10733 Sunset Office Drive
St. Louis, MO 63127-1219
314.885.6596