Using Powershell to change sftp site passwords

Advertisement

JustAsking
Joined:
Posts:
14

Using Powershell to change sftp site passwords

I use WINSCP to exchange files with an AS400 system. I use it via Powershell and have the file transfer integrated into a larger script that does a number of things, all automated.

The password rules on the AS400 for the SFTP account are now changing to require that the password on the AS400 change every 30 days.

I have already updated my Powershell script to generate a new password and assign it to the account on the AS400. Is there a way I can also update the WINSCP password via Powershell?

OR... Is there a way to supply the WINSCP password each time I want to connect with WINSCP? Again, I use WinSCPnet.dll via Powershell and would rather not switch over to doing "scripting".

Thanks.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: Using Powershell to change sftp site passwords

Sorry, I do not understand any of your questions.

JustAsking wrote:

Is there a way I can also update the WINSCP password via Powershell?
What do you mean by "WINSCP password"?

OR... Is there a way to supply the WINSCP password each time I want to connect with WINSCP?
You have to supply the password each time I want to connect with WINSCP.

Maybe, if you show us your script,. it will have it easier for us to understand, what you want.

Reply with quote

Guest

Re: Using Powershell to change sftp site passwords

martin wrote:

You have to supply the password each time I want to connect with WINSCP.

Maybe, if you show us your script,. it will have it easier for us to understand, what you want.

My bad...

I got ahead of myself. I do exactly what I asked in another of my Powershell scripts:

$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
Protocol = $fptProtocoliSeries
HostName = $ftpAddressiSeries
UserName = $ftpUseriSeries
Password = $ftpPassiSeries
SshHostKeyFingerprint = $ftpKeyiSeries
}

Never mind (long and hard day)...

Reply with quote

Advertisement

You can post new topics in this forum