Link to home
Start Free TrialLog in
Avatar of Carlos_Felipe
Carlos_FelipeFlag for Brazil

asked on

Modify default database for all logins

Due to enterprise policies, I need to modify all logins pointing to MASTER as default database.
Whoever is pointing to MASTER must point to a different database, such as TEMPDB.
The problem is that I have hundreds of servers running SQL Server 2000 or 2005 (default instance).
Is there a way to do it remotely through vbscript using SQLDMO?
My domain user account has sysadmin privileges against all those instances and I have a TXT file with all servers (one in each line).
Avatar of chapmandew
chapmandew
Flag of United States of America image

wow....out of curiosity, what is the reasoning behind changing everyones default db?  You might be able to get away w/ it through DMO or SMO, but you'd have to decide how to connect to each one, and then load up all of the logins, cycle though them, figure out what their default db is, and then change it.  I can show you how to do it for a particular instance, but you'd need to run the script on each one of them.   Is that something you might be interested in?
Avatar of Carlos_Felipe

ASKER

Please, share it.
ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks! You helped me a lot!
Does it not work on SQL 2000?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial