Use this Perl script to add Enterprise Manager registrations from a text file. The text file should contain three fields seperated by spaces. The first two fields are the server groups you want to create, and the last is the server name. ex...
Production Accounting ACTPRSQL01
QA Accounting ACTQASQL01
The script also goes out and registers all SQL Servers broadcasting on the network under a category called UNKNOWN.
I have hard-coded the script using integrated security to register the servers, but you can always easily modify this in the RegisterServer subroutine.
If you don't want to lose your current Enterprise Manager config, follow these steps...
1. Open Enterprise Manager
2. Go to Tools > Options.
3. Note the Read/Store user independent option - this is very important!
4. If the box is checked, uncheck it and exit EM. Open regedit (not regedt32, we're not changing registry permissions!). Delete all the subkeys (folders) under ...
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\80\Tools\SQLEW\Registered Servers X
5. If the box is NOT checked, check it and exit EM. Open regedit (not regedt32, we're not changing registry permissions!). Delete all the subkeys (folders) under ...
HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\80\Tools\SQLEW\Registered Servers X
6. Create your text file and run the script.
perl registerservers.pl -fTextFileName.txt
Your EM should now contain a bunch of SQL Servers you have come to love and enjoy, along with a bunch of other ones you had no idea existed. If you want to flip back to your old config, just toggle the Read/Store user independent option back to where it was.
By the way, in case you were asking, you can't simply copy the registry keys from one machine to another. The SQL Server info is encrypted.
Future upgrades: (Ok, known bugs, gee whiz!)
1. Error handling
2. RegisterServer subroutine to not add existing registered servers.
3
Another script from DOS but shows alerts
Like the one posted before, the use of the SP is like this: proc_alerts 1,18. This will show the first 18 alerts on the system. OR proc_alerts 20,35 will show from 20 to 35. This lets you manage the list without letting go out of the screen.
2001-11-03
1,042 reads