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
# At some point add logic to use AddOwner/AddMember for New-DistributionGroup, but idk how we're going to brr that - rvdwegen
73
69
}
74
-
"Successfully created group $($groupobj.displayname) for $($tenant)"
75
-
Write-LogMessage-headers $Request.Headers-API $APINAME-tenant $tenant-message "Created group $($groupobj.displayname) with id $($GraphRequest.id)"-Sev 'Info'
70
+
"Successfully created group $($GroupObject.displayName) for $($tenant)"
71
+
Write-LogMessage-headers $Request.Headers-API $APIName-tenant $tenant-message "Created group $($GroupObject.displayName) with id $($GraphRequest.id)"-Sev Info
76
72
77
73
} catch {
78
-
Write-LogMessage-headers $Request.Headers-API $APINAME-tenant $tenant-message "Group creation API failed. $($_.Exception.Message)"-Sev 'Error'
79
-
"Failed to create group. $($groupobj.displayname) for $($tenant)$($_.Exception.Message)"
@@ -56,7 +58,7 @@ function Set-CIPPAuthenticationPolicy {
56
58
'SMS' {
57
59
if ($State-eq'enabled') {
58
60
Write-LogMessage-headers $Headers-API $APIName-tenant $Tenant-message "Setting $AuthenticationMethodId to enabled is not allowed"-sev Error
59
-
return"Setting $AuthenticationMethodId to enabled is not allowed"
61
+
throw"Setting $AuthenticationMethodId to enabled is not allowed"
60
62
}
61
63
}
62
64
@@ -87,39 +89,47 @@ function Set-CIPPAuthenticationPolicy {
87
89
# Disallow enabling voice
88
90
if ($State-eq'enabled') {
89
91
Write-LogMessage-headers $Headers-API $APIName-tenant $Tenant-message "Setting $AuthenticationMethodId to enabled is not allowed"-sev Error
90
-
return"Setting $AuthenticationMethodId to enabled is not allowed"
92
+
throw"Setting $AuthenticationMethodId to enabled is not allowed"
91
93
}
92
94
}
93
95
94
96
# Email OTP
95
97
'Email' {
96
98
if ($State-eq'enabled') {
97
99
Write-LogMessage-headers $Headers-API $APIName-tenant $Tenant-message "Setting $AuthenticationMethodId to enabled is not allowed"-sev Error
98
-
return"Setting $AuthenticationMethodId to enabled is not allowed"
100
+
throw"Setting $AuthenticationMethodId to enabled is not allowed"
99
101
}
100
102
}
101
103
102
104
# Certificate-based authentication
103
105
'x509Certificate' {
104
106
# Nothing special to do here
105
107
}
108
+
109
+
# QR code
110
+
'QRCodePin' {
111
+
if ($State-eq'enabled') {
112
+
Write-LogMessage-headers $Headers-API $APIName-tenant $Tenant-message "Setting $AuthenticationMethodId to enabled is not allowed"-sev Error
113
+
throw"Setting $AuthenticationMethodId to enabled is not allowed"
114
+
}
115
+
}
106
116
Default {
107
117
Write-LogMessage-headers $Headers-API $APIName-tenant $Tenant-message "Somehow you hit the default case with an input of $AuthenticationMethodId . You probably made a typo in the input for AuthenticationMethodId. It`'s case sensitive."-sev Error
108
-
return"Somehow you hit the default case with an input of $AuthenticationMethodId . You probably made a typo in the input for AuthenticationMethodId. It`'s case sensitive."
118
+
throw"Somehow you hit the default case with an input of $AuthenticationMethodId . You probably made a typo in the input for AuthenticationMethodId. It`'s case sensitive."
109
119
}
110
120
}
111
121
# Set state of the authentication method
112
122
try {
113
123
if ($PSCmdlet.ShouldProcess($AuthenticationMethodId,"Set state to $State$OptionalLogMessage")) {
(Helptext) This blocks users from using QR Code Pin as an MFA method. If a user only has QR Code Pin as a MFA method, they will be unable to log in.
11
+
(DocsDescription) Disables QR Code Pin as an MFA method for the tenant. If a user only has QR Code Pin as a MFA method, they will be unable to sign in.
0 commit comments