According to Microsoft, the goal for Azure AD registered devices (workplace joined devices) is “to provide your users with support for bring your own device (BYOD) or mobile device scenarios. In these scenarios, a user can access your organization’s resources using a personal device.” Personally, I haven’t paid registered devices much attention over the years. Other topics occupied my time, and apart from going through the joining process to allow the organization to manage the device, ignored their existence.
Devices occupy their own area in the Azure AD admin center (Figure 1). The details displayed for each device are those gathered when the device registers with Azure AD. This accounts for some of the funky default device names generated by Windows. Azure AD doesn’t update devices records with details of O/S upgrades, so many of my devices appear to run Windows 10 when they’ve long since acquired Windows 11. The Azure AD admin center concentrates mainly on organizing device identities, which is what you’d expect from a directory.
Figure 1: Azure AD registered devices in the Azure AD admin center
Setting Extension Attributes for Azure AD Registered Devices
This led me to the Graph API for Devices and a note in that page about using extension attributes. Organizations commonly use Azure AD extension attributes to store extra information about user objects. They’re also available for device objects, and it’s convenient to be able to use the extension attributes to store information that help administrators know who uses a device. Fifteen extension attributes (ExtensionAttribute1 through ExtensionAttribute15) are available.
It seemed to make sense to use the extension attributes to make the entries for registered devices more useful. I decided to populate six of the extension attributes with information about the user who registered a device. It’s not always the case that the registered owner is still the person who uses a device, but there’s a high probability that it is, especially in BYOD scenarios.
To test the theory, I wrote a script using the Microsoft Graph PowerShell SDK to:
Find all registered devices with the Get-MgDevice cmdlet.
For each device, extract the identifier for the owner’s Azure AD account. This is stored in an odd manner in the device record (at least, Microsoft could make it much simpler to find and use the identifier).
Use the Get-MgUser cmdlet to check the identifier against Azure AD and retrieve user details if a match is successful. The lookup fails if the user is no longer in Azure AD or their account belongs to another tenant (Azure AD can register devices for guest users).
Run Update-MgDevice to populate the extension attributes when we have an account match.
Connect-MgGraph -Scopes "Directory.ReadWrite.All"
Select-MgProfile Beta
[array]$Devices = Get-MgDevice -All
ForEach ($Device in $Devices) {
If ($Device.PhysicalIds.count -gt 0) {
Foreach ($X in $Device.PhysicalIds) { If ($X.SubString(0,10) -eq "[USER-GID]") { $UserGuid = $X } }
$UserId = $UserGuid.substring(11,36)
If ($UserId) { #We found a user identifier - try to resolve it against Azure AD
[array]$User = Get-MgUser -UserId $UserId -ErrorAction SilentlyContinue }
If ($User) { # Found a user in Azure AD
Write-Host ("Device {0} owned by {1}" -f $Device.DisplayName, $User.DisplayName)
$Attributes = @{
"onPremisesExtensionAttributes" = @{
"extensionAttribute1" = $User.DisplayName
"extensionAttribute2" = $User.UserPrincipalName
"extensionAttribute3" = $User.MobilePhone
"extensionAttribute4" = $User.Department
"extensionAttribute5" = $User.City
"extensionAttribute6" = $User.Country }
} | ConvertTo-Json
Update-MgDevice -DeviceId $Device.Id -BodyParameter $Attributes
}
Else { Write-Host ("Device {0} owned by unknown user {1}" -f $Device.DisplayName, $UserId ) }
} # End If Device PhysicalsId
} #End Foreach
Using Extension Attributes for Azure AD Registered Devices
After populating the device attributes, their values are available through the Azure AD admin center (Figure 2).
Figure 2: Populated extension attributes for an Azure AD registered device
Even better, it’s easy to apply a filter against the extension attributes to find a subset of devices. In this example, I find all devices where the value of extensionAttribute6 is “Ireland.”
Even those running device management software like Intune might find value in being able to assign custom values to registered devices through PowerShell. The possibilities are endless. At least, that’s what I’ve heard.
Learn about exploiting Azure AD and PowerShell by subscribing to the Office 365 for IT Pros eBook. Use our experience to understand what’s important and how best to protect your tenant.
30 Replies to “Updating Extension Attributes for Azure AD Registered Devices with the Microsoft Graph PowerShell SDK”
Hi Tony, great article once again! I was wondering earlier on about these extension attributes for another use case. Would it be possible to extract some kind of uniquie id (max address?) from the azure ad registration? To explain: I ‘d like to flag specific devices for conditional access policies to apply. Is this even possible? Would appreciate if you could me into a direction.
are you sure that device filtering by extensionAttributes works for Azure AD Registered devices?
I am struggling with this right now and it seems NOT
Loading...
Yes. I’m certain. You can filter against extension attributes. These are complex queries so make sure that you pass the ConsistencyLevel parameter.
Loading...
according to this table, Microsoft support and my tests, it turns out that not necessarily.
CA policies for Azure AD Registered devices do not see the extensionAttributes parameter
Have you tested that it works?
Are you just talking theoretically?
Because from my practical tests, it doesn’t work for Azure AD Registered devices
Loading...
I am absolutely sure that it is possible to filter against extension attributes for registered devices. You can do this with the Get-MgDevice cmdlet.
Policy 2: All users with the directory role of Global Administrator, accessing the Microsoft Azure Management cloud app, excluding a filter for devices using rule expression device.extensionAttribute1 equals SAW and for Access controls, Block. Learn how to update extensionAttributes on an Azure AD device object.
The documentation then goes on to explain how to set the filter using ExtensionAttribute1.
Did you read that documentation and attempt to follow it? If you can’t make it work, then you can go to Microsoft Support and ask them why it doesn’t work. It is possible that a change has been made by the Azure AD subsequent to the publication of the online material.
Loading...
Hello
I currently have a ticket in Microsoft support.
Their engineer remotely waltzed with me for 3 hours and it doesn’t work for registered devices
Registered device not manager by Intune
Yes, if criteria are met. When extensionAttributes1-15 are used, the policy will apply if device is compliant or Hybrid Azure AD joined
You cannot have a non-inTune managed and compliant device registered. It is impossible.
Loading...
How would you delete an extensionAttribute if you no longer need it?
Thanks for the advice and link to your other article Tony! Passing space in ” ” fixed it. What a great hasslle. It’s I couldn’t find that anywhere and even Mark’s example up here has it as “” and not ” “!
You also said in your reply to Mark, OR pass Null! How do you do that? “extensionAttribute2” = $Null certainly didn’t work.
How about for Graph requests? I tried both “extensionAttribute2″ : ” ” and “extensionAttribute2” : Null in MSGrap-Explorer’s Request body and neither worked.
I appreciate your help.
@-
Loading...
Try $null instead of $Null. The Graph is sometimes very particular about casing.
Loading...
Nope, not only neither $Null nor $null worked, but also I think I spoke too soon, because even “extensionAttribute2” = ” ” doesn’t remove the property, it just erases its value with a single space character!
I need to delete/remove “extensionAttribute2” all together. I can swear “” worked before. Could it be bug introduced in recent updates? none of the methods seem to work. Back to the drawing board. Please let me know if you can think of anything I might be missing.
Hey Tony,
Great article and has me thinking about how best to use this. Is it possible to automatically assign an extension attribute to all AD computer enrolled into Intune with a particular extension attribute? Or to possible script this in bulk?
Thanks in advance.
I’m sure you can script this (at least, I think you can). I don’t know if automatic assignment is possible. I suspect not because these attributes are intended for use by customers for their own purposes. You have total control over the attributes, but you need to maintain them.
>>> means that PowerShell is waiting for you to complete a command. Did you paste all the code into the command window? Do you know what line it’s failing on?
Hi Tony, great looking script which I could make lots of use from it. I’ve had a play around with it. Unfortunately I cannot get it to work and the reason for that is all my phyicalids are null. I’ve had a look about the internet and not sure how this field is populated have you any idea how they are?
Any other question is could a similar script do the same using something like OperatingSystem ?
I’m not sure about why the physical device ids aren’t showing up – maybe it’s something as simple as connecting to the V1.0 endpoint instead of the beta.
Try running Select-MgProfile beta and then Get-MgDevice.
I haven’t looked into getting details of operating systems (yet).
Hey Tony, Managed to get what I wanted with the guidance of your script above. Thanks for your help and thank you for the other post, again something very helpful.
My script ended up like below
Connect-MgGraph
Select-MgProfile “Beta”
Connect-AzAccount
[array]$AllUsers = Get-AzADUser
ForEach ($User in $AllUsers){
# All devices assigned to each owner
[array]$UserDevices = get-mguserowneddevice -UserId $User.Id
ForEach ($UserDevice in $UserDevices){
$Device = Get-MgDevice -DeviceId $UserDevice.Id
if(($device.OperatingSystem -like ‘iOS’) -or ($device.OperatingSystem -like ‘iphone’)){
$User.OfficeLocation
$uri = $null
$uri = https://graph.microsoft.com/beta/devices/ + $device.id
$uri
{"id":null,"mode":"button","open_style":"in_modal","currency_code":"EUR","currency_symbol":"\u20ac","currency_type":"decimal","blank_flag_url":"https:\/\/office365itpros.com\/wp-content\/plugins\/tip-jar-wp\/\/assets\/images\/flags\/blank.gif","flag_sprite_url":"https:\/\/office365itpros.com\/wp-content\/plugins\/tip-jar-wp\/\/assets\/images\/flags\/flags.png","default_amount":100,"top_media_type":"featured_image","featured_image_url":"https:\/\/office365itpros.com\/wp-content\/uploads\/2022\/11\/cover-141x200.jpg","featured_embed":"","header_media":null,"file_download_attachment_data":null,"recurring_options_enabled":true,"recurring_options":{"never":{"selected":true,"after_output":"One time only"},"weekly":{"selected":false,"after_output":"Every week"},"monthly":{"selected":false,"after_output":"Every month"},"yearly":{"selected":false,"after_output":"Every year"}},"strings":{"current_user_email":"","current_user_name":"","link_text":"Virtual Tip Jar","complete_payment_button_error_text":"Check info and try again","payment_verb":"Pay","payment_request_label":"Office 365 for IT Pros","form_has_an_error":"Please check and fix the errors above","general_server_error":"Something isn't working right at the moment. Please try again.","form_title":"Office 365 for IT Pros","form_subtitle":null,"currency_search_text":"Country or Currency here","other_payment_option":"Other payment option","manage_payments_button_text":"Manage your payments","thank_you_message":"Thank you for supporting the work of Office 365 for IT Pros!","payment_confirmation_title":"Office 365 for IT Pros","receipt_title":"Your Receipt","print_receipt":"Print Receipt","email_receipt":"Email Receipt","email_receipt_sending":"Sending receipt...","email_receipt_success":"Email receipt successfully sent","email_receipt_failed":"Email receipt failed to send. Please try again.","receipt_payee":"Paid to","receipt_statement_descriptor":"This will show up on your statement as","receipt_date":"Date","receipt_transaction_id":"Transaction ID","receipt_transaction_amount":"Amount","refund_payer":"Refund from","login":"Log in to manage your payments","manage_payments":"Manage Payments","transactions_title":"Your Transactions","transaction_title":"Transaction Receipt","transaction_period":"Plan Period","arrangements_title":"Your Plans","arrangement_title":"Manage Plan","arrangement_details":"Plan Details","arrangement_id_title":"Plan ID","arrangement_payment_method_title":"Payment Method","arrangement_amount_title":"Plan Amount","arrangement_renewal_title":"Next renewal date","arrangement_action_cancel":"Cancel Plan","arrangement_action_cant_cancel":"Cancelling is currently not available.","arrangement_action_cancel_double":"Are you sure you'd like to cancel?","arrangement_cancelling":"Cancelling Plan...","arrangement_cancelled":"Plan Cancelled","arrangement_failed_to_cancel":"Failed to cancel plan","back_to_plans":"\u2190 Back to Plans","update_payment_method_verb":"Update","sca_auth_description":"Your have a pending renewal payment which requires authorization.","sca_auth_verb":"Authorize renewal payment","sca_authing_verb":"Authorizing payment","sca_authed_verb":"Payment successfully authorized!","sca_auth_failed":"Unable to authorize! Please try again.","login_button_text":"Log in","login_form_has_an_error":"Please check and fix the errors above","uppercase_search":"Search","lowercase_search":"search","uppercase_page":"Page","lowercase_page":"page","uppercase_items":"Items","lowercase_items":"items","uppercase_per":"Per","lowercase_per":"per","uppercase_of":"Of","lowercase_of":"of","back":"Back to plans","zip_code_placeholder":"Zip\/Postal Code","download_file_button_text":"Download File","input_field_instructions":{"tip_amount":{"placeholder_text":"How much would you like to tip?","initial":{"instruction_type":"normal","instruction_message":"How much would you like to tip? Choose any currency."},"empty":{"instruction_type":"error","instruction_message":"How much would you like to tip? Choose any currency."},"invalid_curency":{"instruction_type":"error","instruction_message":"Please choose a valid currency."}},"recurring":{"placeholder_text":"Recurring","initial":{"instruction_type":"normal","instruction_message":"How often would you like to give this?"},"success":{"instruction_type":"success","instruction_message":"How often would you like to give this?"},"empty":{"instruction_type":"error","instruction_message":"How often would you like to give this?"}},"name":{"placeholder_text":"Name on Credit Card","initial":{"instruction_type":"normal","instruction_message":"Enter the name on your card."},"success":{"instruction_type":"success","instruction_message":"Enter the name on your card."},"empty":{"instruction_type":"error","instruction_message":"Please enter the name on your card."}},"privacy_policy":{"terms_title":"Terms and conditions","terms_body":null,"terms_show_text":"View Terms","terms_hide_text":"Hide Terms","initial":{"instruction_type":"normal","instruction_message":"I agree to the terms."},"unchecked":{"instruction_type":"error","instruction_message":"Please agree to the terms."},"checked":{"instruction_type":"success","instruction_message":"I agree to the terms."}},"email":{"placeholder_text":"Your email address","initial":{"instruction_type":"normal","instruction_message":"Enter your email address"},"success":{"instruction_type":"success","instruction_message":"Enter your email address"},"blank":{"instruction_type":"error","instruction_message":"Enter your email address"},"not_an_email_address":{"instruction_type":"error","instruction_message":"Make sure you have entered a valid email address"}},"note_with_tip":{"placeholder_text":"Your note here...","initial":{"instruction_type":"normal","instruction_message":"Attach a note to your tip (optional)"},"empty":{"instruction_type":"normal","instruction_message":"Attach a note to your tip (optional)"},"not_empty_initial":{"instruction_type":"normal","instruction_message":"Attach a note to your tip (optional)"},"saving":{"instruction_type":"normal","instruction_message":"Saving note..."},"success":{"instruction_type":"success","instruction_message":"Note successfully saved!"},"error":{"instruction_type":"error","instruction_message":"Unable to save note note at this time. Please try again."}},"email_for_login_code":{"placeholder_text":"Your email address","initial":{"instruction_type":"normal","instruction_message":"Enter your email to log in."},"success":{"instruction_type":"success","instruction_message":"Enter your email to log in."},"blank":{"instruction_type":"error","instruction_message":"Enter your email to log in."},"empty":{"instruction_type":"error","instruction_message":"Enter your email to log in."}},"login_code":{"initial":{"instruction_type":"normal","instruction_message":"Check your email and enter the login code."},"success":{"instruction_type":"success","instruction_message":"Check your email and enter the login code."},"blank":{"instruction_type":"error","instruction_message":"Check your email and enter the login code."},"empty":{"instruction_type":"error","instruction_message":"Check your email and enter the login code."}},"stripe_all_in_one":{"initial":{"instruction_type":"normal","instruction_message":"Enter your credit card details here."},"empty":{"instruction_type":"error","instruction_message":"Enter your credit card details here."},"success":{"instruction_type":"normal","instruction_message":"Enter your credit card details here."},"invalid_number":{"instruction_type":"error","instruction_message":"The card number is not a valid credit card number."},"invalid_expiry_month":{"instruction_type":"error","instruction_message":"The card's expiration month is invalid."},"invalid_expiry_year":{"instruction_type":"error","instruction_message":"The card's expiration year is invalid."},"invalid_cvc":{"instruction_type":"error","instruction_message":"The card's security code is invalid."},"incorrect_number":{"instruction_type":"error","instruction_message":"The card number is incorrect."},"incomplete_number":{"instruction_type":"error","instruction_message":"The card number is incomplete."},"incomplete_cvc":{"instruction_type":"error","instruction_message":"The card's security code is incomplete."},"incomplete_expiry":{"instruction_type":"error","instruction_message":"The card's expiration date is incomplete."},"incomplete_zip":{"instruction_type":"error","instruction_message":"The card's zip code is incomplete."},"expired_card":{"instruction_type":"error","instruction_message":"The card has expired."},"incorrect_cvc":{"instruction_type":"error","instruction_message":"The card's security code is incorrect."},"incorrect_zip":{"instruction_type":"error","instruction_message":"The card's zip code failed validation."},"invalid_expiry_year_past":{"instruction_type":"error","instruction_message":"The card's expiration year is in the past"},"card_declined":{"instruction_type":"error","instruction_message":"The card was declined."},"missing":{"instruction_type":"error","instruction_message":"There is no card on a customer that is being charged."},"processing_error":{"instruction_type":"error","instruction_message":"An error occurred while processing the card."},"invalid_request_error":{"instruction_type":"error","instruction_message":"Unable to process this payment, please try again or use alternative method."},"invalid_sofort_country":{"instruction_type":"error","instruction_message":"The billing country is not accepted by SOFORT. Please try another country."}}}},"fetched_oembed_html":false}
Hi Tony, great article once again! I was wondering earlier on about these extension attributes for another use case. Would it be possible to extract some kind of uniquie id (max address?) from the azure ad registration? To explain: I ‘d like to flag specific devices for conditional access policies to apply. Is this even possible? Would appreciate if you could me into a direction.
You can certainly stuff whatever you want into the extension properties and use them in CA policies. This seems like a good guide: https://www.petervanderwoude.nl/post/using-filters-for-devices-as-condition-in-conditional-access-policies/
are you sure that device filtering by extensionAttributes works for Azure AD Registered devices?
I am struggling with this right now and it seems NOT
Yes. I’m certain. You can filter against extension attributes. These are complex queries so make sure that you pass the ConsistencyLevel parameter.
according to this table, Microsoft support and my tests, it turns out that not necessarily.
CA policies for Azure AD Registered devices do not see the extensionAttributes parameter
Have you tested that it works?
Are you just talking theoretically?
Because from my practical tests, it doesn’t work for Azure AD Registered devices
I am absolutely sure that it is possible to filter against extension attributes for registered devices. You can do this with the Get-MgDevice cmdlet.
As to CA policies, my authority on this point came from https://www.petervanderwoude.nl/post/using-filters-for-devices-as-condition-in-conditional-access-policies/. This points to the Microsoft documentation https://learn.microsoft.com/en-us/azure/active-directory/conditional-access/concept-condition-filters-for-devices which includes:
Policy 2: All users with the directory role of Global Administrator, accessing the Microsoft Azure Management cloud app, excluding a filter for devices using rule expression device.extensionAttribute1 equals SAW and for Access controls, Block. Learn how to update extensionAttributes on an Azure AD device object.
The documentation then goes on to explain how to set the filter using ExtensionAttribute1.
Did you read that documentation and attempt to follow it? If you can’t make it work, then you can go to Microsoft Support and ask them why it doesn’t work. It is possible that a change has been made by the Azure AD subsequent to the publication of the online material.
Hello
I currently have a ticket in Microsoft support.
Their engineer remotely waltzed with me for 3 hours and it doesn’t work for registered devices
apparently this tablet says so, but it is very vague and confusing.
https://learn.microsoft.com/en-us/azure/active-directory/conditional-access/concept-condition-filters-for-devices#policy-behavior-with-filter-for-devices
Registered device not manager by Intune
Yes, if criteria are met. When extensionAttributes1-15 are used, the policy will apply if device is compliant or Hybrid Azure AD joined
You cannot have a non-inTune managed and compliant device registered. It is impossible.
How would you delete an extensionAttribute if you no longer need it?
Nevermind
> $params = @{
> “extensionAttributes” = @{
> “extensionAttribute2” = “”
> }
> }
> update-MgDevice -DeviceId GUID -BodyParameter ($params | ConvertTo-Json)
Yep, or pass Null
This doesn’t seem to work any more! I can modify the values but passing empty quotes or Null wouldn’t change or remove them. What am I missing?!
Connect-MgGraph -Scopes “Directory.AccessAsUser.All”
Select-MgProfile Beta
Import-Module Microsoft.Graph.Identity.DirectoryManagement
$DeviceID=”7b280351-2f6f-4028-ae6e-d7f598666767″
$params = @{
“extensionAttributes” = @{
“extensionAttribute2” = “”
}
}
update-MgDevice -DeviceId $DeviceID -BodyParameter ($params | ConvertTo-Json)
(Get-MgDevice -DeviceId $DeviceID).ExtensionAttributes.ExtensionAttribute2
Test
It does work. You need to pass a space in the extensionattribute2. i.e., ” ” and not “”
See https://office365itpros.com/2023/02/13/microsoft-graph-powershell-sdk-prob/
Thanks for the advice and link to your other article Tony! Passing space in ” ” fixed it. What a great hasslle. It’s I couldn’t find that anywhere and even Mark’s example up here has it as “” and not ” “!
You also said in your reply to Mark, OR pass Null! How do you do that? “extensionAttribute2” = $Null certainly didn’t work.
How about for Graph requests? I tried both “extensionAttribute2″ : ” ” and “extensionAttribute2” : Null in MSGrap-Explorer’s Request body and neither worked.
I appreciate your help.
@-
Try $null instead of $Null. The Graph is sometimes very particular about casing.
Nope, not only neither $Null nor $null worked, but also I think I spoke too soon, because even “extensionAttribute2” = ” ” doesn’t remove the property, it just erases its value with a single space character!
I need to delete/remove “extensionAttribute2” all together. I can swear “” worked before. Could it be bug introduced in recent updates? none of the methods seem to work. Back to the drawing board. Please let me know if you can think of anything I might be missing.
Thank you so much.
@-
Check this out!:(
https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/1823
Tony, would you happen to know if any of these attributes can be synced back onprem as part of the AADConnect Device Write back?
I don’t know, but it should be easy to test.
Hey Tony,
Great article and has me thinking about how best to use this. Is it possible to automatically assign an extension attribute to all AD computer enrolled into Intune with a particular extension attribute? Or to possible script this in bulk?
Thanks in advance.
I’m sure you can script this (at least, I think you can). I don’t know if automatic assignment is possible. I suspect not because these attributes are intended for use by customers for their own purposes. You have total control over the attributes, but you need to maintain them.
Tried it but it wont run. Just hangs at the end with >> at the prompt.
>>> means that PowerShell is waiting for you to complete a command. Did you paste all the code into the command window? Do you know what line it’s failing on?
Hi Tony, great looking script which I could make lots of use from it. I’ve had a play around with it. Unfortunately I cannot get it to work and the reason for that is all my phyicalids are null. I’ve had a look about the internet and not sure how this field is populated have you any idea how they are?
Any other question is could a similar script do the same using something like OperatingSystem ?
I’m not sure about why the physical device ids aren’t showing up – maybe it’s something as simple as connecting to the V1.0 endpoint instead of the beta.
Try running Select-MgProfile beta and then Get-MgDevice.
I haven’t looked into getting details of operating systems (yet).
I’ll be sure to keep an eye out for it
Thanks
Conal
Hey Tony, Managed to get what I wanted with the guidance of your script above. Thanks for your help and thank you for the other post, again something very helpful.
My script ended up like below
Connect-MgGraph
Select-MgProfile “Beta”
Connect-AzAccount
[array]$AllUsers = Get-AzADUser
ForEach ($User in $AllUsers){
# All devices assigned to each owner
[array]$UserDevices = get-mguserowneddevice -UserId $User.Id
ForEach ($UserDevice in $UserDevices){
$Device = Get-MgDevice -DeviceId $UserDevice.Id
if(($device.OperatingSystem -like ‘iOS’) -or ($device.OperatingSystem -like ‘iphone’)){
$User.OfficeLocation
$uri = $null
$uri = https://graph.microsoft.com/beta/devices/ + $device.id
$uri
$json = @{
“extensionAttributes” = @{
“extensionAttribute1” = $User.UserPrincipalName
“extensionAttribute2” = $User.MobilePhone
“extensionAttribute3” = $User.OfficeLocation
}
} | ConvertTo-Json
Invoke-MgGraphRequest -Uri $uri -Body $json -Method PATCH -ContentType “application/json”
}
}
}
Great. Well done.
Hi Everyone,
i am now trying for days to get the script to work, but i am stuck at executing the script and getting this error
update-MgDevice : Insufficient privileges to complete the operation.
FullyQualifiedErrorId : Authorization_RequestDenied,Microsoft.Graph.PowerShell.Cmdlets.UpdateMgDevice_Update1
Can anyone let me know which Azure-AD Role i need to write Extension Attributes ? Currently i have the Cloud Device Administrator Role activated.
Thanks a lot for any help.
Chris
Have you signed into the Graph with the Device.ReadWrite.All or Directory.ReadWrite.All permission? When in doubt, consult the documentation for the underlying Graph API. I searched for Update Device Graph and found https://learn.microsoft.com/en-us/graph/api/device-update?view=graph-rest-1.0&tabs=http, which explains the required permissions. I describe other methods in https://practical365.com/microsoft-graph-api-permission/