Skip to content

Commit 925598f

Browse files
committed
reports-stale-user-cleanup
1 parent ab0a8f9 commit 925598f

File tree

1 file changed

+29
-47
lines changed

1 file changed

+29
-47
lines changed

articles/active-directory/reports-monitoring/howto-manage-inactive-user-accounts.md

Lines changed: 29 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,71 @@
11
---
2-
title: How to manage inactive user accounts in Azure AD
3-
description: Learn about how to detect and handle user accounts in Azure AD that have become obsolete
2+
title: How to manage inactive user accounts
3+
description: Learn how to detect and resolve user accounts that have become obsolete
44
services: active-directory
55
author: shlipsey3
66
manager: amycolannino
77
ms.service: active-directory
88
ms.topic: how-to
99
ms.workload: identity
1010
ms.subservice: report-monitor
11-
ms.date: 10/31/2022
11+
ms.date: 04/05/2023
1212
ms.author: sarahlipsey
1313
ms.reviewer: besiler
1414

1515
ms.collection: M365-identity-device-management
1616
---
17-
# How To: Manage inactive user accounts in Azure AD
17+
# How To: Manage inactive user accounts
1818

19-
In large environments, user accounts are not always deleted when employees leave an organization. As an IT administrator, you want to detect and handle these obsolete user accounts because they represent a security risk.
19+
In large environments, user accounts are not always deleted when employees leave an organization. As an IT administrator, you want to detect and resolve these obsolete user accounts because they represent a security risk.
2020

21-
This article explains a method to handle obsolete user accounts in Azure AD.
21+
This article explains a method to handle obsolete user accounts in Azure Active Directory (Azure AD).
2222

2323
## What are inactive user accounts?
2424

25-
Inactive accounts are user accounts that are not required anymore by members of your organization to gain access to your resources. One key identifier for inactive accounts is that they haven't been used *for a while* to sign-in to your environment. Because inactive accounts are tied to the sign-in activity, you can use the timestamp of the last sign-in that was successful to detect them.
25+
Inactive accounts are user accounts that are not required anymore by members of your organization to gain access to your resources. One key identifier for inactive accounts is that they haven't been used *for a while* to sign in to your environment. Because inactive accounts are tied to the sign-in activity, you can use the timestamp of the last sign-in that was successful to detect them.
2626

27-
The challenge of this method is to define what *for a while* means in the case of your environment. For example, users might not sign-in to an environment *for a while*, because they are on vacation. When defining what your delta for inactive user accounts is, you need to factor in all legitimate reasons for not signing in to your environment. In many organizations, the delta for inactive user accounts is between 90 and 180 days.
27+
The challenge of this method is to define what *for a while* means in the case of your environment. For example, users might not sign in to an environment *for a while*, because they are on vacation. When defining what your delta for inactive user accounts is, you need to factor in all legitimate reasons for not signing in to your environment. In many organizations, the delta for inactive user accounts is between 90 and 180 days.
2828

2929
The last successful sign-in provides potential insights into a user's continued need for access to resources. It can help with determining if group membership or app access is still needed or could be removed. For external user management, you can understand if an external user is still active within the tenant or should be cleaned up.
3030

31-
3231
## How to detect inactive user accounts
3332

34-
You detect inactive accounts by evaluating the **lastSignInDateTime** property exposed by the **signInActivity** resource type of the **Microsoft Graph** API. The **lastSignInDateTime** property shows the last time a user made a successful interactive sign-in to Azure AD. Using this property, you can implement a solution for the following scenarios:
33+
You can detect inactive accounts by evaluating the `lastSignInDateTime` property exposed by the `signInActivity` resource type of the **Microsoft Graph API**. The `lastSignInDateTime` property shows the last time a user made a successful interactive sign-in to Azure AD. Using this property, you can implement a solution for the following scenarios:
3534

36-
- **Users by name**: In this scenario, you search for a specific user by name, which enables you to evaluate the lastSignInDateTime: `https://graph.microsoft.com/v1.0/users?$filter=startswith(displayName,'markvi')&$select=displayName,signInActivity`
35+
- **Users by name**: In this scenario, you search for a specific user by name, which enables you to evaluate the `lastSignInDateTime`:
36+
- `https://graph.microsoft.com/v1.0/users?$filter=startswith(displayName,'markvi')&$select=displayName,signInActivity`
3737

