|
Automating the script..
Hi Everyone.
Im new to these forums, so straight up, I will say Hello.
In answer to how to automate the script, when I need to do things like this I usually use a Notification policy.
Notification policies allow you to automate running some SQL, and you can set it on whatever schedule you would like.
The only catch is that you have to setup an automated action. I usually just create an empty batchfile and point the automated action at that, this causes nothing to happen.
Furthermore, the automated action will only run if you have rows returned from the query. If the query doesnt return rows, then you shouldnt even execute the automated action.
Creating Notification Policies to automate running queries is neat because you can export the items and re-use them on other Notification servers. It also easily allows you to disable the NP if you have a situation where you only want to perform some work and then switch the configuration off.
Keep in mind with this script that it only merges one instance of the duplicate name each run.. so that (and this would rarely be the case) if you have more than one duplicate for the name.domain pair, you will need to execute this script more than once to remove all of the duplicates.
I know how this script works, I was the one who wrote it when working for Altiris.
Cheers,
Steven Oakes
|