Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Automate Changing Service Password.

Author  Topic 

scottpt
Posting Yak Master

186 Posts

Posted - 2002-11-15 : 13:39:34
Our company requires that passwords be rotated every 90 days. I can use at and the net command to change the user password and stop/start the service, but how do I script changing the password on the service.

Here is the process I am thinking about using
1) xp_cmdshell NET USER to change pwd
2) ???? somehow change the pwd on the services????
--Any help here would be greatly appreciated.
3) xp_cmdshell 'at XX:XXPM NET START mssqlservice'
-- probably schedule this 15-30mins after
4) xp_cmdshell 'net stop sqlserveragent'
5) xp_cmdshell 'net stop mssqlservice'

6) Go through and delete at cmds.
-- run xp_cmdshell 'at' and place results in table.
parse out at id by looking at the command.
xp_cmdshell 'at {id} /DELETE'

Questions,comments help???

scottpt
Posting Yak Master

186 Posts

Posted - 2002-11-18 : 09:18:46
OK more info, I have about 15 servers that I support so mannually changing would take a good chunk of time. I have all the servers set up as linked servers on my monitoring server. sa password is easy because I just have to execute {servername}.master.dbo.sp_passwrd to change that. All the servers are using a local admin user to run sql server, so it would be easy to write a script to do this. I just need the syntax to change a service password.

Go to Top of Page
   

- Advertisement -