Skip to content
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

fix: Added Parameter ConditionalAccessPolicy to Resource SPOAccessControlSettings #4290

Merged
merged 16 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ function Get-TargetResource

[Parameter()]
[Switch]
$ManagedIdentity
$ManagedIdentity,

[Parameter()]
[ValidateSet('AllowFullAccess', 'AllowLimitedAccess', 'BlockAccess', 'ProtectionLevel')]
[System.String]
$ConditionalAccessPolicy
)

Write-Verbose -Message 'Getting configuration of SharePoint Online Access Control Settings'
Expand Down Expand Up @@ -137,6 +142,7 @@ function Get-TargetResource
CertificateThumbprint = $CertificateThumbprint
Managedidentity = $ManagedIdentity.IsPresent
Ensure = 'Present'
ConditionalAccessPolicy = $SPOAccessControlSettings.ConditionalAccessPolicy
}
}
catch
Expand Down Expand Up @@ -245,7 +251,12 @@ function Set-TargetResource

[Parameter()]
[Switch]
$ManagedIdentity
$ManagedIdentity,

[Parameter()]
[ValidateSet('AllowFullAccess', 'AllowLimitedAccess', 'BlockAccess', 'ProtectionLevel')]
[System.String]
$ConditionalAccessPolicy
)

Write-Verbose -Message 'Setting configuration of SharePoint Online Access Control Settings'
Expand Down Expand Up @@ -377,7 +388,12 @@ function Test-TargetResource

[Parameter()]
[Switch]
$ManagedIdentity
$ManagedIdentity,

[Parameter()]
[ValidateSet('AllowFullAccess', 'AllowLimitedAccess', 'BlockAccess', 'ProtectionLevel')]
[System.String]
$ConditionalAccessPolicy
)
#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies
Expand Down Expand Up @@ -413,7 +429,8 @@ function Test-TargetResource
'DisallowInfectedFileDownload', `
'ExternalServicesEnabled', `
'EmailAttestationRequired', `
'EmailAttestationReAuthDays')
'EmailAttestationReAuthDays',
'ConditionalAccessPolicy')
hosebei marked this conversation as resolved.
Show resolved Hide resolved

Write-Verbose -Message "Test-TargetResource returned $TestResult"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ class MSFT_SPOAccessControlSettings : OMI_BaseResource
[Write, Description("Path to certificate used in service principal usually a PFX file.")] String CertificatePath;
[Write, Description("Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication.")] String CertificateThumbprint;
[Write, Description("Managed ID being used for authentication.")] Boolean ManagedIdentity;
[Write, Description("Blocks or limits access to SharePoint and OneDrive content from un-managed devices.")] Boolean ConditionalAccessPolicy;
hosebei marked this conversation as resolved.
Show resolved Hide resolved
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
| **CertificatePath** | Write | String | Path to certificate used in service principal usually a PFX file. | |
| **CertificateThumbprint** | Write | String | Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication. | |
| **ManagedIdentity** | Write | Boolean | Managed ID being used for authentication. | |
| **ConditionalAccessPolicy** | Write | SPOConditionalAccessPolicyType | Blocks or limits access to SharePoint and OneDrive content from un-managed devices. | `AllowFullAccess`, `AllowLimitedAccess`, `BlockAccess`, `ProtectionLevel` |


# SPO Access Control Settings
Expand Down
Loading