{"id":4780,"date":"2023-05-26T15:36:53","date_gmt":"2023-05-26T22:36:53","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=4780"},"modified":"2023-05-26T15:36:54","modified_gmt":"2023-05-26T22:36:54","slug":"how-to-get-azure-ad-users-with-registered-devices-using-powershell","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=4780","title":{"rendered":"How to Get Azure AD Users with Registered Devices Using PowerShell"},"content":{"rendered":"\n<p>In this post, I am going to share Powershell script to find and list devices that are registered by Azure AD users. We can use the&nbsp;<strong>Get-AzureADUserRegisteredDevice<\/strong>&nbsp;cmdlet to get the registered devices.<\/p>\n\n\n\n<p>Before proceed run the below command to connect Azure AD Powershell module.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>Connect-AzureAD<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">List registered devices of all Azure AD users:<\/h3>\n\n\n\n<p>To get a report of the device list for all Azure AD users, first, we need to get users by Get-AzureADUser cmdlet and pipe the user list to Get-AzureADUserRegisteredDevice cmdlet.<\/p>\n\n\n\n<p>$Result=@()<br>$Users = Get-AzureADUser -All $true | Select UserPrincipalName,ObjectId<br>$Users | ForEach-Object {<br>$user = $_<br>Get-AzureADUserRegisteredDevice -ObjectId $user.ObjectId | ForEach-Object {<br>$Result += New-Object PSObject -property @{<br>DeviceOwner = $user.UserPrincipalName<br>DeviceName = $_.DisplayName<br>DeviceOSType = $_.DeviceOSType<br>ApproximateLastLogonTimeStamp = $_.ApproximateLastLogonTimeStamp<br>}<br>}<br>}<br>$Result | Select DeviceOwner,DeviceName,DeviceOSType,ApproximateLastLogonTimeStamp<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Export Report to CSV file:<\/h3>\n\n\n\n<p>You can export the result to CSV file using the command Export-CSV.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>$Result<\/code><code>| <\/code><code>Export-CSV<\/code><code>\"C:\\AzureADJoinedDevices.csv\"<\/code><code>-NoTypeInformation<\/code><code>-Encoding<\/code><code>UTF8<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Ref: <a href=\"https:\/\/morgantechspace.com\/2019\/06\/get-azure-ad-users-with-registered-devices-powershell.html\">Get Azure AD Users with their Registered Devices using Powershell (morgantechspace.com)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, I am going to share Powershell script to find and list devices that are registered by Azure AD users. We can use the&nbsp;Get-AzureADUserRegisteredDevice&nbsp;cmdlet to get the registered devices. Before proceed run the below command to connect Azure AD Powershell module. 1 Connect-AzureAD List registered devices of all Azure AD users: To get <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=4780\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1249,10,1224],"tags":[1613],"class_list":["post-4780","post","type-post","status-publish","format-standard","hentry","category-azure-microsoft","category-microsoft","category-powershell","tag-get-azure-ad-users-with-registered-devices-using-powershell"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4780","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4780"}],"version-history":[{"count":1,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4780\/revisions"}],"predecessor-version":[{"id":4781,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4780\/revisions\/4781"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}