-
Notifications
You must be signed in to change notification settings - Fork 0
/
Intune - Group Dependencies.ps1
121 lines (83 loc) · 4.53 KB
/
Intune - Group Dependencies.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
Connect-MSGraph
Update-MSGraphEnvironment -SchemaVersion beta
Connect-AzureAD
# Enter the Group Name
$groupName = Read-Host -Prompt 'Input your Group Name'
$Group = Get-AADGroup -Filter "displayname eq '$GroupName'"
Write-host
Write-host "AAD Group Name: $($Group.displayName)" -ForegroundColor Green
# Apps
$AllAssignedApps = Get-IntuneMobileApp -Select id, displayName, assignments -Expand assignments | Where-Object {$_.assignments -match $Group.id}
Write-host
Write-host "Number of Apps found: $($AllAssignedApps.DisplayName.Count)" -ForegroundColor cyan
Foreach ($Config in $AllAssignedApps) {
Write-host $Config.displayName -ForegroundColor Yellow
}
# Device Compliance
$AllDeviceCompliance = Get-IntuneDeviceCompliancePolicy -Select id, displayName, assignments -Expand assignments | Where-Object {$_.assignments -match $Group.id}
Write-host
Write-host "Number of Device Compliance policies found: $($AllDeviceCompliance.DisplayName.Count)" -ForegroundColor cyan
Foreach ($Config in $AllDeviceCompliance) {
Write-host $Config.displayName -ForegroundColor Yellow
}
# Device Configuration
$AllDeviceConfig = Get-IntuneDeviceConfigurationPolicy -Select id, displayName, assignments -Expand assignments | Where-Object {$_.assignments -match $Group.id}
Write-host
Write-host "Number of Device Configuration policies found: $($AllDeviceConfig.DisplayName.Count)" -ForegroundColor cyan
Foreach ($Config in $AllDeviceConfig) {
Write-host $Config.displayName -ForegroundColor Yellow
}
# Device Configurations Powershell Scripts
$Resource = "deviceManagement/deviceManagementScripts"
$graphApiVersion = "Beta"
$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)?`$expand=groupAssignments"
$PS = Invoke-MSGraphRequest -HttpMethod GET -Url $uri
$AllPowerShellScripts = $PS.value | Where-Object {$_.groupAssignments -match $Group.id}
Write-host
Write-host "Number of Device Configurations Powershell Scripts found: $($AllPowerShellScripts.DisplayName.Count)" -ForegroundColor cyan
Foreach ($Config in $AllPowerShellScripts) {
Write-host $Config.displayName -ForegroundColor Yellow
}
# Administrative Templates
$Resource = "deviceManagement/groupPolicyConfigurations"
$graphApiVersion = "Beta"
$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)?`$expand=Assignments"
$AT = Invoke-MSGraphRequest -HttpMethod GET -Url $uri
$AllAT = $AT.value | Where-Object {$_.assignments -match $Group.id}
Write-host
Write-host "Number of Device Administrative Templates found: $($AllAT.DisplayName.Count)" -ForegroundColor cyan
Foreach ($Config in $AllAT) {
Write-host $Config.displayName -ForegroundColor Yellow
}
# App Configuration
$AllAppConfig = Get-IntuneMobileAppConfigurationPolicy -Select id, displayName, assignments -Expand assignments | Where-Object {$_.assignments -match $Group.id}
Write-host
Write-host "Number of App Configuration policies found: $($AllAppConfig.DisplayName.Count)" -ForegroundColor cyan
Foreach ($Config in $AllAppConfig) {
Write-host $Config.displayName -ForegroundColor Yellow
}
# iOS App Protection
$AlliOSAppProtection = Get-IntuneAppProtectionPolicyIos -Select id, displayName, assignments -Expand assignments | Where-Object {$_.assignments -match $Group.id}
Write-host
Write-host "Number of iOS App Protection policies found: $($AlliOSAppProtection.DisplayName.Count)" -ForegroundColor cyan
Foreach ($Config in $AlliOSAppProtection) {
Write-host $Config.displayName -ForegroundColor Yellow
}
# Android App Protection
$AllAndroidAppProtection = Get-IntuneAppProtectionPolicyAndroid -Select id, displayName, assignments -Expand assignments | Where-Object {$_.assignments -match $Group.id}
Write-host
Write-host "Number of Android App Protection policies found: $($AllAndroidAppProtection.DisplayName.Count)" -ForegroundColor cyan
Foreach ($Config in $AllAndroidAppProtection) {
Write-host $Config.displayName -ForegroundColor Yellow
}
# Windows Information Protection
$Resource = "deviceAppManagement/mdmWindowsInformationProtectionPolicies"
$graphApiVersion = "Beta"
$uri = "https://graph.microsoft.com/$graphApiVersion/$($Resource)?`$expand=Assignments"
$WIP = Invoke-MSGraphRequest -HttpMethod GET -Url $uri
$AllWIP = $WIP.value | Where-Object {$_.assignments -match $Group.id}
Write-host
Write-host "Number of Windows Information Protection found: $($AllWIP.DisplayName.Count)" -ForegroundColor cyan
Foreach ($Config in $AllWIP) {
Write-host $Config.displayName -ForegroundColor Yellow
}