This project arose out of my frustration at not being able to easily remove machines from collections which had been populated from Active Directory groups.
Every script I came across was built for dealing with machines added directly. For those, though, one would be required to know the CollectionID of the collection and pass that to the script. I thought - as I tend to do - "Aren't these machines meant to make my life easy?" so that, coupled with the fact thatthere are no scripts for dealing with query-added machines, I set about building...er...this!
The UI is bare-bones, in order to keep the code as modular as possible.
Some of the flow looks a bit tortuous (e.g. why call the 'Execute' sub when all it really does is call 'AddTreeItemsFromSCCM') but that's because I have a "shell" HTA which I thrash about with for all sorts of different activities and it keeps my life simple!
There is a mix of WMI/WQL and direct ADO/SQL queries, mostly because I couldn't find equivalent queries in WQL for the SQL ones I use.
The script requires that:
the Microsoft Windows Common Controls v6 library (MSComCtlLib) which is contained in MSCOMCTL.OCX is installed and registered;
the SCCM client is installed on the workstation it will be run on;
the account used to run it has rights to administer SCCM and has write permissions to the SQL database. I believe normal SCCM operations use a proxy agent to make database changes.
Last edit: VBScab 2013-03-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This project arose out of my frustration at not being able to easily remove machines from collections which had been populated from Active Directory groups.
Every script I came across was built for dealing with machines added directly. For those, though, one would be required to know the CollectionID of the collection and pass that to the script. I thought - as I tend to do - "Aren't these machines meant to make my life easy?" so that, coupled with the fact thatthere are no scripts for dealing with query-added machines, I set about building...er...this!
Last edit: VBScab 2013-03-15