-
Notifications
You must be signed in to change notification settings - Fork 232
Update logic for AS04 check in EIDSCA and format of cmdlet header #1584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7436d0d
ae43f0d
f017d1b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,20 +1,20 @@ | ||||||
| function %PSFunctionName% { | ||||||
|
||||||
| function %PSFunctionName% { | |
| function %PSFunctionName% { |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,7 @@ Avoid to use SMS as primary sign in factor (instead of a password) and consider | |||||
| #### Test script | ||||||
| ``` | ||||||
| https://graph.microsoft.com/beta/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Sms') | ||||||
| .includeTargets.isUsableForSignIn -eq 'false' | ||||||
| .includeTargets.isUsableForSignIn | select-object -unique -eq 'false' | ||||||
|
||||||
| .includeTargets.isUsableForSignIn | select-object -unique -eq 'false' | |
| (.includeTargets.isUsableForSignIn | Select-Object -Unique) -eq 'false' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this a find/replace all issue?
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||||||||
| function Test-MtEidscaAS04 { | ||||||||||||||||
| function Test-MtEidscaAS04 { | ||||||||||||||||
| <# | ||||||||||||||||
| .SYNOPSIS | ||||||||||||||||
| Checks if Authentication Method - SMS - Use for sign-in is set to 'false' | ||||||||||||||||
|
|
@@ -9,12 +9,12 @@ | |||||||||||||||
|
|
||||||||||||||||
| Queries policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Sms') | ||||||||||||||||
| and returns the result of | ||||||||||||||||
| graph/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Sms').includeTargets.isUsableForSignIn -eq 'false' | ||||||||||||||||
| graph/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Sms').includeTargets.isUsableForSignIn | select-object -unique -eq 'false' | ||||||||||||||||
|
|
||||||||||||||||
|
Comment on lines
10
to
13
|
||||||||||||||||
| .EXAMPLE | ||||||||||||||||
| Test-MtEidscaAS04 | ||||||||||||||||
|
|
||||||||||||||||
| Returns the result of graph.microsoft.com/beta/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Sms').includeTargets.isUsableForSignIn -eq 'false' | ||||||||||||||||
| Returns the result of graph.microsoft.com/beta/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Sms').includeTargets.isUsableForSignIn | select-object -unique -eq 'false' | ||||||||||||||||
| #> | ||||||||||||||||
| [CmdletBinding()] | ||||||||||||||||
| [OutputType([bool])] | ||||||||||||||||
|
|
@@ -26,7 +26,7 @@ | |||||||||||||||
| } | ||||||||||||||||
| $result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('Sms')" -ApiVersion beta | ||||||||||||||||
|
|
||||||||||||||||
| [string]$tenantValue = $result.includeTargets.isUsableForSignIn | ||||||||||||||||
| [string]$tenantValue = $result.includeTargets.isUsableForSignIn | select-object -unique | ||||||||||||||||
| $testResult = $tenantValue -eq 'false' | ||||||||||||||||
| $tenantValueNotSet = ($null -eq $tenantValue -or $tenantValue -eq "") -and 'false' -notlike '*$null*' | ||||||||||||||||
|
Comment on lines
+29
to
31
|
||||||||||||||||
| [string]$tenantValue = $result.includeTargets.isUsableForSignIn | select-object -unique | |
| $testResult = $tenantValue -eq 'false' | |
| $tenantValueNotSet = ($null -eq $tenantValue -or $tenantValue -eq "") -and 'false' -notlike '*$null*' | |
| $tenantValues = @($result.includeTargets.isUsableForSignIn | Select-Object -Unique) | |
| [string]$tenantValue = ($tenantValues | ForEach-Object { [string]$_ }) -join ', ' | |
| $testResult = $tenantValues.Count -gt 0 -and (@($tenantValues | Where-Object { $_ -ne $false })).Count -eq 0 | |
| $tenantValueNotSet = $tenantValues.Count -eq 0 -and 'false' -notlike '*$null*' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this a find/replace all issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetPortalDeepLinkMarkdownuses$domain = ($uri -as [System.URI]).Host, but$uriis not defined in this function. This will always set$domainto$null(or throw under strict mode) and generates incorrect markdown (e.g., "View in "). Use$portalDeepLinkfor URI parsing (or assign$uri = $portalDeepLinkfirst).