TABLE OF CONTENTS
Introduction
This guide walks through the steps required to automatically send an email to users 10 days before their Migration Slot. There is an additional section at the end for sending the email when the users are moved into a specific workflow process rather than being time-based.
Prepare Prerequisites
- For testing create a Blueprint and add a test User Migration to it
- Setup an email template. Administration -> User Migrations -> Email Templates -> Click here to add new item
- Email Name: <As required> e.g. "T-minus 10 days"
- Subject: <As required> e.g. "Windows 11 Project - 10 days to go..."
- Click on the script icon and add the email content. This can be either markdown or HTML.
- Click Save Changes
Create the ESM Plan
- Administration -> Extensions -> Servicing Plans -> User Migration Plans
- Service Plans -> New Service Plan
- Plan Name: <As required> e.g "T-minus 10 days email", click New Plan
- Schedule Settings -> Tick Reset Prior to Run
- Data Source -> Deselect All User Migrations option
- Data Source -> Only run on User Migrations in the test Blueprint
- Add the test User Migration to a Deployment Unit with a start date and end date which include a date seven days from today
- Now the test User Migration needs a migration slot: User Migrations -> All User Migrations -> Double click your user record -> click Update Migration Slot -> Set the migration slot to 7 days in the future from today -> Update
- Now we need to ensure the plan only runs against the relevant User Migrations. In the screenshot below the Evaluator is searching for users who are being migrated in the next 13 days (it's 13 rather than 10 to ensure emails aren't sent on a weekend, but rather the Friday before).
- Browse to Service Plan Rules -> Add New Setting:
- Add the two rules below:
- Notes:
- Rule 1: The Criteria search start date should be set to [Today] to catch late additions to the schedule. I.e. If a user was scheduled to be migrated three days from [Today], they should still receive the email.
- Rule 2: This defines the search end date. The Criteria should be at least three days greater that the T-minus time in case it falls on a weekend, in which case the email will be sent on the Friday before. In this case it's a T-minus 10 days email, so the criteria is [Today + 13]
- The email Schedule date (the date the email is actually sent) is dictated by the Plan Actions (not the evaluator rules) which in this case will always be 10 days prior to the migration date. This is configured in a later step. The email queue will therefore show a set of emails scheduled to be sent in the near future for users being migrated in the next 10 days.
- The email content is generated at the time the email is sent, NOT when it is queued. This ensures the user gets the latest version of the email.
- It is possible to combine the two rules into a single rule. For examples see the Reference section below.
- Click Validate Plan Rules and ensure they pass
- Now the action must be created. In Service Plan Actions (Publisher) click Add New Setting
- Setup as in screenshot below.
Ensure the Target matches the email name exactly
Set Param to Schedule:[DeployUnitSlotStart - 10 @ 08:00];DuplicateCheck:100;LateEmailLimit:10 - Notes:
- The DuplicateCheck setting ensures that duplicate emails are not sent. Set this to at least the t-minus days
- The LateEmailLimit setting ensures that emails with a scheduled send date which is a long time in the past are not sent in error. Set this to the t-minus days.
Click Validate Plan Actions and ensure it passes
Sae the plan
Test the Plan
Click Reset, Eval, Schedule & Publish
Check the test User Migrarion, Service Plans tab, ensure all logs are as expected
- Once it's all setup and working remove the test Blueprint from the plan source (it may be useful to target a specific process for production) and set a Schedule to Run under Schedule Settings as required
Reference
Rule Name | Rule Type | Data Location | Operator | Criteria | Description |
---|---|---|---|---|---|
Has a date set | Field | DeployUnitSlotStart | != | [Blank] | Identifies all assets which have been added to a slot in the DU |
Has no date set | Field | DeployUnitSlotStart | == | [Blank] | Identifies all assets which have not been added to a slot in the DU |
More than 10 days to go (Inclusive) | Field | DeployUnitSlotStart | >= | [Today + 10] | Identifies all assets with more than 10 days until they are due to be migrated |
Less than 10 days to go (Inclusive) | Field | DeployUnitSlotStart | <= | [Today + 10] | Identifies all assets with less than 10 days to go until they are due to be migrated |
More than 10 days ago (Inclusive) | Field | DeployUnitSlotStart | >= | [Today - 10] | Identifies all assets which have a migration slot more than 10 days ago |
Less than 10 days ago (Inclusive) | Field | DeployUnitSlotStart | <= | [Today - 10] | Identifies all assets which have a migration slot less than 10 days ago |
In the future | Field | DeployUnitSlotStart | > | [TimeStamp] | Identifies all assets which are due to be migrated in the future |
In the past | Field | DeployUnitSlotStart | < | [TimeStamp] | Identifies all assets which have a migration slot in the past |
Is Between 5 & 10 Days to go | Field | DeployUnitSlotStart | Is the Day | Between [Today + 5] & [Today + 10] | Identifies all assets which are due to be migrated between 5 days and 10 days in the future |
Not Between 5 & 10 Days to go | Field | DeployUnitSlotStart | Not the Day | Between [Today + 5] & [Today + 10] | Identifies all assets which are not due to be migrated between 5 days and 10 days in the future (Eg. a user who is due to be migrated tomorrow; a machine which is due to be migrated in 12 days' time, any asset which has a slot in the past) |
Is Between 5 & 10 Days ago | Field | DeployUnitSlotStart | Is the Day | Between [Today - 5] & [Today - 10] | Identifies all assets which have a migration slot between 5 days and 10 days ago |
Not Between 5 & 10 Days ago | Field | DeployUnitSlotStart | Not the Day | Between [Today - 5] & [Today - 10] | Identifies all assets which do not have a migration slot between 5 days and 10 days ago (Eg. a user with a migration slot 15 days ago; a machine which is due to be migrated in 2 days' time) |
Three days to go between 1pm & 7pm | Field | DeployUnitSlotStart | Is the Day | Between [Today + 3 @13:00] & [Today + 3 @19:00] | Identifies all assets which are due to be migrated in 3 days' time, between 1pm and 7pm |
Three days ago between 1pm & 7pm | Field | DeployUnitSlotStart | Is the Day | Between [Today - 3 @13:00] & [Today - 3 @19:00] | Identifies all assets which have a migration slot 3 days' ago, between 1pm and 7pm |
DeployUniitStart = 2021-01-25 | Field | DeployUnitSlotStart | Is the Day | 25/01/2021 | Identifies all assets which are due to be migrated on the 25/01/2021 |
Compare two dates | Compare Fields | DeployUnitSlotStart | <= | DU:EndDate | Identifies all assets which have a slot which falls in between two dates |
Further Support
If you require further support, please visit ManagementStudio's Service Desk to search the knowledge base or create a new support ticket.