device
8 TopicsUpdate Entra ID Device Extension Attributes via PowerShell & Create Dynamic Security Groups.
2) Overview of Extension Attributes and Updating via PowerShell What Are Extension Attributes? Extension attributes (1–15) are predefined string fields available on Entra ID device objects. They are exposed to Microsoft Graph as the extensionAttributes property. These attributes can store custom values like department, environment tags (e.g., Prod, Dev), or ownership details. Why Use Them? Dynamic Group Membership: Use extension attributes in membership rules for security or Microsoft 365 groups. Policy Targeting: Apply Defender for Endpoint (MDE) policies, Conditional Access or Intune policies to devices based on custom tags. For details on configuration of the policies refer below documentation links. https://learn.microsoft.com/en-us/defender-endpoint/manage-security-policies https://learn.microsoft.com/en-us/intune/intune-service/ https://learn.microsoft.com/en-us/entra/identity/conditional-access/ Updating Extension Attributes via PowerShell and Graph API Use Microsoft Graph PowerShell to authenticate and update device properties. Required permission: “Device.ReadWrite.All”. 3) Using PowerShell to Update Extension Attributes create app registration in Entra ID with permissions Device.ReadWriteall and Grant admin Consent. Register an app How to register an app in Microsoft Entra ID - Microsoft identity platform | Microsoft Learn Graph API permissions Reference. For updating Entra ID device properties you need “Device.ReadWrite.all” permission and Intune administrator role to run the script. Microsoft Graph permissions reference - Microsoft Graph | Microsoft Learn Below is the script Important things to note and update the script with your custom values. a) update the path of the excel file in the script. column header is 'DeviceName' Note: You may want to use CSV instead of excel file if Excel is not available on the admin workstation running this process. b) update the credential details - tenantId,clientId & clientSecret in the script. Client id and client secret are created as a part of app registration. c) update the Externsionattribute and value in the script. This is the value of the extension attribute you want to use in dynamic membership rule creation. ___________________________________________________________________________ #Acquire token $tenantId = "xxxxxxxxxxxxxxxxxxxxx" $clientId = "xxxxxxxxxxxxxxxx" $clientSecret = "xxxxxxxxxxxxxxxxxxxx" $excelFilePath = "C:\Temp\devices.xlsx" # Update with actual path $tokenResponse = Invoke-RestMethod -Uri "https://login.microsoftonline.com/ $tenantId/oauth2/v2.0/token" -Method POST -Body $tokenBody $accessToken = $tokenResponse.access_token # Import Excel module and read device names Import-Module ImportExcel $deviceList = Import-Excel -Path $excelFilePath foreach ($device in $deviceList) { $deviceName = $device.DeviceName # Assumes column header is 'DeviceName' Get device ID by name $headers = @{ "Authorization" = "Bearer $accessToken"} $deviceLookupUri = "https://graph.microsoft.com/beta/devices?`$filter=displayName eq '$deviceName'" try { $deviceResponse = Invoke-RestMethod -Uri $deviceLookupUri -Headers $headers -Method GET } catch { Write-Host "Error querying device: $deviceName - $_" continue } if ($null -eq $deviceResponse.value -or $deviceResponse.value.Count -eq 0) { Write-Host "Device not found: $deviceName" continue } $deviceId = $deviceResponse.value[0].id # Prepare PATCH request $uri = "https://graph.microsoft.com/beta/devices/$deviceId" $headers["Content-Type"] = "application/json" $body = @{ extensionAttributes = @{ extensionAttribute6 = "MDE" } } | ConvertTo-Json -Depth 3 try { $response = Invoke-RestMethod -Uri $uri -Method Patch -Headers $headers -Body $body Write-Host "Updated device: $deviceName"} catch { Write-Host "Failed to update device: $deviceName - $_" } } Write-Host "Script execution completed." ________________________________________________________________________________________________________________________ Here’s a simple summary of what the script does: Gets an access token from Microsoft Entra ID using the app’s tenant ID, client ID, and client secret (OAuth 2.0 client credentials flow). Reads an Excel file (update the path in $excelFilePath, and ensure the column header is DeviceName) to get a list of device names. Loops through each device name from the Excel file: Calls Microsoft Graph API to find the device ID by its display name. If the device is found, sends a PATCH request to Microsoft Graph to update extensionAttribute6 with the value "MDE". Logs the result for each device (success or failure) and prints messages to the console. 4) Using Extension Attributes in Dynamic Device Groups Once extension attributes are set, you can create a dynamic security group in Entra ID: Go to Microsoft Entra admin center → Groups → New group. Select Security as the group type and choose Dynamic Device membership. Add a membership rule, for example: (device.extensionAttributes.extensionAttribute6 -eq "MDE") 4. Save the group. Devices with extensionAttribute6 = MDE will automatically join. 5) Summary Extension attributes in Entra ID allow custom tagging of devices for automation and policy targeting. You can update these attributes using Microsoft Graph PowerShell. These attributes can be used in dynamic device group rules, enabling granular MDE policies, Conditional Access and Intune deployments. Disclaimer This script is provided "as-is" without any warranties or guarantees. It is intended for educational and informational purposes only. Microsoft and the author assume no responsibility for any issues that may arise from the use or misuse of this script. Before deploying in a production environment, thoroughly test the script in a controlled setting and review it for compliance with your organization's security and operational policies.exclude non Wi-Fi enabled devices for Wi-Fi Configuration Profile
Hi everyone We have a WiFi Configuration Profile in Intune that applies to all company users. Problem is now that the profile tries to apply these WiFi Settings to devices which don't have WiFi capability and Intune throws errors back on these devices. My idea is now to create a group or a script, which checks the device for the presence of a WiFi MAC. When the device has a WiFi MAC, the profile gets applied. Has anyone an idea about how I can achieve this? Or what are your solutions for this scenario? Thanks for every reply 🙂Solved3.8KViews0likes7CommentsSelect Device Category during onboarding Process / Decission between Departments
hey there! is there a possibility to select the device category / department during the autopilot process? act. we have to go trough the autopilot process and after finishing this, we open the company portal and then we select the right category. it would be much easier to handle autopilot devices when all settings (already made within endpoint manager) are drawn before the process is completely finished. thanks a lot!814Views1like3CommentsWhat is an "Other Device"?
In my SharePoint usage report, it identifies different device types. Does anyone have any insight into what an "other device" actually is? (See final item in attached image.) How is this different than something on mobile or a tablet? For the most part we don't have access by "other" devices, but occasionally it does pop up.13KViews1like2Comments[Help] Microsoft Teams offers to transfer call from device that I'm not using
Hello everyone. I was using Microsoft Teams on my cellphone when suddenly the app closed and once I opened it again it gave the option to transfer the call to "this" device (my cellphone which I was currently using) or to stay in the other device. The thing is, I was not using any other device. I do have MT registered on my PC but it was closed. Has this happened to any of you? Why does this happen?957Views0likes1CommentLet us choose device/PC name during Windows installation
Currently after we install Windows, we have to go to settings and change PC name and then perform another restart. so if Windows would let user choose a custom PC/device name, instead of randomly generating one, it would be more convenient. Please upvote this feedback in feedback hub: https://aka.ms/AAbdo2w3.3KViews1like15CommentsAndroid device password not applying in Kiosk mode
Hi everyone, I'm not sure if I'm missing something here and please correct me if what I'm doing is not possible or by design. I'm setting up an Android tablet for single application use in Kiosk mode. I'm using a QR code to enrol the device and get it configured. Everything is working perfectly *except* no device password is being applied and I can specifically see the password policies failing to apply. I've configured the device password in the same policy that deploys the single use app. So... Device Configuration -> Profiles -> Platform = Android Enterprise, Profile Type = Device Restrictions (Device Owner). I've enforced to at least use a numeric pin, minimum lenght = 4, Keyguard = Not configured. My question ultimately is ..... is it possible to configure a device/screen lock password/pin on a kiosk device? My use case here is the device is for single app use, by a trusted person. The person will know the pin to unlock the device, but the device does not have any other purpose than running this one application, and the device should not be used for anything else other than running this one application. I can see all the settings I've configured applying successfully, except the device password ones. Any advise on if this is possible and if so, where I can start troubleshooting?Solved13KViews0likes13Comments