Quantcast
Channel: SQLServerCentral » Programming » Powershell » Latest topics
Viewing all articles
Browse latest Browse all 467

Managing Connection properties of Maintenance plans using Powershell

$
0
0
Hi All,We are managing the password reset activity from a central server for a login which is used on our servers for executing jobs and maintenance plan jobs.We are using the below powershell script for changing password which works quite well :$Items = Import-CSV $ENV:TEMP\PwdList.csv -Delimiter "|" ForEach ($Item in $Items){ $Instance = $Item.ServerName $Pwd = $Item.Pwd $Server = New-Object Microsoft.SqlServer.Management.Smo.Server($Instance) $Server.Logins.Item('adw').ChangePassword($Pwd) $Server.Logins.Item('adw').Alter()}Everything works fine, however, there are some maintenance plan jobs which uses this login. So I have to open the maintenance Plan -> go to manage connection -> local server connection and then change the password there as well. If I do not perform this activity, the maintenance plan fails.Can someone please let me know if there is a way to handle this as well using powershell so that everything is automated ?Thanks in advance.

Viewing all articles
Browse latest Browse all 467

Trending Articles