# AAD Device Pending

<https://learn.microsoft.com/en-us/troubleshoot/azure/active-directory/pending-devices>

<figure><img src="https://2627915664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC5L8BFhTKgXFngIiQkEm%2Fuploads%2FFly1MKQLM1OyERcJEAZH%2Fimage.png?alt=media&#x26;token=93a8cab4-7b16-4d0a-9819-0b0bef75e719" alt=""><figcaption><p>Check if all checks out fine, use /leave and restart device to rejoin, may take more than 8 hours</p></figcaption></figure>

{% hint style="info" %}
\#1 Capture the output from 'dsregcmd /status' on the cmd prompt and upload the result here

\#2 Unregister the device by doing 'dsregcmd /reset' command in an elevated cmd prompt (Run as admin), then restart the PC. Try again if Teams can log in after 9 - 12 hours.

\#3 **Task Scheduler Library > Microsoft > Windows > Workplace Join**, manually start the task "Automatic-Device-Join" then make sure certificates issued by “**MS-Organization-Access**” and “**MS-Organization-P2P-Access \[xxxx]**” have been created in the local machine Personal certificate store, reboot PC

![](https://2627915664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC5L8BFhTKgXFngIiQkEm%2Fuploads%2FWlTIzZHTdM5RgJyYYxvR%2Frejoin-768x460.png?alt=media\&token=482e5328-1807-4b73-b02d-a63ef666e4d1)![](https://2627915664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC5L8BFhTKgXFngIiQkEm%2Fuploads%2Fiz1RufxPc0eIAsufQqsH%2Fcert-hybrid-azure-ad-600x109.png?alt=media\&token=309f05a7-e348-49a3-ace7-408b800b5a47)

\#4 The Last resort is to reset/format this machine
{% endhint %}

{% embed url="<https://learn.microsoft.com/en-us/entra/identity/devices/troubleshoot-hybrid-join-windows-current#troubleshoot-join-failures>" %}
Step by Step Guide
{% endembed %}

{% embed url="<https://learn.microsoft.com/en-us/entra/identity/devices/troubleshoot-device-dsregcmd>" %}
Information on the dsregcmd output
{% endembed %}

<figure><img src="https://2627915664-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC5L8BFhTKgXFngIiQkEm%2Fuploads%2FTNTvai0CV24kTZkrL3Nr%2Fimage.png?alt=media&#x26;token=0d89608d-8c76-4ee0-a5e5-255b95bb614b" alt=""><figcaption></figcaption></figure>

`Get-MgDevice -All -Filter "TrustType eq 'ServerAd'" | Where-Object{($`*`.ProfileType -ne "RegisteredDevice") -and (-not $`*`.AlternativeSecurityIds)} | select-object -Property AccountEnabled, Id, DeviceId, DisplayName, OperatingSystem, OperatingSystemVersion, TrustType | export-csv pendingdevicelist-summary.csv -NoTypeInformation`
