Automating Lotus Notes Credential in Transporter powershell cmdlets

One of the first challenges that we ran into was having to constantly type the password for the various transporter cmdlets that we placed into any of our automation for the conversion of mailboxes from Notes to Exchange. There are no examples that I could find for how to pass this information to a cmdlet such as Move-DominoMailbox. After some digging around I eventually stumbled upon the solution.

This allowed me to prompt for the credentials one time and store them in an encrypted file in a central location. The encrypted password information is user and workstation specific so it cannot be used by another user or even the same user on a different computer.

The following example will successfully allow the passing of a notes credential to the various Transporter Suite cmdlets without being prompted for the notes credentials:

To get and store the credential for the current user:

  1. $notespw = Read-Host "Enter the password for the Notes ID file" -AsSecureString
  2. $notespw | ConvertFrom-SecureString | Set-Content $pwfile -force

To retrieve the password and create the PSCredential object:
  1. $notespw = get-content $pwfile | ConvertTo-SecureString
  2. $notesid = new-object -typename system.management.automation.pscredential -argumentlist "-default-",$notespw

Example of use:

Example   
Get-DominoMailbox mary@contoso.com -SourceCredential $notesid

This entry was posted in Lotus Notes Conversion, Microsoft Transporter Suite, PowerShell. Bookmark the permalink.