1. Home
  2. Archive Shuttle
  3. Archive Shuttle KB
  4. INFO: Examples of PowerShell scripts that can run during Stage 2 of Archive Shuttle

INFO: Examples of PowerShell scripts that can run during Stage 2 of Archive Shuttle

Issue

This article contains some example PowerShell scripts that can be used during Stage 2 workflow processing

Solution

Send an email to a user when their migration is complete:

 

Add the following script:

 

Param($smtp,$emailSendAccount,$userName,$userEmail) $subject = "Notification: $userName - Migration of your data COMPLETED!" $body = "Dear <b><font color=green>$userName</b></font>, <br>" $body += "<p>migration of your <b>mailbox</b> successfully finished.<br>" $body
 += "<p><p> <i><font size=2>This message has 
been automatically generated by QUADROtech Archive Shuttle system, click
 <a 
href=http://www.quadrotech-it.com/products/archiveshuttle/>here</a>
 to check QUADROtech's website.</font></i><br>" Send-MailMessage –From $emailSendAccount –To $userEmail –Subject $subject –Body $body -BodyAsHtml -SmtpServer $smtp -Port 25

 

Add the following parameters

 

smtp

– any valid SMTP server inside the organization

emailSendAccount

– an email address that the service account running the PowerShell Execution module has access to

userName

– Token: {UserFirstName}

userEmail

– Token: {PrimarySMTPAddress}

 

It is advised to test the Send-MailMessage command line via PowerShell to refine the parameters that might be required by your SMTP server and to ensure that the message looks good in an email client.

 

Finally, the script execution has to be added to your chosen workflow.

 

The tokens/variables which can be used are described here.

Print Friendly, PDF & Email
Updated on February 6, 2019

Was this article helpful?

Related Articles