Home

Report AAD Users together with their Registered Device

%3CLINGO-SUB%20id%3D%22lingo-sub-650302%22%20slang%3D%22en-US%22%3EReport%20AAD%20Users%20together%20with%20their%20Registered%20Device%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-650302%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Guys%3C%2FP%3E%3CP%3ENeed%20assistance%20to%20get%20a%20report%20of%20Azure%20AD%20users%20together%20with%20their%20registered%20device%20name%2C%20I%60m%20trying%20the%20following%20command%20but%20I%60m%20not%20getting%20the%20correct%20results%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EForeach%20User%20in%20%E2%80%9C%3CSPAN%3EGet-ADUser%20-All%E2%80%9D%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20UserCreds%20%3D%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EGet-AzureADUserRegisteredDevice%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B-ObjectId%20%24User%3C%2FSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-650613%22%20slang%3D%22en-US%22%3ERe%3A%20Report%20AAD%20Users%20together%20with%20their%20Registered%20Device%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-650613%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20has%20been%20answered%20several%20times%20already%2C%20do%20a%20search%20next%20time%20%3A)%3C%2Fimg%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3EGet-AzureADUser%20%7C%20%25%20%7B%24DeviceOwner%20%3D%20%24_.UserPrincipalName%3B%20Get-AzureADUserRegisteredDevice%20-ObjectId%20%24_.ObjectId%20%7D%20%7C%20select%20%40%7Bn%3D%22DeviceOwner%22%3Be%3D%7B%24DeviceOwner%7D%7D%2CDisplayName%2CDeviceOSType%2CApproximateLastLogonTimeStamp%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-651215%22%20slang%3D%22en-US%22%3ERe%3A%20Report%20AAD%20Users%20together%20with%20their%20Registered%20Device%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-651215%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3Bthanks%20for%20the%20script%20and%20I%20did%20try%20it%20but%20it%20doesn%60t%20bring%20the%20results%2C%20please%20see%20attached%20screenshot.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-652630%22%20slang%3D%22en-US%22%3ERe%3A%20Report%20AAD%20Users%20together%20with%20their%20Registered%20Device%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-652630%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETry%20using%20an%20account%20that%20has%20sufficient%20permissions%20to%20enumerate%20users%20in%20the%20directory%20as%20well%20as%20call%20the%26nbsp%3B%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3EGet-AzureADUserRegisteredDevice%3C%2FFONT%3E%20cmdlet.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-652921%22%20slang%3D%22en-US%22%3ERe%3A%20Report%20AAD%20Users%20together%20with%20their%20Registered%20Device%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-652921%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F349494%22%20target%3D%22_blank%22%3E%40Simphiwe_Mkhize01%3C%2FA%3E%26nbsp%3B%20Hello!%20You've%20posted%20your%20question%20in%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FCommunity-Discussion%2Fbd-p%2FCommunityQuestions%22%20target%3D%22_blank%22%3ECommunity%20Discussion%20space%3C%2FA%3E%2C%20which%20is%20intended%20for%20discussion%20around%20the%20Tech%20Community%20website%20itself%2C%20not%20product%20questions.%20I'm%20moving%20your%20question%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Active-Directory%2Fbd-p%2FAzure-Active-Directory%22%20target%3D%22_self%22%3EAzure%20Active%20Directory%20space%3C%2FA%3E%20-%26nbsp%3Bplease%20post%20Azure%20Active%20Directory%20questions%20here%20in%20the%20future.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-653020%22%20slang%3D%22en-US%22%3ERe%3A%20Report%20AAD%20Users%20together%20with%20their%20Registered%20Device%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-653020%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F41707%22%20target%3D%22_blank%22%3E%40Eric%20Starker%3C%2FA%3E%26nbsp%3Bthank%20you%20for%20your%20assistance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-653025%22%20slang%3D%22en-US%22%3ERe%3A%20Report%20AAD%20Users%20together%20with%20their%20Registered%20Device%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-653025%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3Bwill%20try%20that%20and%20give%20feedback.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Simphiwe_Mkhize01
New Contributor

Hi Guys

Need assistance to get a report of Azure AD users together with their registered device name, I`m trying the following command but I`m not getting the correct results:

 

Foreach User in “Get-ADUser -All” {

              UserCreds = Get-AzureADUserRegisteredDevice -ObjectId $User              

}

6 Replies

This has been answered several times already, do a search next time :)

 

Get-AzureADUser | % {$DeviceOwner = $_.UserPrincipalName; Get-AzureADUserRegisteredDevice -ObjectId $_.ObjectId } | select @{n="DeviceOwner";e={$DeviceOwner}},DisplayName,DeviceOSType,ApproximateLastLogonTimeStamp

@Vasil Michev thanks for the script and I did try it but it doesn`t bring the results, please see attached screenshot. 

 

 

Try using an account that has sufficient permissions to enumerate users in the directory as well as call the Get-AzureADUserRegisteredDevice cmdlet.

@Simphiwe_Mkhize01  Hello! You've posted your question in the Community Discussion space, which is intended for discussion around the Tech Community website itself, not product questions. I'm moving your question to the Azure Active Directory space - please post Azure Active Directory questions here in the future. 

@Eric Starker thank you for your assistance.

@Vasil Michev will try that and give feedback.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
35 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
9 Replies