You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Administration/Alerts/Invoke-ListAlertsQueue.ps1
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ Function Invoke-ListAlertsQueue {
Copy file name to clipboardExpand all lines: Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Conditional/Invoke-ListConditionalAccessPolicies.ps1
-10Lines changed: 0 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -19,8 +19,6 @@ Function Invoke-ListConditionalAccessPolicies {
19
19
param (
20
20
[Parameter()]
21
21
$ID,
22
-
23
-
[Parameter(Mandatory=$true)]
24
22
$Locations
25
23
)
26
24
if ($id-eq'All') {
@@ -39,8 +37,6 @@ Function Invoke-ListConditionalAccessPolicies {
39
37
param (
40
38
[Parameter()]
41
39
$ID,
42
-
43
-
[Parameter(Mandatory=$true)]
44
40
$RoleDefinitions
45
41
)
46
42
if ($id-eq'All') {
@@ -59,8 +55,6 @@ Function Invoke-ListConditionalAccessPolicies {
59
55
param (
60
56
[Parameter()]
61
57
$ID,
62
-
63
-
[Parameter(Mandatory=$true)]
64
58
$Users
65
59
)
66
60
if ($id-eq'All') {
@@ -78,8 +72,6 @@ Function Invoke-ListConditionalAccessPolicies {
78
72
param (
79
73
[Parameter()]
80
74
$ID,
81
-
82
-
[Parameter(Mandatory=$true)]
83
75
$Groups
84
76
)
85
77
if ($id-eq'All') {
@@ -98,8 +90,6 @@ Function Invoke-ListConditionalAccessPolicies {
#$selfServiceItems = (Invoke-RestMethod -Method GET -Uri "https://licensing.m365.microsoft.com/v1.0/policies/AllowSelfServicePurchase/products" -Headers $header).items
33
+
} catch {
34
+
Write-LogMessage-API 'Standards'-tenant $tenant-message "Failed to retrieve self service products: $($_.Exception.Message)"-sev Error
35
+
throw"Failed to retrieve self service products: $($_.Exception.Message)"
36
+
}
28
37
38
+
if ($settings.remediate) {
39
+
if ($settings.exclusions-like"*;*") {
40
+
$exclusions=$settings.Exclusions-split(';')
41
+
} else {
42
+
$exclusions=$settings.Exclusions-split(',')
43
+
}
29
44
30
-
param($Tenant,$Settings)
45
+
$selfServiceItems|ForEach-Object {
46
+
$body=$null
47
+
48
+
if ($_.policyValue-eq"Enabled"-AND ($_.productId-in$exclusions)) {
49
+
# Self service is enabled on product and productId is in exclusions, skip
50
+
}
51
+
if ($_.policyValue-eq"Disabled"-AND ($_.productId-in$exclusions)) {
52
+
# Self service is disabled on product and productId is in exclusions, enable
53
+
$body='{ "policyValue": "Enabled" }'
54
+
}
55
+
if ($_.policyValue-eq"Enabled"-AND ($_.productId-notin$exclusions)) {
56
+
# Self service is enabled on product and productId is NOT in exclusions, disable
57
+
$body='{ "policyValue": "Disabled" }'
58
+
}
59
+
if ($_.policyValue-eq"Disabled"-AND ($_.productId-notin$exclusions)) {
60
+
# Self service is disabled on product and productId is NOT in exclusions, skip
61
+
}
62
+
63
+
try {
64
+
if ($body) {
65
+
$product=$_
66
+
New-GraphPOSTRequest-scope "aeb86249-8ea3-49e2-900b-54cc8e308f85/.default"-uri "https://licensing.m365.microsoft.com/v1.0/policies/AllowSelfServicePurchase/products/$($product.productId)"-tenantid $Tenant-body $body-type PUT
67
+
}
68
+
} catch {
69
+
Write-LogMessage-API 'Standards'-tenant $tenant-message "Failed to set product status for $($product.productId) with body $($body) for reason: $($_.Exception.Message)"-sev Error
70
+
#Write-Error "Failed to disable product $($product.productName):$($_.Exception.Message)"
71
+
}
72
+
}
73
+
74
+
if (!$exclusions) {
75
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message 'No exclusions set for self-service licenses, disabled all not excluded licenses for self-service.'-sev Info
76
+
} else {
77
+
Write-LogMessage-API 'Standards'-tenant $Tenant-message 'Exclusions present for self-service licenses, disabled all not excluded licenses for self-service.'-sev Info
78
+
}
79
+
}
31
80
32
-
Write-LogMessage-API 'Standards'-tenant $tenant-message 'Self Service Licenses cannot be disabled'-sev Error
0 commit comments