Skip to content

Instantly share code, notes, and snippets.

View ScottBeeson's full-sized avatar
🕳️

Scott Beeson ScottBeeson

🕳️
  • Springfield, Missouri
View GitHub Profile
@ScottBeeson
ScottBeeson / Intune.ListPolicyAssignments.ps1
Created March 25, 2024 13:16
Lists all Intune Policies and any assigned groups.
param(
[string]$GroupFilter,
[string]$PolicyFilter
)
$GraphSession = Get-MgContext
if (-not $GraphSession) {
Write-Host "Connecting to Services... " -NoNewline
Connect-MgGraph -Scopes "DeviceManagementConfiguration.Read.All", "Device.Read.All" -NoWelcome
Write-Host "DONE"
@ScottBeeson
ScottBeeson / Intune.AddDevicesToGroup.ps1
Last active May 2, 2024 17:17
Add Intune Managed devices to an Entra ID Security Group
param(
[string]$deviceNameFilter,
[string]$groupName = "PolicyGroup-AllWorkstations-Prod",
[switch]$confirm
)
if ($deviceNameFilter -ne "") {
$devices = Get-MgDevice -Filter "startswith(displayName, '$deviceNameFilter')" -All
} else {
$devices = Get-MgDevice -All
}
function say(a) {
function dashimate(s) {
return s.replace(/[^a-z0-9]/gi,'').split('').join('-');
}
return function(b) {
return dashimate(a) + " " + dashimate(b);
}
}