Skip to content

Commit a8ef180

Browse files
committed
fix: fix check for TAP isUsableOnce
1 parent 90de902 commit a8ef180

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardTAP.ps1

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,14 @@ function Invoke-CIPPStandardTAP {
3131
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'TAP'
3232

3333
$CurrentState = New-GraphGetRequest -Uri 'https://graph.microsoft.com/beta/policies/authenticationmethodspolicy/authenticationMethodConfigurations/TemporaryAccessPass' -tenantid $Tenant
34+
if ($null -eq $Settings.config) { $Settings.config = $True }
3435
$StateIsCorrect = ($CurrentState.state -eq 'enabled') -and
35-
($CurrentState.isUsableOnce -eq $Settings.config)
36+
([System.Convert]::ToBoolean($CurrentState.isUsableOnce) -eq [System.Convert]::ToBoolean($Settings.config))
3637

3738
if ($Settings.report -eq $true) {
3839
Add-CIPPBPAField -FieldName 'TemporaryAccessPass' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $tenant
3940
}
4041

41-
# Input validation
42-
if (([string]::IsNullOrWhiteSpace($Settings.config) -or $Settings.config -eq 'Select a value') -and ($Settings.remediate -eq $true -or $Settings.alert -eq $true)) {
43-
Write-LogMessage -API 'Standards' -tenant $tenant -message 'TAP: Invalid state parameter set' -sev Error
44-
Return
45-
}
46-
4742
If ($Settings.remediate -eq $true) {
4843
if ($StateIsCorrect -eq $true) {
4944
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Temporary Access Passwords is already enabled.' -sev Info

0 commit comments

Comments
 (0)