Skip to content

Commit 257d37c

Browse files
committed
set employee leave date time
1 parent 794e85a commit 257d37c

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

articles/active-directory/governance/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@
243243
href: workflows-faqs.md
244244
- name: Developer API reference Lifecycle Workflows- Azure Active Directory
245245
href: lifecycle-workflows-developer-reference.md
246+
- name: Set employeeLeaveDateTime for leaver workflows
247+
href: set-employee-leave-date-time.md
246248
- name: Preparing user accounts for Lifecycle workflows tutorials (Preview)
247249
href: tutorial-prepare-azure-ad-user-accounts.md
248250
- name: Configure a Logic App for Lifecycle Workflow use (Preview)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: Set employeeLeaveDateTime for leaver workflows
3+
description: Explains how to manually set employeeLeaveDateTime for leaver workflows using PowerShell.
4+
author: owinfreyATL
5+
ms.author: owinfrey
6+
ms.service: active-directory
7+
ms.topic: how-to
8+
ms.date: 09/07/2022
9+
ms.custom: template-how-to
10+
---
11+
12+
13+
14+
# Set employeeLeaveDateTime for leaver workflows
15+
16+
When creating leaver workflows, it's required to set the date and time for when a user leaves. This parameter, employeeLeaveDateTime, is used to trigger the leaver workflow to run. Unlike other parameters, which can be synchronized using HR inbound Provisioning, Azure AD Connect sync, or Azure AD Connect Cloud sync, you must currently manually set the employeeLeaveDateTime for each user you want to process a leaver workflow for.
17+
18+
To set the employeeLeaveDateTime for a user using PowerShell enter the following information:
19+
20+
```powershell
21+
Connect-MgGraph -Scopes "User.ReadWrite.All","User-LifeCycleInfo.ReadWrite.All"
22+
23+
Select-MgProfile -Name "beta"
24+
25+
$URI = "https://graph.microsoft.com/beta/users/528492ea-779a-4b59-b9a3-b3773ef6da6d"
26+
$Body = '{"employeeLeaveDateTime": "<Leave date>"}'
27+
Invoke-MgGraphRequest -Method PATCH -Uri $URI -Body $Body
28+
```
29+
30+
This is an example of a user who will leave on September 30, 2022 at 23:59.
31+
32+
```powershell
33+
Connect-MgGraph -Scopes "User.ReadWrite.All","User-LifeCycleInfo.ReadWrite.All"
34+
35+
Select-MgProfile -Name "beta"
36+
37+
$URI = "https://graph.microsoft.com/beta/users/528492ea-779a-4b59-b9a3-b3773ef6da6d"
38+
$Body = '{"employeeHireDate": "<Hire date>","employeeLeaveDateTime": "2022-09-30T23:59:59Z"}'
39+
Invoke-MgGraphRequest -Method PATCH -Uri $URI -Body $Body
40+
```
41+
42+
43+
## Next steps
44+
45+
- [How to synchronize attributes for Lifecycle workflows](how-to-lifecycle-workflow-sync-attributes.md)
46+
- [Lifecycle Workflows templates](lifecycle-workflow-templates.md)

0 commit comments

Comments
 (0)