|
1 | 1 | ---
|
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 |
4 | 4 | services: active-directory
|
5 | 5 | author: shlipsey3
|
6 | 6 | manager: amycolannino
|
7 | 7 | ms.service: active-directory
|
8 | 8 | ms.topic: how-to
|
9 | 9 | ms.workload: identity
|
10 | 10 | ms.subservice: report-monitor
|
11 |
| -ms.date: 10/31/2022 |
| 11 | +ms.date: 04/05/2023 |
12 | 12 | ms.author: sarahlipsey
|
13 | 13 | ms.reviewer: besiler
|
14 | 14 |
|
15 | 15 | ms.collection: M365-identity-device-management
|
16 | 16 | ---
|
17 |
| -# How To: Manage inactive user accounts in Azure AD |
| 17 | +# How To: Manage inactive user accounts |
18 | 18 |
|
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. |
20 | 20 |
|
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). |
22 | 22 |
|
23 | 23 | ## What are inactive user accounts?
|
24 | 24 |
|
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. |
26 | 26 |
|
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. |
28 | 28 |
|
29 | 29 | 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.
|
30 | 30 |
|
31 |
| - |
32 | 31 | ## How to detect inactive user accounts
|
33 | 32 |
|
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: |
35 | 34 |
|
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` |
37 | 37 |
|
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` |
39 | 40 |
|
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` |
42 | 43 |
|
43 | 44 | > [!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*. |
46 | 46 |
|
47 | 47 | ## What you need to know
|
48 | 48 |
|
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. |
60 | 50 |
|
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). |
62 | 52 |
|
63 |
| -### What permission do I need to read the property? |
| 53 | +- The property is *not* available through the Get-AzureAdUser cmdlet. |
64 | 54 |
|
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. |
66 | 56 |
|
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 |
70 | 61 |
|
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. |
75 | 63 |
|
| 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. |
76 | 67 |
|
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. |
87 | 69 |
|
88 | 70 | ## Next steps
|
89 | 71 |
|
|
0 commit comments