38-
- **Users by date**: In this scenario, you request a list of users with a lastSignInDateTime before a specified date: `https://graph.microsoft.com/v1.0/users?$filter=signInActivity/lastSignInDateTime le 2019-06-01T00:00:00Z`
38+
- **Users by date**: In this scenario, you request a list of users with a `lastSignInDateTime` before a specified date:
39+
- `https://graph.microsoft.com/v1.0/users?$filter=signInActivity/lastSignInDateTime le 2019-06-01T00:00:00Z`
3940

40-
> [!NOTE]
41-
> When you request the signInActivity property while listing users, the maximum page size is 120 users. Requests with $top set higher than 120 will fail. SignInActivity supports `$filter` (`eq`, `ne`, `not`, `ge`, `le`) *but* not with any other filterable properties.
41+
- **Last sign-in date and time for all users**: In this scenario you need to generate a report of the last sign-in date of all users. You request a list of all users, and the last `lastSignInDateTime` for each respective user:
42+
- `https://graph.microsoft.com/v1.0/users?$select=displayName,signInActivity`
4243

4344
> [!NOTE]
44-
> There may be the need to generate a report of the last sign in date of all users, if so you can use the following scenario.
45-
> **Last Sign In Date and Time for All Users**: In this scenario, you request a list of all users, and the last lastSignInDateTime for each respective user: `https://graph.microsoft.com/v1.0/users?$select=displayName,signInActivity`
45+
> When you request the `signInActivity` property while listing users, the maximum page size is 120 users. Requests with $top set higher than 120 will fail. The `signInActivity` property supports `$filter` (`eq`, `ne`, `not`, `ge`, `le`) *but not with any other filterable properties*.
4646
4747
## What you need to know
4848

49-
This section lists what you need to know about the lastSignInDateTime property.
50-
51-
### How can I access this property?
52-
53-
The **lastSignInDateTime** property is exposed by the [signInActivity resource type](/graph/api/resources/signinactivity) of the [Microsoft Graph API](/graph/overview#whats-in-microsoft-graph).
54-
55-
### Is the lastSignInDateTime property available through the Get-AzureAdUser cmdlet?
56-
57-
No.
58-
59-
### What edition of Azure AD do I need to access the property?
49+
This section lists several details about the `lastSignInDateTime` property.
6050

61-
To access this property, you need an Azure Active Directory Premium edition.
51+
- The `lastSignInDateTime` property is exposed by the [signInActivity resource type](/graph/api/resources/signinactivity) of the [Microsoft Graph API](/graph/overview#whats-in-microsoft-graph).
6252

63-
### What permission do I need to read the property?
53+
- The property is *not* available through the Get-AzureAdUser cmdlet.
6454

65-
To read this property, you need to grant the app the following Microsoft Graph permissions:
55+
- To access the property, you need an Azure Active Directory Premium edition license.
6656

67-
- AuditLog.Read.All
68-
- Directory.Read.All
69-
- User.Read.All
57+
- To read the property, you need to grant the app the following Microsoft Graph permissions:
58+
- AuditLog.Read.All
59+
- Directory.Read.All
60+
- User.Read.All
7061

71-
72-
### When does Azure AD update the property?
73-
74-
Each interactive sign-in that was successful results in an update of the underlying data store. Typically, successful sign-ins show up in the related sign-in report within 10 minutes.
62+
- Each interactive sign-in that was successful results in an update of the underlying data store. Typically, successful sign-ins show up in the related sign-in report within 10 minutes.
7563

64+
- To generate a `lastSignInDateTime` timestamp, you need a successful sign-in. Because the `lastSignInDateTime` property is a new feature, the value of the `lastSignInDateTime` property may be blank if:
65+
- The last successful sign-in of a user took place before April 2020.
66+
- The affected user account was never used for a successful sign-in.
7667

77-
### What does a blank property value mean?
78-
79-
To generate a lastSignInDateTime timestamp, you need a successful sign-in. Because the lastSignInDateTime property is a new feature, the value of the lastSignInDateTime property can be blank if:
80-
81-
- The last successful sign-in of a user took place before April 2020.
82-
- The affected user account was never used for a successful sign-in.
83-
84-
### For how long is the last sign-in retained?
85-
86-
The last sign-in date is associated with the user object. The value is retained until the next sign-in of the user.
68+
- The last sign-in date is associated with the user object. The value is retained until the next sign-in of the user.
8769

8870
## Next steps
8971

0 commit comments

Comments
 (0)