Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Managing Connection properties of Maintenance plans using Powershell


Managing Connection properties of Maintenance plans using Powershell

Author
Message
rollercoaster43
rollercoaster43
Valued Member
Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)

Group: General Forum Members
Points: 65 Visits: 434
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.
Gary Varga
Gary Varga
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8245 Visits: 6121
I have no access to a SQL Server instance so this is just a longshot (and probably not helpful) so sorry if this wastes your time.

Is there a PowerShell script (dropdown?) button or textbox that you can copy the necessary script for?

Gaz

-- Stop your grinnin' and drop your linen...they're everywhere!!!
rollercoaster43
rollercoaster43
Valued Member
Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)

Group: General Forum Members
Points: 65 Visits: 434
Hi Gaz,

I am sorry I did not understand your question Sad

My question is regarding maintenance plans wherein after changing password of a login, we have to manually reset the password inside the Maintenance plan in the connection manager.

There I cannot see any drop down or button for powershell script .. Sad
Gary Varga
Gary Varga
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8245 Visits: 6121
Some of the dialogs in SSMS provide the PowerShell commands that perform what is being done through the UI allowing the DBA (for the want of a better term) to copy the script. I don't know that area off the top of my head and was hoping that a longshot suggestion might prove lucky. Sorry that it didn't.

Gaz

-- Stop your grinnin' and drop your linen...they're everywhere!!!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search