security group
5 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.Share Point Online - mail distribution list (security group) name changed
Hello, i have a really tricky problem in SharePoint Online. Since we introduced SPO, we activate the security group option for a mail distribution list. The permissions worked fine for the persons, who are members of this distribution list. Last week, we changed the name of the distribution list. Now we have the problem that the security group in SPO has still the same name, but the users has no access to site. If i delete the permissions for the group, wait and add the permissions again, its the same problem.... When i add the group on another sharePoint Online site, it works fine, the new name is displayed and the users has access. Thanks for your help! kind regards SilasSolved1.5KViews0likes2CommentsClients repo with three department folders- dept security on each folder. Best design?
I need to create a file repo for each of our clients in SPO. I will have between 500 and 1000 clients in SPO by the time our staff is done adding them all (over the next year). The goal with the client folder is to allow them to self-service certain documents we have for them from each of three departments (sales, legal, and accounting). Each of the departments needs access to every client, but only their department folder. I will create a security group for each department and add them to the appropriate client/dept folder. A couple of questions: Should I create a site for each client, or one "clients" site and a document library for each client? I was thinking that if I created a site for each client, I could just create three document libraries (one for each dept) in the client site, and apply my dept security group at the document library level. If I create one clients site and a document library for each client, I then have to create three subfolders in the site and apply dept. security at the folder level. It seems to me that document library level security is better (and more flexible) than folder level security. Thoughts? Lastly, I'm open to a totally different paradigm than what I am suggesting. Since I've never configured SPO in this type of scenario before, I may be missing some other way of doing it that has not occurred to me. Any help is appreciated!816Views0likes0CommentsAdditional document library shielded from guests?
Hi, we're soon moving from classic sites to M365 group connected and Teams site collections. In classic we had set up the logic that internal users had a document library with unique permissions that only they could see. Tenant external users / guests were excluded. This worked because we could invite guests into the "Site Visitors" group and have internal users live in "Site Owners" and "Site Members". We then gave the "internal" document library unique permissions in that we removed the "Site Visitors" security group. This made it so that external users / guests could not participate in that library. Now, moving on to the M365 group security model. Here, the SharePoint security group "Site Visitors" is not used. M365 group owners are put into the security group "Site Owners" and M365 group members go into "Site Members". This effectively mixes internal members and guests allowing them access edit permissions wherever "Site Members" is set. I can't come up with a mechanism that would allow me to have a secure document library with this model since a third security group is not used like "Site Visitors" used to be. Looking forward to your input, perhaps you have an easy solution for this. Thanks. The SharePoint security group "Members" nowSolved1.5KViews0likes3Comments