You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ideally, to complete the lifecycle, registered devices should be unregistered when they are not needed anymore. However, due to, for example, lost, stolen, broken devices, or OS reinstallations you typically have stale devices in your environment. As an IT admin, you probably want a method to remove stale devices, so that you can focus your resources on managing devices that actually require management.
22
+
Ideally, to complete the lifecycle, registered devices should be unregistered when they aren't needed anymore. However, due to, for example, lost, stolen, broken devices, or OS reinstallations you typically have stale devices in your environment. As an IT admin, you probably want a method to remove stale devices, so that you can focus your resources on managing devices that actually require management.
23
23
24
24
In this article, you learn how to efficiently manage stale devices in your environment.
25
25
26
26
## What is a stale device?
27
27
28
-
A stale device is a device that has been registered with Azure AD but has not been used to access any cloud apps for a specific timeframe. Stale devices have an impact on your ability to manage and support your devices and users in the tenant because:
28
+
A stale device is a device that has been registered with Azure AD but hasn't been used to access any cloud apps for a specific timeframe. Stale devices have an impact on your ability to manage and support your devices and users in the tenant because:
29
29
30
30
- Duplicate devices can make it difficult for your helpdesk staff to identify which device is currently active.
31
31
- An increased number of devices creates unnecessary device writebacks increasing the time for Azure AD connect syncs.
@@ -35,7 +35,7 @@ Stale devices in Azure AD can interfere with the general lifecycle policies for
35
35
36
36
## Detect stale devices
37
37
38
-
Because a stale device is defined as registered device that hasn't been used to access any cloud apps for a specific timeframe, detecting stale devices requires a timestamp-related property. In Azure AD, this property is called **ApproximateLastLogonTimestamp** or **activity timestamp**. If the delta between now and the value of the **activity timestamp** exceeds the timeframe you have defined for active devices, a device is considered to be stale. This **activity timestamp** is now in public preview.
38
+
Because a stale device is defined as registered device that hasn't been used to access any cloud apps for a specific timeframe, detecting stale devices requires a timestamp-related property. In Azure AD, this property is called **ApproximateLastLogonTimestamp** or **activity timestamp**. If the delta between now and the value of the **activity timestamp** exceeds the timeframe you've defined for active devices, a device is considered to be stale. This **activity timestamp** is now in public preview.
39
39
40
40
## How is the value of the activity timestamp managed?
41
41
@@ -79,7 +79,7 @@ Define a timeframe that is your indicator for a stale device. When defining your
79
79
80
80
### Disable devices
81
81
82
-
It is not advisable to immediately delete a device that appears to be stale because you can't undo a deletion if there is a false positive. As a best practice, disable a device for a grace period before deleting it. In your policy, define a timeframe to disable a device before deleting it.
82
+
It isn't advisable to immediately delete a device that appears to be stale because you can't undo a deletion if there's a false positive. As a best practice, disable a device for a grace period before deleting it. In your policy, define a timeframe to disable a device before deleting it.
83
83
84
84
### MDM-controlled devices
85
85
@@ -122,7 +122,7 @@ Disable or delete Azure AD registered devices in the Azure AD.
122
122
123
123
## Clean up stale devices in the Azure portal
124
124
125
-
While you can clean up stale devices in the Azure portal, it is more efficient, to handle this process using a PowerShell script. Use the latest PowerShell V2 module to use the timestamp filter and to filter out system-managed devices such as Autopilot.
125
+
While you can clean up stale devices in the Azure portal, it's more efficient, to handle this process using a PowerShell script. Use the latest PowerShell V2 module to use the timestamp filter and to filter out system-managed devices such as Autopilot.
126
126
127
127
A typical routine consists of the following steps:
> The `Remove-AzureADDevice` cmdlet does not provide a warning. Running this command will delete devices without prompting. **There is no way to recover deleted devices**.
163
+
164
+
Using the same 90 day example we can pipe the output to delete the devices that have a logon time stamp over 90 days old.
165
+
166
+
```powershell
167
+
$dt = (Get-Date).AddDays(-90)
168
+
Get-AzureADDevice -All:$true | Where {$_.ApproximateLastLogonTimeStamp -le $dt} | Remove-AzureADDevice
169
+
```
170
+
159
171
## What you should know
160
172
161
173
### Why is the timestamp not updated more frequently?
162
174
163
-
The timestamp is updated to support device lifecycle scenarios. This attribute is not an audit. Use the sign-in audit logs for more frequent updates on the device.
175
+
The timestamp is updated to support device lifecycle scenarios. This attribute isn't an audit. Use the sign-in audit logs for more frequent updates on the device.
164
176
165
177
### Why should I worry about my BitLocker keys?
166
178
@@ -170,8 +182,8 @@ When configured, BitLocker keys for Windows 10 devices are stored on the device
170
182
171
183
When you delete an Azure AD device that was associated with a Windows Autopilot object the following three scenarios can occur if the device will be repurposed in future:
172
184
- With Windows Autopilot user-driven deployments without using pre-provisioning, a new Azure AD device will be created, but it won’t be tagged with the ZTDID.
173
-
- With Windows Autopilot self-deploying mode deployments, they will fail because an associate Azure AD device cannot be found. (This failure is a security mechanism to make sure that no “imposter” devices try to join Azure AD with no credentials.) The failure will indicate a ZTDID mismatch.
174
-
- With Windows Autopilot pre-provisioning deployments, they will fail because an associated Azure AD device cannot be found. (Behind the scenes, pre-provisioning deployments use the same self-deploying mode process, so they enforce the same security mechanisms.)
185
+
- With Windows Autopilot self-deploying mode deployments, they'll fail because an associate Azure AD device can’t be found. (This failure is a security mechanism to make sure that no “imposter” devices try to join Azure AD with no credentials.) The failure will indicate a ZTDID mismatch.
186
+
- With Windows Autopilot pre-provisioning deployments, they'll fail because an associated Azure AD device can’t be found. (Behind the scenes, pre-provisioning deployments use the same self-deploying mode process, so they enforce the same security mechanisms.)
0 commit comments