Skip to main content

Posts

Showing posts from August, 2007

sms: moving collections through a command line...

well, during my travel, i find myself at a site whose collection management was a little sparse. to help move them along, i wrote up a script to move a collection to a new parent collection, through a command line. it was a little bit of a challenge because there weren't very many samples floating around. many thanks to dave lippa and the rest of the group at myitforum for their help! i shamelessly stole stuff out of greg ramsey's script. the script is located here . there's not that much to it, actually. you simply tell it the old parent, the new parent, and the id of the collection you're moving. i suppose it's more concept than anything else. it'd be easy to make this thing much more useful... but you know... necessity. less words. :| just keep in mind when doing something like this that in order to remove the current collection link, you have to add a new one. otherwise, it will go through as if it works but never remove it. order it correctly and t

sms: selecting objects not in a collection

if you were interested in a way of retrieving objects into a collection that don't exist in another collection, it's actually not very difficult. for example, you have a collection of clients with antivirus.  now you want to create a collection of clients that do not have antivirus.  instead of creating a new one, you run subselect to bring back all the clients that are not in the original antivirus collection. the only thing you have to know is the collection id of the collection that you want to check. for the samples below, note that [collid] is a generic tag for your collection ids. if you examine the root\sms\site_ of your sms server, you'll see a list of sms collections labeled with: sms_cm_res_coll_[collid] this is what you need to build your subselect query. if you query this in wbemtest, with something like select * from sms_cm_res_coll_[collid] you should get back a list of resource ids which look something like this: ... sms_cm_res_coll_[coll

mom: icmp pings for servers...

most of you are probably familiar with the icmpping script available from huntland services . one of the admins i work with wanted something that would do the same type of functionality but work for a list of servers. i took it a tiny step further and had it read from an ou instead of a text file. you'll want to modify this part to reflect your environment: oCommand.CommandText = " ;" & _ "(&(objectClass=Computer)(objectCategory=Computer));name" sSiteName is the variable that you can specify in your parameters location. you could even put the path directly into the script and bypass all that. anyway, here's the script ! i tried to put it in this post... but you know how those translations go. :) have fun!