Registered: 2004-02-06
Posts: 118
Loc: California, US
After not being able to find a function that will evaluate a computer membership recursively, I finally went and wrote one. This function has been in use in my environment on about 100 pilot workstations. The function is part of an INI-based software deployment script whereby membership in various software installation groups will cause installation or uninstallation of software. Therefore, this function needs to work correctly.
Like I said, so far it has worked flawlessly for 6 months on about 100 Windows 7 workstations. Anyway, I've always been a bit of a top-down thinker when it comes to coding and tend to brute-force my way through things. Before I put it into production on our 1500-some odd workstations, I wanted to get some opinions...
1. Am I utilizing the most cost-effective method of querying AD group memberships?
2. Are there logic optimizations I can take advantage of to speed things up? For instance, once I find a match, stop processing any further groups. Currently it processes all the way through.
3. And while I don't care too much for single-letter variables, can this thing be golfed down a bit (and still be readable by an average coder) to make it smaller and more efficient?
Any help or advice anybody has would be much appreciated!