diff --git a/.github/workflows/Global - Integration - EXO.yml b/.github/workflows/Global - Integration - EXO.yml new file mode 100644 index 0000000000..4957ccddcd --- /dev/null +++ b/.github/workflows/Global - Integration - EXO.yml @@ -0,0 +1,205 @@ +name: Global - Integration - EXO +on: [push] + +jobs: + Integration-Global-EXO: + # The type of runner that the job will run on + runs-on: windows-latest + + # Only when run from the main repo + if: github.repository == 'microsoft/Microsoft365DSC' + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + - name: Install Microsoft365DSC + shell: powershell + run: | + winrm quickconfig -force + $source = "./Modules/Microsoft365DSC/" + $destination = "C:\Program Files\WindowsPowerShell\Modules" + Copy-Item -Path $source -Recurse -Destination $destination -Container -Force + Update-M365DSCDependencies + - name: Configure Environment + shell: powershell + run: | + Set-ExecutionPolicy Unrestricted -Force + Get-ChildItem "C:\Program Files\WindowsPowerShell\Modules" -Recurse | Unblock-File + Set-M365DSCTelemetryOption -Enabled $false + Set-Item -Path WSMan:\localhost\MaxEnvelopeSizekb -Value 99999 + - name: Generate {Create} Integration Tests from Examples + shell: powershell + run: | + Import-Module './Tests/Integration/M365DSCTestEngine.psm1' + New-M365DSCIntegrationTest -Workload EXO -Step '1-Create' + - name: Commit {Create} Integration Tests + shell: powershell + run: | + git config --local user.email "nicharl@microsoft.com" + git config --local user.name "NikCharlebois" + git add D:/a/Microsoft365DSC/Microsoft365DSC/Tests/Integration/* + git pull + git commit -m "Updated {Create} EXO Integration Tests" + git push + $SHA = git rev-parse HEAD + echo "commitid=$SHA" >> $env:GITHUB_OUTPUT + - name: Run {Create} Integration Tests + shell: powershell + env: + INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }} + INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }} + run: | + $CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force + $Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword) + try + { + & .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.EXO.Create.Tests.ps1 -Credential $Credential + } + catch + { + throw $_ + } + + try + { + $Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop + } + catch + { + throw $_ + } + + Write-Host "" + + if ($Result.InDesiredState -eq $false) + { + Write-Host -Message "Resources below are not in the Desired State:" + foreach ($Resource in $Result.ResourcesNotInDesiredState) + { + Write-Host $Resource.InstanceName + } + + throw "Could not validate that the Tenant is in the Desired State" + } + else + { + Write-Host "All resources in the Tenant are in the Desired State" + } + - name: Generate {Update} Integration Tests from Examples + shell: powershell + run: | + Import-Module './Tests/Integration/M365DSCTestEngine.psm1' + New-M365DSCIntegrationTest -Workload EXO -Step '2-Update' + - name: Commit {Update} Integration Tests + shell: powershell + run: | + git config --local user.email "nicharl@microsoft.com" + git config --local user.name "NikCharlebois" + git add D:/a/Microsoft365DSC/Microsoft365DSC/Tests/Integration/* + git pull + git commit -m "Updated {Update} EXO Integration Tests" + git push + $SHA = git rev-parse HEAD + echo "commitid=$SHA" >> $env:GITHUB_OUTPUT + - name: Run {Update} Integration Tests + shell: powershell + env: + INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }} + INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }} + run: | + $CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force + $Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword) + try + { + & .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.EXO.Update.Tests.ps1 -Credential $Credential + } + catch + { + throw $_ + } + + try + { + $Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop + } + catch + { + throw $_ + } + + Write-Host "" + + if ($Result.InDesiredState -eq $false) + { + Write-Host -Message "Resources below are not in the Desired State:" + foreach ($Resource in $Result.ResourcesNotInDesiredState) + { + Write-Host $Resource.InstanceName + } + + throw "Could not validate that the Tenant is in the Desired State" + } + else + { + Write-Host "All resources in the Tenant are in the Desired State" + } + - name: Generate {Remove} Integration Tests from Examples + shell: powershell + run: | + Import-Module './Tests/Integration/M365DSCTestEngine.psm1' + New-M365DSCIntegrationTest -Workload EXO -Step '3-Remove' + - name: Commit {Remove} Integration Tests + shell: powershell + run: | + git config --local user.email "nicharl@microsoft.com" + git config --local user.name "NikCharlebois" + git add D:/a/Microsoft365DSC/Microsoft365DSC/Tests/Integration/* + git pull + git commit -m "Updated {Update} EXO Integration Tests" + git push + $SHA = git rev-parse HEAD + echo "commitid=$SHA" >> $env:GITHUB_OUTPUT + - name: Run {Remove} Integration Tests + shell: powershell + env: + INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }} + INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }} + run: | + $CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force + $Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword) + try + { + & .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.EXO.Remove.Tests.ps1 -Credential $Credential + } + catch + { + throw $_ + } + + try + { + $Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop + } + catch + { + throw $_ + } + + Write-Host "" + + if ($Result.InDesiredState -eq $false) + { + Write-Host -Message "Resources below are not in the Desired State:" + foreach ($Resource in $Result.ResourcesNotInDesiredState) + { + Write-Host $Resource.InstanceName + } + + throw "Could not validate that the Tenant is in the Desired State" + } + else + { + Write-Host "All resources in the Tenant are in the Desired State" + } + diff --git a/CHANGELOG.md b/CHANGELOG.md index 97233cfeee..531a56fd91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,92 @@ # Change log for Microsoft365DSC +# 1.24.124.1 + +* AADAuthenticationMethodPolicyAuthenticator + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicyEmail + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicyFido2 + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicySms + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicySoftware + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicyTemporary + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicyVoice + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicyX509 + * Remove the logic path to create a new instance in favor of the update flow. +* AADConditionalAccessPolicy + * Fix issue when not all parameters are specified + FIXES [[#4202](https://github.com/microsoft/Microsoft365DSC/issues/4202)] +* AADCrossTenantAccessPolicy + * Removed the ability to specify a value of Absent for the Ensure property. +* AADCrossTenantAccessPolicyCOnfigurationDefault + * Removed the ability to specify a value of Absent for the Ensure property. +* AADGroup + * Changed Set logic to restore groups from the deleted list if a match by + DisplayName is found. +* EXOActiveSyncDeviceAccessRule + * Changed the way Identity is determined by using a combination of the + QueryString and Characteristic parameters. +* EXOAddressList + * Fixed an issue trying to create a new instance when DisplayName is empty. +* EXOApplicationAccessPolicy + * Changed the logic to retrieve existing instances based on Scope. +* EXODataClassification + * DEPRECATED Resource. +* SCAutoSensitivityLabelRule + * Correct export indentation, which caused an issue with report conversion to JSON. + FIXES [[#4240](https://github.com/microsoft/Microsoft365DSC/issues/4240)] +* SPOSharingSettings + * Fixed an Issue where the MySiteSharingCapability could be returned as an + empty string instead of a null value from the Get method. +* TeamsAppPermissionPolicy, TeamsAppSetupPolicy, TeamsCallHoldPolicy, + TeamsIPPhonePolicy, TeamsMobilityPolicy, TeamsNetworkRoamingPolicy, + TeamsShiftsPolicy, TeamsTenantNetworkRegion, TeamsTenantNetworkSite, + TeamsTenantNetworkSubnet, TeamsTenantTrustedIPAddress, TeamsTranslationRule, + TeamsUnassignedNumberTreatment, TeamsVdiPolicy, TeamsWorkloadPolicy + * Fix condition when resource is absent + FIXES [#4227](https://github.com/microsoft/Microsoft365DSC/issues/4227) +* TeamsAudioConferencingPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4215](https://github.com/microsoft/Microsoft365DSC/issues/4215) +* TeamsCallParkPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4210](https://github.com/microsoft/Microsoft365DSC/issues/4210) +* TeamsComplianceRecordingPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4212](https://github.com/microsoft/Microsoft365DSC/issues/4212) +* TeamsCortanaPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4208](https://github.com/microsoft/Microsoft365DSC/issues/4208) +* TeamsEnhancedEncryptionPolicy + * Fix condition when resource is absent + FIXES [#4221](https://github.com/microsoft/Microsoft365DSC/issues/4221) +* TeamsEventsPolicy + * Add missing attributes + FIXES [#4242](https://github.com/microsoft/Microsoft365DSC/issues/4242) +* TeamsFeedbackPolicy + * Fix condition when resource is absent + FIXES [#4223](https://github.com/microsoft/Microsoft365DSC/issues/4223) +* TeamsFilesPolicy + * Fix condition when resource is absent + FIXES [#4225](https://github.com/microsoft/Microsoft365DSC/issues/4225) +* TeamsGroupPolicyAssignment + * Ensure assignment can still be created if GroupId is not found by trying to + search by DisplayName afterwards + FIXES [#4248](https://github.com/microsoft/Microsoft365DSC/issues/4248) +* TeamsMeetingBroadcastPolicy + * Fix deletion of resource + FIXES [#4231](https://github.com/microsoft/Microsoft365DSC/issues/4231) +* TeamsMobilityPolicy + * Validate string set on parameter MobileDialerPreference +* DEPENDENCIES + * Updated Microsoft.Graph dependencies to version 2.12.0. + * Updated MicrosoftTeams dependencies to version 5.9.0. + # 1.24.117.1 * AADAdministrativeUnit @@ -20,11 +107,14 @@ * Removed the ability to specify a value of Absent for the Ensure property. * EXOAntiPhishPolicy * Add support for HonorDmarcPolicy parameter - FIXES [[#4138](https://github.com/microsoft/Microsoft365DSC/issues/4138)] + FIXES [#4138](https://github.com/microsoft/Microsoft365DSC/issues/4138) * IntuneDeviceConfigurationPolicyMacOS * Fix CIM instances comparison in Test-TargetResource and export CompliantAppsList with the correct type FIXES [#4144](https://github.com/microsoft/Microsoft365DSC/issues/4144) +* TeamsEmergencyCallRoutingPolicy + * Fix deletion of resource + FIXES [#4219](https://github.com/microsoft/Microsoft365DSC/issues/4219) * DEPENDENCIES * Updated Microsoft.PowerApps.Administration.PowerShell to version 2.0.178. * Updated MSCloudLoginAssistant to version 1.1.7. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyAuthenticator/MSFT_AADAuthenticationMethodPolicyAuthenticator.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyAuthenticator/MSFT_AADAuthenticationMethodPolicyAuthenticator.psm1 index bcc87c21a1..dfd66443d9 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyAuthenticator/MSFT_AADAuthenticationMethodPolicyAuthenticator.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyAuthenticator/MSFT_AADAuthenticationMethodPolicyAuthenticator.psm1 @@ -86,7 +86,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Authenticator with id {$id}" return $nullResult @@ -414,103 +414,15 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Authenticator with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - # replace group Displayname with group id - if ($CreateParameters.featureSettings.companionAppAllowedState.includeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users'){ - $Filter = "Displayname eq '$($CreateParameters.featureSettings.companionAppAllowedState.includeTarget.id)'" | Out-String - $groupid = (Get-MgGroup -Filter $Filter).id.ToString() - $CreateParameters.featureSettings.companionAppAllowedState.includeTarget.foreach('id',$groupid) - } - if ($CreateParameters.featureSettings.companionAppAllowedState.excludeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users'){ - $Filter = "Displayname eq '$($CreateParameters.featureSettings.companionAppAllowedState.excludeTarget.id)'" | Out-String - $groupid = (Get-MgGroup -Filter $Filter).id.ToString() - $CreateParameters.featureSettings.companionAppAllowedState.excludeTarget.foreach('id',$groupid) - } - if ($CreateParameters.featureSettings.displayAppInformationRequiredState.includeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users'){ - $Filter = "Displayname eq '$($CreateParameters.featureSettings.displayAppInformationRequiredState.includeTarget.id)'" | Out-String - $groupid = (Get-MgGroup -Filter $Filter).id.ToString() - $CreateParameters.featureSettings.displayAppInformationRequiredState.includeTarget.foreach('id',$groupid) - } - if ($UpdateParCreateParametersameters.featureSettings.displayAppInformationRequiredState.excludeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users'){ - $Filter = "Displayname eq '$($CreateParameters.featureSettings.displayAppInformationRequiredState.excludeTarget.id)'" | Out-String - $groupid = (Get-MgGroup -Filter $Filter).id.ToString() - $CreateParameters.featureSettings.displayAppInformationRequiredState.excludeTarget.foreach('id',$groupid) - } - if ($CreateParameters.featureSettings.displayLocationInformationRequiredState.includeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users'){ - $Filter = "Displayname eq '$($CreateParameters.featureSettings.displayLocationInformationRequiredState.includeTarget.id)'" | Out-String - $groupid = (Get-MgGroup -Filter $Filter).id.ToString() - $CreateParameters.featureSettings.displayLocationInformationRequiredState.includeTarget.foreach('id',$groupid) - } - if ($CreateParameters.featureSettings.displayLocationInformationRequiredState.excludeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users'){ - $Filter = "Displayname eq '$($CreateParameters.featureSettings.displayLocationInformationRequiredState.excludeTarget.id)'" | Out-String - $groupid = (Get-MgGroup -Filter $Filter).id.ToString() - $CreateParameters.featureSettings.displayLocationInformationRequiredState.excludeTarget.foreach('id',$groupid) - } - - # DEPRECATED - if ($CreateParameters.featureSettings.ContainsKey('NumberMatchingRequiredState')) - { - Write-Verbose -Message "The NumberMatchingRequiredState feature is deprecated and will be ignored. Please remove it from your configuration." - $CreateParameters.featureSettings.Remove('NumberMatchingRequiredState') - } - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key) - { - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id', (Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key) - { - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id', (Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Authenticator with Id {$($currentInstance.Id)}" $UpdateParameters = ([Hashtable]$BoundParameters).clone() $UpdateParameters = Rename-M365DSCCimInstanceParameter -Properties $UpdateParameters - $UpdateParameters.Remove('Id') | Out-Null - Write-Verbose -Message "Flag1" # replace group Displayname with group id if ($UpdateParameters.featureSettings.companionAppAllowedState.includeTarget.id -and ` $UpdateParameters.featureSettings.companionAppAllowedState.includeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users' -and @@ -521,8 +433,6 @@ function Set-TargetResource $groupid = (Get-MgGroup -Filter $Filter).id.ToString() $UpdateParameters.featureSettings.companionAppAllowedState.includeTarget.foreach('id',$groupid) } - - Write-Verbose -Message "Flag2" if ($UpdateParameters.featureSettings.companionAppAllowedState.excludeTarget.id -and ` $UpdateParameters.featureSettings.companionAppAllowedState.excludeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users' -and $UpdateParameters.featureSettings.ContainsKey('companionAppAllowedState')) @@ -532,7 +442,6 @@ function Set-TargetResource $groupid = (Get-MgGroup -Filter $Filter).id.ToString() $UpdateParameters.featureSettings.companionAppAllowedState.excludeTarget.foreach('id',$groupid) } - Write-Verbose -Message "Flag3" if ($UpdateParameters.featureSettings.displayAppInformationRequiredState.includeTarget.id -and ` $UpdateParameters.featureSettings.displayAppInformationRequiredState.includeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users' -and $UpdateParameters.featureSettings.ContainsKey('displayAppInformationRequiredState')) @@ -542,7 +451,6 @@ function Set-TargetResource $groupid = (Get-MgGroup -Filter $Filter).id.ToString() $UpdateParameters.featureSettings.displayAppInformationRequiredState.includeTarget.foreach('id',$groupid) } - Write-Verbose -Message "Flag4" if ($UpdateParameters.featureSettings.displayAppInformationRequiredState.excludeTarget.id -and ` $UpdateParameters.featureSettings.displayAppInformationRequiredState.excludeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users' -and $UpdateParameters.featureSettings.ContainsKey('displayAppInformationRequiredState')) @@ -552,7 +460,6 @@ function Set-TargetResource $groupid = (Get-MgGroup -Filter $Filter).id.ToString() $UpdateParameters.featureSettings.displayAppInformationRequiredState.excludeTarget.foreach('id',$groupid) } - Write-Verbose -Message "Flag5" if ($UpdateParameters.featureSettings.displayLocationInformationRequiredState.includeTarget.id -and ` $UpdateParameters.featureSettings.displayLocationInformationRequiredState.includeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users' -and $UpdateParameters.featureSettings.ContainsKey('displayLocationInformationRequiredState')) @@ -562,7 +469,6 @@ function Set-TargetResource $groupid = (Get-MgGroup -Filter $Filter).id.ToString() $UpdateParameters.featureSettings.displayLocationInformationRequiredState.includeTarget.foreach('id',$groupid) } - Write-Verbose -Message "Flag6" if ($UpdateParameters.featureSettings.displayLocationInformationRequiredState.excludeTarget.id -and ` $UpdateParameters.featureSettings.displayLocationInformationRequiredState.excludeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users' -and $UpdateParameters.featureSettings.ContainsKey('displayLocationInformationRequiredState')) @@ -574,22 +480,18 @@ function Set-TargetResource } # DEPRECATED - Write-Verbose -Message "Flag7" if ($UpdateParameters.featureSettings.ContainsKey('NumberMatchingRequiredState')) { Write-Verbose -Message "The NumberMatchingRequiredState feature is deprecated and will be ignored. Please remove it from your configuration." $UpdateParameters.featureSettings.Remove('NumberMatchingRequiredState') } - Write-Verbose -Message "Flag8" $keys = (([Hashtable]$UpdateParameters).clone()).Keys foreach ($key in $keys) { if ($null -ne $UpdateParameters.$key -and $UpdateParameters.$key.getType().Name -like '*cimInstance*') { - Write-Verbose -Message "Flag9a" $UpdateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $UpdateParameters.$key - Write-Verbose -Message "Flag9b" } if ($key -eq 'IncludeTargets' -or $key -eq 'ExcludeTargets') { diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyEmail/MSFT_AADAuthenticationMethodPolicyEmail.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyEmail/MSFT_AADAuthenticationMethodPolicyEmail.psm1 index 1cfbd3473a..d003bcb1b2 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyEmail/MSFT_AADAuthenticationMethodPolicyEmail.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyEmail/MSFT_AADAuthenticationMethodPolicyEmail.psm1 @@ -84,7 +84,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Email with id {$id}" return $nullResult @@ -257,52 +257,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Email with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.emailAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Email with Id {$($currentInstance.Id)}" diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyFido2/MSFT_AADAuthenticationMethodPolicyFido2.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyFido2/MSFT_AADAuthenticationMethodPolicyFido2.psm1 index da26ea6b2c..f185f8d8cd 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyFido2/MSFT_AADAuthenticationMethodPolicyFido2.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyFido2/MSFT_AADAuthenticationMethodPolicyFido2.psm1 @@ -91,7 +91,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Fido2 with id {$id}" return $nullResult @@ -278,52 +278,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Fido2 with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.fido2AuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Fido2 with Id {$($currentInstance.Id)}" diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySms/MSFT_AADAuthenticationMethodPolicySms.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySms/MSFT_AADAuthenticationMethodPolicySms.psm1 index 11ac135f1a..6468ccd7ba 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySms/MSFT_AADAuthenticationMethodPolicySms.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySms/MSFT_AADAuthenticationMethodPolicySms.psm1 @@ -79,7 +79,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Sms with id {$id}" return $nullResult @@ -238,52 +238,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Sms with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.smsAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Sms with Id {$($currentInstance.Id)}" diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySoftware/MSFT_AADAuthenticationMethodPolicySoftware.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySoftware/MSFT_AADAuthenticationMethodPolicySoftware.psm1 index 3bcab2dcf5..b455da368a 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySoftware/MSFT_AADAuthenticationMethodPolicySoftware.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySoftware/MSFT_AADAuthenticationMethodPolicySoftware.psm1 @@ -79,7 +79,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Software with id {$id}" return $nullResult @@ -238,52 +238,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Software with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.softwareOathAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Software with Id {$($currentInstance.Id)}" diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyTemporary/MSFT_AADAuthenticationMethodPolicyTemporary.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyTemporary/MSFT_AADAuthenticationMethodPolicyTemporary.psm1 index 982b5e380c..fd509d30a2 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyTemporary/MSFT_AADAuthenticationMethodPolicyTemporary.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyTemporary/MSFT_AADAuthenticationMethodPolicyTemporary.psm1 @@ -99,7 +99,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Temporary" return $nullResult @@ -286,52 +286,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Temporary with DisplayName {$DisplayName}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.temporaryAccessPassAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Temporary with Id {$($currentInstance.Id)}" diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyVoice/MSFT_AADAuthenticationMethodPolicyVoice.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyVoice/MSFT_AADAuthenticationMethodPolicyVoice.psm1 index f620264991..63a37ba8b8 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyVoice/MSFT_AADAuthenticationMethodPolicyVoice.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyVoice/MSFT_AADAuthenticationMethodPolicyVoice.psm1 @@ -83,7 +83,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Voice with id {$id}" return $nullResult @@ -247,52 +247,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Voice with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.voiceAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Voice with Id {$($currentInstance.Id)}" diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 index 229cfccfb5..b6cb728bb6 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 @@ -84,7 +84,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy X509 with id {$id}" return $nullResult @@ -310,52 +310,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy X509 with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.x509CertificateAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy X509 with Id {$($currentInstance.Id)}" diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 index d5fd93d23c..7f3e7c076f 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 @@ -954,7 +954,7 @@ function Set-TargetResource } #create and provision Application Condition object Write-Verbose -Message 'Set-Targetresource: create Application Condition object' - if ($IncludeApplications) + if ($currentParameters.ContainsKey("IncludeApplications")) { $conditions.Applications.Add('IncludeApplications', $IncludeApplications) } @@ -970,7 +970,6 @@ function Set-TargetResource } $conditions.Applications.Add("ApplicationFilter", $appFilterValue) } - if ($IncludeUserActions) { $conditions.Applications.Add('IncludeUserActions', $IncludeUserActions) @@ -993,18 +992,108 @@ function Set-TargetResource #create and provision User Condition object Write-Verbose -Message 'Set-Targetresource: process includeusers' - $conditions.Users.Add('IncludeUsers', @()) - foreach ($includeuser in $IncludeUsers) + if ($currentParameters.ContainsKey('IncludeUsers')) + { + $conditions.Users.Add('IncludeUsers', @()) + foreach ($includeuser in $IncludeUsers) + { + #translate user UPNs to GUID, except id value is GuestsOrExternalUsers, None or All + if ($includeuser) + { + if ($includeuser -notin 'GuestsOrExternalUsers', 'All', 'None') + { + $userguid = $null + try + { + $userguid = (Get-MgUser -UserId $includeuser).Id + } + catch + { + New-M365DSCLogEntry -Message 'Error updating data:' ` + -Exception $_ ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + if ($null -eq $userguid) + { + $message = "Couldn't find user $includeuser , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + else + { + $conditions.Users.IncludeUsers += $userguid + } + } + else + { + $conditions.Users.IncludeUsers += $includeuser + } + } + } + } + + Write-Verbose -Message 'Set-Targetresource: process excludeusers' + if ($currentParameters.ContainsKey('ExcludeUsers')) { - #translate user UPNs to GUID, except id value is GuestsOrExternalUsers, None or All - if ($includeuser) + $conditions.Users.Add('ExcludeUsers', @()) + foreach ($excludeuser in $ExcludeUsers) { - if ($includeuser -notin 'GuestsOrExternalUsers', 'All', 'None') + #translate user UPNs to GUID, except id value is GuestsOrExternalUsers, None or All + if ($excludeuser) { - $userguid = $null + if ($excludeuser -notin 'GuestsOrExternalUsers', 'All', 'None') + { + $userguid = $null + try + { + $userguid = (Get-MgUser -UserId $excludeuser).Id + } + catch + { + New-M365DSCLogEntry -Message 'Error updating data:' ` + -Exception $_ ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + if ($null -eq $userguid) + { + $message = "Couldn't find user $excludeuser , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + else + { + $conditions.Users.ExcludeUsers += $userguid + } + } + else + { + $conditions.Users.ExcludeUsers += $excludeuser + } + } + } + } + + Write-Verbose -Message 'Set-Targetresource: process includegroups' + if ($currentParameters.ContainsKey('IncludeGroups')) + { + $conditions.Users.Add('IncludeGroups', @()) + foreach ($includegroup in $IncludeGroups) + { + #translate user Group names to GUID + if ($includegroup) + { + $GroupLookup = $null try { - $userguid = (Get-MgUser -UserId $includeuser).Id + $GroupLookup = Get-MgGroup -Filter "DisplayName eq '$includegroup'" } catch { @@ -1014,9 +1103,17 @@ function Set-TargetResource -TenantId $TenantId ` -Credential $Credential } - if ($null -eq $userguid) + if ($GroupLookup.Length -gt 1) + { + $message = "Duplicate group found with displayname $includegroup , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + elseif ($null -eq $GroupLookup) { - $message = "Couldn't find user $includeuser , couldn't add to policy $DisplayName" + $message = "Couldn't find group $includegroup , couldn't add to policy $DisplayName" New-M365DSCLogEntry -Message $message ` -Source $($MyInvocation.MyCommand.Source) ` -TenantId $TenantId ` @@ -1024,29 +1121,26 @@ function Set-TargetResource } else { - $conditions.Users.IncludeUsers += $userguid + Write-Verbose -Message 'adding group to includegroups' + $conditions.Users.IncludeGroups += $GroupLookup.Id } } - else - { - $conditions.Users.IncludeUsers += $includeuser - } } } - Write-Verbose -Message 'Set-Targetresource: process excludeusers' - $conditions.Users.Add('ExcludeUsers', @()) - foreach ($excludeuser in $ExcludeUsers) + Write-Verbose -Message 'Set-Targetresource: process excludegroups' + if ($currentParameters.ContainsKey('ExcludeGroups')) { - #translate user UPNs to GUID, except id value is GuestsOrExternalUsers, None or All - if ($excludeuser) + $conditions.Users.Add('ExcludeGroups', @()) + foreach ($ExcludeGroup in $ExcludeGroups) { - if ($excludeuser -notin 'GuestsOrExternalUsers', 'All', 'None') + #translate user Group names to GUID + if ($ExcludeGroup) { - $userguid = $null + $GroupLookup = $null try { - $userguid = (Get-MgUser -UserId $excludeuser).Id + $GroupLookup = Get-MgGroup -Filter "DisplayName eq '$ExcludeGroup'" } catch { @@ -1056,9 +1150,17 @@ function Set-TargetResource -TenantId $TenantId ` -Credential $Credential } - if ($null -eq $userguid) + if ($GroupLookup.Length -gt 1) + { + $message = "Duplicate group found with displayname $ExcludeGroup , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + elseif ($null -eq $GroupLookup) { - $message = "Couldn't find user $excludeuser , couldn't add to policy $DisplayName" + $message = "Couldn't find group $ExcludeGroup , couldn't add to policy $DisplayName" New-M365DSCLogEntry -Message $message ` -Source $($MyInvocation.MyCommand.Source) ` -TenantId $TenantId ` @@ -1066,347 +1168,283 @@ function Set-TargetResource } else { - $conditions.Users.ExcludeUsers += $userguid + Write-Verbose -Message 'adding group to ExcludeGroups' + $conditions.Users.ExcludeGroups += $GroupLookup.Id } } - else - { - $conditions.Users.ExcludeUsers += $excludeuser - } } } - Write-Verbose -Message 'Set-Targetresource: process includegroups' - $conditions.Users.Add('IncludeGroups', @()) - foreach ($includegroup in $IncludeGroups) + + Write-Verbose -Message 'Set-Targetresource: process includeroles' + if ($currentParameters.ContainsKey('IncludeRoles')) { - #translate user Group names to GUID - if ($includegroup) + $conditions.Users.Add('IncludeRoles', @()) + if ($IncludeRoles) { - $GroupLookup = $null - try + #translate role names to template guid if defined + $rolelookup = @{} + foreach ($role in Get-MgBetaDirectoryRoleTemplate) { - $GroupLookup = Get-MgGroup -Filter "DisplayName eq '$includegroup'" + $rolelookup[$role.DisplayName] = $role.Id } - catch + foreach ($IncludeRole in $IncludeRoles) { - New-M365DSCLogEntry -Message 'Error updating data:' ` - -Exception $_ ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential - } - if ($GroupLookup.Length -gt 1) - { - $message = "Duplicate group found with displayname $includegroup , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential + if ($IncludeRole) + { + if ($null -eq $rolelookup[$IncludeRole]) + { + $message = "Couldn't find role $IncludeRole , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + else + { + $conditions.Users.IncludeRoles += $rolelookup[$IncludeRole] + } + } } - elseif ($null -eq $GroupLookup) + } + } + + Write-Verbose -Message 'Set-Targetresource: process excluderoles' + if ($currentParameters.ContainsKey('ExcludeRoles')) + { + $conditions.Users.Add('ExcludeRoles', @()) + if ($ExcludeRoles) + { + #translate role names to template guid if defined + $rolelookup = @{} + foreach ($role in Get-MgBetaDirectoryRoleTemplate) { - $message = "Couldn't find group $includegroup , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential + $rolelookup[$role.DisplayName] = $role.Id } - else + foreach ($ExcludeRole in $ExcludeRoles) { - Write-Verbose -Message 'adding group to includegroups' - $conditions.Users.IncludeGroups += $GroupLookup.Id + if ($ExcludeRole) + { + if ($null -eq $rolelookup[$ExcludeRole]) + { + $message = "Couldn't find role $ExcludeRole , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + else + { + $conditions.Users.ExcludeRoles += $rolelookup[$ExcludeRole] + } + } } } } - $conditions.Users.Add('ExcludeGroups', @()) - Write-Verbose -Message 'Set-Targetresource: process excludegroups' - foreach ($ExcludeGroup in $ExcludeGroups) + Write-Verbose -Message 'Set-Targetresource: process includeGuestOrExternalUser' + If ($currentParameters.ContainsKey('IncludeGuestOrExternalUserTypes')) { - #translate user Group names to GUID - if ($ExcludeGroup) + if ($IncludeGuestOrExternalUserTypes.Count -ne 0) { - $GroupLookup = $null - try + $includeGuestsOrExternalUsers = @{} + [string]$IncludeGuestOrExternalUserTypes = $IncludeGuestOrExternalUserTypes -join ',' + $includeGuestsOrExternalUsers.Add('guestOrExternalUserTypes', $IncludeGuestOrExternalUserTypes) + $externalTenants = @{} + if ($IncludeExternalTenantsMembershipKind -eq 'All') { - $GroupLookup = Get-MgGroup -Filter "DisplayName eq '$ExcludeGroup'" + $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessAllExternalTenants') } - catch + elseif ($IncludeExternalTenantsMembershipKind -eq 'enumerated') { - New-M365DSCLogEntry -Message 'Error updating data:' ` - -Exception $_ ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential + $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessEnumeratedExternalTenants') } - if ($GroupLookup.Length -gt 1) + $externalTenants.Add('membershipKind', $IncludeExternalTenantsMembershipKind) + if ($IncludeExternalTenantsMembers) { - $message = "Duplicate group found with displayname $ExcludeGroup , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential - } - elseif ($null -eq $GroupLookup) - { - $message = "Couldn't find group $ExcludeGroup , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential - } - else - { - Write-Verbose -Message 'adding group to ExcludeGroups' - $conditions.Users.ExcludeGroups += $GroupLookup.Id + $externalTenants.Add('members', $IncludeExternalTenantsMembers) } + $includeGuestsOrExternalUsers.Add('externalTenants', $externalTenants) + $conditions.Users.Add('includeGuestsOrExternalUsers', $includeGuestsOrExternalUsers) } } - Write-Verbose -Message 'Set-Targetresource: process includeroles' - $conditions.Users.Add('IncludeRoles', @()) - if ($IncludeRoles) + + Write-Verbose -Message 'Set-Targetresource: process excludeGuestsOrExternalUsers' + If ($currentParameters.ContainsKey('ExcludeGuestOrExternalUserTypes')) { - #translate role names to template guid if defined - $rolelookup = @{} - foreach ($role in Get-MgBetaDirectoryRoleTemplate) + if ($ExcludeGuestOrExternalUserTypes.Count -ne 0) { - $rolelookup[$role.DisplayName] = $role.Id - } - foreach ($IncludeRole in $IncludeRoles) - { - if ($IncludeRole) + $excludeGuestsOrExternalUsers = @{} + [string]$ExcludeGuestOrExternalUserTypes = $ExcludeGuestOrExternalUserTypes -join ',' + $excludeGuestsOrExternalUsers.Add('guestOrExternalUserTypes', $ExcludeGuestOrExternalUserTypes) + $externalTenants = @{} + if ($ExcludeExternalTenantsMembershipKind -eq 'All') { - if ($null -eq $rolelookup[$IncludeRole]) - { - $message = "Couldn't find role $IncludeRole , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential - } - else - { - $conditions.Users.IncludeRoles += $rolelookup[$IncludeRole] - } + $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessAllExternalTenants') } - } - } - Write-Verbose -Message 'Set-Targetresource: process excluderoles' - $conditions.Users.Add('ExcludeRoles', @()) - if ($ExcludeRoles) - { - #translate role names to template guid if defined - $rolelookup = @{} - foreach ($role in Get-MgBetaDirectoryRoleTemplate) - { - $rolelookup[$role.DisplayName] = $role.Id - } - foreach ($ExcludeRole in $ExcludeRoles) - { - if ($ExcludeRole) + elseif ($ExcludeExternalTenantsMembershipKind -eq 'enumerated') { - if ($null -eq $rolelookup[$ExcludeRole]) - { - $message = "Couldn't find role $ExcludeRole , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential - } - else - { - $conditions.Users.ExcludeRoles += $rolelookup[$ExcludeRole] - } - + $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessEnumeratedExternalTenants') } + $externalTenants.Add('membershipKind', $ExcludeExternalTenantsMembershipKind) + if ($ExcludeExternalTenantsMembers) + { + $externalTenants.Add('members', $ExcludeExternalTenantsMembers) + } + $excludeGuestsOrExternalUsers.Add('externalTenants', $externalTenants) + $conditions.Users.Add('excludeGuestsOrExternalUsers', $excludeGuestsOrExternalUsers) } } - Write-Verbose -Message 'Set-Targetresource: process includeGuestsOrExternalUsers' - if ($IncludeGuestOrExternalUserTypes.Count -ne 0) - { - $includeGuestsOrExternalUsers = @{} - [string]$IncludeGuestOrExternalUserTypes = $IncludeGuestOrExternalUserTypes -join ',' - $includeGuestsOrExternalUsers.Add('guestOrExternalUserTypes', $IncludeGuestOrExternalUserTypes) - $externalTenants = @{} - if ($IncludeExternalTenantsMembershipKind -eq 'All') - { - $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessAllExternalTenants') - } - elseif ($IncludeExternalTenantsMembershipKind -eq 'enumerated') - { - $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessEnumeratedExternalTenants') - } - $externalTenants.Add('membershipKind', $IncludeExternalTenantsMembershipKind) - if ($IncludeExternalTenantsMembers) - { - $externalTenants.Add('members', $IncludeExternalTenantsMembers) - } - $includeGuestsOrExternalUsers.Add('externalTenants', $externalTenants) - $conditions.Users.Add('includeGuestsOrExternalUsers', $includeGuestsOrExternalUsers) - } - Write-Verbose -Message 'Set-Targetresource: process excludeGuestsOrExternalUsers' - if ($ExcludeGuestOrExternalUserTypes.Count -ne 0) - { - $excludeGuestsOrExternalUsers = @{} - [string]$ExcludeGuestOrExternalUserTypes = $ExcludeGuestOrExternalUserTypes -join ',' - $excludeGuestsOrExternalUsers.Add('guestOrExternalUserTypes', $ExcludeGuestOrExternalUserTypes) - $externalTenants = @{} - if ($ExcludeExternalTenantsMembershipKind -eq 'All') - { - $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessAllExternalTenants') - } - elseif ($ExcludeExternalTenantsMembershipKind -eq 'enumerated') - { - $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessEnumeratedExternalTenants') - } - $externalTenants.Add('membershipKind', $ExcludeExternalTenantsMembershipKind) - if ($ExcludeExternalTenantsMembers) - { - $externalTenants.Add('members', $ExcludeExternalTenantsMembers) - } - $excludeGuestsOrExternalUsers.Add('externalTenants', $externalTenants) - $conditions.Users.Add('excludeGuestsOrExternalUsers', $excludeGuestsOrExternalUsers) - } + Write-Verbose -Message 'Set-Targetresource: process platform condition' - if ($IncludePlatforms -or $ExcludePlatforms) + if ($currentParameters.ContainsKey('IncludePlatforms') -or $currentParameters.ContainsKey('ExcludePlatforms')) { - #create and provision Platform condition object if used - if (-not $conditions.Contains('Platforms')) - { - $conditions.Add('Platforms', @{ - ExcludePlatforms = @() - IncludePlatforms = @() - }) - } - else - { - $conditions.Platforms.Add('ExcludePlatforms', @()) - $conditions.Platforms.Add('IncludePlatforms', @()) - } - Write-Verbose -Message "Set-Targetresource: IncludePlatforms: $IncludePlatforms" - if (([Array]$IncludePlatforms).Length -eq 0) + if ($IncludePlatforms -or $ExcludePlatforms) { - $conditions.Platforms.IncludePlatforms = @('all') + #create and provision Platform condition object if used + if (-not $conditions.Contains('Platforms')) + { + $conditions.Add('Platforms', @{ + ExcludePlatforms = @() + IncludePlatforms = @() + }) + } + else + { + $conditions.Platforms.Add('ExcludePlatforms', @()) + $conditions.Platforms.Add('IncludePlatforms', @()) + } + Write-Verbose -Message "Set-Targetresource: IncludePlatforms: $IncludePlatforms" + if (([Array]$IncludePlatforms).Length -eq 0) + { + $conditions.Platforms.IncludePlatforms = @('all') + } + else + { + $conditions.Platforms.IncludePlatforms = @() + $IncludePlatforms + } + #no translation or conversion needed + Write-Verbose -Message "Set-Targetresource: ExcludePlatforms: $ExcludePlatforms" + $conditions.Platforms.ExcludePlatforms = @() + $ExcludePlatforms + #no translation or conversion needed } else { - $conditions.Platforms.IncludePlatforms = @() + $IncludePlatforms + Write-Verbose -Message 'Set-Targetresource: setting platform condition to null' + $conditions.Platforms = $null } - #no translation or conversion needed - Write-Verbose -Message "Set-Targetresource: ExcludePlatforms: $ExcludePlatforms" - $conditions.Platforms.ExcludePlatforms = @() + $ExcludePlatforms - #no translation or conversion needed - } - else - { - Write-Verbose -Message 'Set-Targetresource: setting platform condition to null' - $conditions.Platforms = $null } + Write-Verbose -Message 'Set-Targetresource: process include and exclude locations' - if ($IncludeLocations -or $ExcludeLocations) + if ($currentParameters.ContainsKey('IncludeLocations') -or $currentParameters.ContainsKey('ExcludeLocations')) { - $conditions.Add('Locations', @{ - ExcludeLocations = @() - IncludeLocations = @() - }) - $conditions.Locations.IncludeLocations = @() - $conditions.Locations.ExcludeLocations = @() - Write-Verbose -Message 'Set-Targetresource: locations specified' - #create and provision Location condition object if used, translate Location names to guid - $LocationLookup = @{} - foreach ($Location in Get-MgBetaIdentityConditionalAccessNamedLocation) - { - $LocationLookup[$Location.DisplayName] = $Location.Id - } - foreach ($IncludeLocation in $IncludeLocations) + if ($IncludeLocations -or $ExcludeLocations) { - if ($IncludeLocation) + $conditions.Add('Locations', @{ + ExcludeLocations = @() + IncludeLocations = @() + }) + $conditions.Locations.IncludeLocations = @() + $conditions.Locations.ExcludeLocations = @() + Write-Verbose -Message 'Set-Targetresource: locations specified' + #create and provision Location condition object if used, translate Location names to guid + $LocationLookup = @{} + foreach ($Location in Get-MgBetaIdentityConditionalAccessNamedLocation) { - if ($IncludeLocation -in 'All', 'AllTrusted') - { - $conditions.Locations.IncludeLocations += $IncludeLocation - } - elseif ($IncludeLocation -eq 'Multifactor authentication trusted IPs') - { - $conditions.Locations.IncludeLocations += '00000000-0000-0000-0000-000000000000' - } - elseif ($null -eq $LocationLookup[$IncludeLocation]) - { - $message = "Couldn't find Location $IncludeLocation , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential - } - else - { - $conditions.Locations.IncludeLocations += $LocationLookup[$IncludeLocation] - } + $LocationLookup[$Location.DisplayName] = $Location.Id } - } - foreach ($ExcludeLocation in $ExcludeLocations) - { - if ($ExcludeLocation) + foreach ($IncludeLocation in $IncludeLocations) { - if ($ExcludeLocation -eq 'All' -or $ExcludeLocation -eq 'AllTrusted') - { - $conditions.Locations.ExcludeLocations += $ExcludeLocation - } - elseif ($ExcludeLocation -eq 'Multifactor authentication trusted IPs') - { - $conditions.Locations.ExcludeLocations += '00000000-0000-0000-0000-000000000000' - } - elseif ($null -eq $LocationLookup[$ExcludeLocation]) + if ($IncludeLocation) { - $message = "Couldn't find Location $ExcludeLocation , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential + if ($IncludeLocation -in 'All', 'AllTrusted') + { + $conditions.Locations.IncludeLocations += $IncludeLocation + } + elseif ($IncludeLocation -eq 'Multifactor authentication trusted IPs') + { + $conditions.Locations.IncludeLocations += '00000000-0000-0000-0000-000000000000' + } + elseif ($null -eq $LocationLookup[$IncludeLocation]) + { + $message = "Couldn't find Location $IncludeLocation , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + else + { + $conditions.Locations.IncludeLocations += $LocationLookup[$IncludeLocation] + } } - else + } + foreach ($ExcludeLocation in $ExcludeLocations) + { + if ($ExcludeLocation) { - $conditions.Locations.ExcludeLocations += $LocationLookup[$ExcludeLocation] + if ($ExcludeLocation -eq 'All' -or $ExcludeLocation -eq 'AllTrusted') + { + $conditions.Locations.ExcludeLocations += $ExcludeLocation + } + elseif ($ExcludeLocation -eq 'Multifactor authentication trusted IPs') + { + $conditions.Locations.ExcludeLocations += '00000000-0000-0000-0000-000000000000' + } + elseif ($null -eq $LocationLookup[$ExcludeLocation]) + { + $message = "Couldn't find Location $ExcludeLocation , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + else + { + $conditions.Locations.ExcludeLocations += $LocationLookup[$ExcludeLocation] + } } } } } Write-Verbose -Message 'Set-Targetresource: process device filter' - if ($DeviceFilterMode -and $DeviceFilterRule) + if ($currentParameters.ContainsKey('DeviceFilterMode') -and $currentParameters.ContainsKey('DeviceFilterRule')) { - if (-not $conditions.Contains('Devices')) + if ($DeviceFilterMode -and $DeviceFilterRule) { - $conditions.Add('Devices', @{}) - $conditions.Devices.Add('DeviceFilter', @{}) - $conditions.Devices.DeviceFilter.Add('Mode', $DeviceFilterMode) - $conditions.Devices.DeviceFilter.Add('Rule', $DeviceFilterRule) - } - else - { - if (-not $conditions.Devices.Contains('DeviceFilter')) + if (-not $conditions.Contains('Devices')) { + $conditions.Add('Devices', @{}) $conditions.Devices.Add('DeviceFilter', @{}) $conditions.Devices.DeviceFilter.Add('Mode', $DeviceFilterMode) $conditions.Devices.DeviceFilter.Add('Rule', $DeviceFilterRule) } else { - if (-not $conditions.Devices.DeviceFilter.Contains('Mode')) + if (-not $conditions.Devices.Contains('DeviceFilter')) { + $conditions.Devices.Add('DeviceFilter', @{}) $conditions.Devices.DeviceFilter.Add('Mode', $DeviceFilterMode) - } - else - { - $conditions.Devices.DeviceFilter.Mode = $DeviceFilterMode - } - if (-not $conditions.Devices.DeviceFilter.Contains('Rule')) - { $conditions.Devices.DeviceFilter.Add('Rule', $DeviceFilterRule) } else { - $conditions.Devices.DeviceFilter.Rule = $DeviceFilterRule + if (-not $conditions.Devices.DeviceFilter.Contains('Mode')) + { + $conditions.Devices.DeviceFilter.Add('Mode', $DeviceFilterMode) + } + else + { + $conditions.Devices.DeviceFilter.Mode = $DeviceFilterMode + } + if (-not $conditions.Devices.DeviceFilter.Contains('Rule')) + { + $conditions.Devices.DeviceFilter.Add('Rule', $DeviceFilterRule) + } + else + { + $conditions.Devices.DeviceFilter.Rule = $DeviceFilterRule + } } } } @@ -1414,14 +1452,27 @@ function Set-TargetResource Write-Verbose -Message 'Set-Targetresource: process risk levels and app types' Write-Verbose -Message "Set-Targetresource: UserRiskLevels: $UserRiskLevels" - $Conditions.Add('UserRiskLevels', $UserRiskLevels) - #no translation or conversion needed + If ($currentParameters.ContainsKey('UserRiskLevels')) + { + $Conditions.Add('UserRiskLevels', $UserRiskLevels) + #no translation or conversion needed + } + + Write-Verbose -Message "Set-Targetresource: SignInRiskLevels: $SignInRiskLevels" - $Conditions.Add('SignInRiskLevels', $SignInRiskLevels) - #no translation or conversion needed + If ($currentParameters.ContainsKey('SignInRiskLevels')) + { + $Conditions.Add('SignInRiskLevels', $SignInRiskLevels) + #no translation or conversion needed + } + + Write-Verbose -Message "Set-Targetresource: ClientAppTypes: $ClientAppTypes" - $Conditions.Add('ClientAppTypes', $ClientAppTypes) - #no translation or conversion needed + If ($currentParameters.ContainsKey('ClientAppTypes')) + { + $Conditions.Add('ClientAppTypes', $ClientAppTypes) + #no translation or conversion needed + } Write-Verbose -Message 'Set-Targetresource: Adding processed conditions' #add all conditions to the parameter list $NewParameters.Add('Conditions', $Conditions) @@ -1565,19 +1616,32 @@ function Set-TargetResource Write-Verbose -Message "Set-Targetresource: create policy $DisplayName" Write-Verbose -Message 'Create Parameters:' Write-Verbose -Message (Convert-M365DscHashtableToString $NewParameters) - try + + if ($newparameters.Conditions.applications.count -gt 0 -and $newparameters.Conditions.Users.count -gt 0 -and ($newparameters.GrantControls.count -gt 0 -or $newparameters.SessionControls.count -gt 0)) { - New-MgBetaIdentityConditionalAccessPolicy @NewParameters + try + { + New-MgBetaIdentityConditionalAccessPolicy @NewParameters + } + catch + { + New-M365DSCLogEntry -Message 'Error creating new policy:' ` + -Exception $_ ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + + Write-Verbose -Message 'Set-Targetresource: Failed creating new policy' + } } - catch + else { - New-M365DSCLogEntry -Message 'Error updating data:' ` - -Exception $_ ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential + New-M365DSCLogEntry -Message 'Error creating new policy:' ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential - Write-Verbose -Message 'Set-Targetresource: Failed creating policy' + Write-Verbose -Message 'Set-Targetresource: Failed creating new policy. At least a user rule, application rule and grant or session control is required' } } elseif ($Ensure -eq 'Absent' -and $currentPolicy.Ensure -eq 'Present') diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.psm1 index c7732ebb8d..9339b59158 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.psm1 @@ -20,7 +20,7 @@ function Get-TargetResource [Parameter()] [System.String] - [ValidateSet('Absent', 'Present')] + [ValidateSet('Present')] $Ensure = 'Present', [Parameter()] @@ -124,7 +124,7 @@ function Set-TargetResource [Parameter()] [System.String] - [ValidateSet('Absent', 'Present')] + [ValidateSet('Present')] $Ensure = 'Present', [Parameter()] @@ -212,7 +212,7 @@ function Test-TargetResource [Parameter()] [System.String] - [ValidateSet('Absent', 'Present')] + [ValidateSet('Present')] $Ensure = 'Present', [Parameter()] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.schema.mof index 2737f04b76..48d39c9463 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.schema.mof @@ -4,7 +4,7 @@ class MSFT_AADCrossTenantAccessPolicy : OMI_BaseResource [Key, Description("Only valid value is 'Yes'."), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; [Write, Description("The name of the policy.")] String DisplayName; [Write, Description("Used to specify which Microsoft clouds an organization would like to collaborate with. By default, this value is empty."), ValueMap{"microsoftonline.com","microsoftonline.us", "partner.microsoftonline.cn"}, Values{"microsoftonline.com","microsoftonline.us", "partner.microsoftonline.cn"}] String AllowedCloudEndpoints[]; - [Write, Description("Specify if the policy should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; + [Write, Description("Specify if the policy should exist or not."), ValueMap{"Present"}, Values{"Present"}] String Ensure; [Write, Description("Credentials of the Admin"), EmbeddedInstance("MSFT_Credential")] string Credential; [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; [Write, Description("Id of the Azure Active Directory tenant used for authentication.")] String TenantId; diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.psm1 index 839540107b..5300c7096b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.psm1 @@ -31,7 +31,7 @@ function Get-TargetResource [Parameter()] [System.String] - [ValidateSet('Absent', 'Present')] + [ValidateSet('Present')] $Ensure = 'Present', [Parameter()] @@ -170,7 +170,7 @@ function Set-TargetResource [Parameter()] [System.String] - [ValidateSet('Absent', 'Present')] + [ValidateSet('Present')] $Ensure = 'Present', [Parameter()] @@ -291,7 +291,7 @@ function Test-TargetResource [Parameter()] [System.String] - [ValidateSet('Absent', 'Present')] + [ValidateSet('Present')] $Ensure = 'Present', [Parameter()] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.schema.mof index 1332c4dabd..171f341402 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.schema.mof @@ -36,7 +36,7 @@ class MSFT_AADCrossTenantAccessPolicyConfigurationDefault : OMI_BaseResource [Write, Description("Defines your partner-specific configuration for users from other organizations accessing your resources via Azure AD B2B direct connect."), EmbeddedInstance("MSFT_AADCrossTenantAccessPolicyB2BSetting")] String B2BDirectConnectInbound; [Write, Description("Defines your partner-specific configuration for users in your organization going outbound to access resources in another organization via Azure AD B2B direct connect."), EmbeddedInstance("MSFT_AADCrossTenantAccessPolicyB2BSetting")] String B2BDirectConnectOutbound; [Write, Description("Determines the partner-specific configuration for trusting other Conditional Access claims from external Azure AD organizations."), EmbeddedInstance("MSFT_AADCrossTenantAccessPolicyInboundTrust")] String InboundTrust; - [Write, Description("Specify if the instance should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; + [Write, Description("Specify if the instance should exist or not."), ValueMap{"Present"}, Values{"Present"}] String Ensure; [Write, Description("Credentials of the Admin"), EmbeddedInstance("MSFT_Credential")] string Credential; [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; [Write, Description("Id of the Azure Active Directory tenant used for authentication.")] String TenantId; diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 index 31088bcbd6..d3af2977c2 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 @@ -113,7 +113,10 @@ function Get-TargetResource if ($null -eq $getValue) { - Write-Verbose -Message "Nothing with id {$id} was found" + if(-not [System.String]::IsNullOrEmpty($id)) + { + Write-Verbose -Message "Nothing with id {$id} was found" + } if (-Not [string]::IsNullOrEmpty($DisplayName)) { @@ -783,10 +786,10 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters $ValuesToCheck = ([Hashtable]$PSBoundParameters).clone() - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -eq 'Absent' -and $Ensure -eq 'Absent') { - Write-Verbose -Message "Test-TargetResource returned $false" - return $false + Write-Verbose -Message "Test-TargetResource returned $true" + return $true } $testResult = $true @@ -802,6 +805,11 @@ function Test-TargetResource { $s.remove('Id') } + + if ($target.getType().Name -like '*CimInstance*') + { + $target = Get-M365DSCDRGComplexTypeToHashtable -ComplexObject $target + } foreach ($t in [Array]$target) { $t.remove('Id') diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalog/MSFT_AADEntitlementManagementAccessPackageCatalog.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalog/MSFT_AADEntitlementManagementAccessPackageCatalog.psm1 index 0360b370d5..e277b29f1b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalog/MSFT_AADEntitlementManagementAccessPackageCatalog.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalog/MSFT_AADEntitlementManagementAccessPackageCatalog.psm1 @@ -95,7 +95,10 @@ function Get-TargetResource if ($null -eq $getValue) { - Write-Verbose -Message "Nothing with id {$id} was found" + if (-not [System.String]::IsNullOrEmpty($Id)) + { + Write-Verbose -Message "Nothing with id {$id} was found" + } if (-Not [string]::IsNullOrEmpty($DisplayName)) { @@ -357,10 +360,10 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters $ValuesToCheck = ([Hashtable]$PSBoundParameters).clone() - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -eq 'Absent' -and $Ensure -eq 'Absent') { - Write-Verbose -Message "Test-TargetResource returned $false" - return $false + Write-Verbose -Message "Test-TargetResource returned $true" + return $true } $testResult = $true diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.psm1 index 9f7c6f4e0e..6e7b94cf31 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.psm1 @@ -93,7 +93,10 @@ function Get-TargetResource if ($null -eq $getValue) { - Write-Verbose -Message "Entitlement Management Connected Organization with id {$id} was not found." + if (-not [System.String]::IsNullOrEmpty($id)) + { + Write-Verbose -Message "Entitlement Management Connected Organization with id {$id} was not found." + } if (-Not [string]::IsNullOrEmpty($DisplayName)) { diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/MSFT_AADGroup.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/MSFT_AADGroup.psm1 index 293ac6fd29..a0b411cc71 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/MSFT_AADGroup.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/MSFT_AADGroup.psm1 @@ -511,7 +511,49 @@ function Set-TargetResource $currentParameters.Remove('AssignedLicenses') | Out-Null - if ($Ensure -eq 'Present' -and $currentGroup.Ensure -eq 'Present') + if ($Ensure -eq 'Present' -and $currentGroup.Ensure -eq 'Absent') + { + Write-Verbose -Message "Checking to see if an existing deleted group exists with DisplayName {$DisplayName}" + $restorinExisting = $false + [Array]$groups = Get-MgBetaDirectoryDeletedItemAsGroup -Filter "DisplayName eq '$DisplayName'" + if ($groups.Length -gt 1) + { + throw "Multiple deleted groups with the name {$DisplayName} were found. Cannot restore the existig group. Please ensure that you either have no instance of the group in the deleted list or that you have a single one." + } + + if ($groups.Length -eq 1) + { + Write-Verbose -Message "Found an instance of a deleted group {$DisplayName}. Restoring it." + Restore-MgBetaDirectoryDeletedItem -DirectoryObjectId $groups[0].Id + $restoringExisting = $true + $currentGroup = Get-MgGroup -Filter "DisplayName eq '$DisplayName'" -ErrorAction Stop + } + + if (-not $restoringExisting) + { + Write-Verbose -Message "Creating new group {$DisplayName}" + $currentParameters.Remove('Id') | Out-Null + + try + { + Write-Verbose -Message "Creating Group with Values: $(Convert-M365DscHashtableToString -Hashtable $currentParameters)" + $currentGroup = New-MgGroup @currentParameters + Write-Verbose -Message "Created Group $($currentGroup.id)" + } + catch + { + Write-Verbose -Message $_ + New-M365DSCLogEntry -Message "Couldn't create group $DisplayName" ` + -Exception $_ ` + -Source $MyInvocation.MyCommand.ModuleName + } + } + if ($assignedLicensesGUIDs.Length -gt 0) + { + Set-MgGroupLicense -GroupId $currentGroup.Id -AddLicenses $licensesToAdd -RemoveLicenses @() + } + } + if ($Ensure -eq 'Present') { Write-Verbose -Message "Group {$DisplayName} exists and it should." try @@ -557,30 +599,6 @@ function Set-TargetResource -Source $MyInvocation.MyCommand.ModuleName } } - elseif ($Ensure -eq 'Present' -and $currentGroup.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating new group {$DisplayName}" - $currentParameters.Remove('Id') | Out-Null - - try - { - Write-Verbose -Message "Creating Group with Values: $(Convert-M365DscHashtableToString -Hashtable $currentParameters)" - $currentGroup = New-MgGroup @currentParameters - - Write-Verbose -Message "Created Group $($currentGroup.id)" - if ($assignedLicensesGUIDs.Length -gt 0) - { - Set-MgGroupLicense -GroupId $currentGroup.Id -AddLicenses $licensesToAdd -RemoveLicenses @() - } - } - catch - { - Write-Verbose -Message $_ - New-M365DSCLogEntry -Message "Couldn't create group $DisplayName" ` - -Exception $_ ` - -Source $MyInvocation.MyCommand.ModuleName - } - } elseif ($Ensure -eq 'Absent' -and $currentGroup.Ensure -eq 'Present') { try @@ -623,7 +641,17 @@ function Set-TargetResource $ownerObject = @{ '@odata.id' = "https://graph.microsoft.com/v1.0/users/{$($user.Id)}" } - New-MgGroupOwnerByRef -GroupId ($currentGroup.Id) -BodyParameter $ownerObject | Out-Null + try + { + New-MgGroupOwnerByRef -GroupId ($currentGroup.Id) -BodyParameter $ownerObject -ErrorAction Stop| Out-Null + } + catch + { + if ($_.Exception.Message -notlike "*One or more added object references already exist for the following modified properties*") + { + throw $_ + } + } } elseif ($diff.SideIndicator -eq '<=') { diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/settings.json b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/settings.json index f446ba749c..3bb5995e76 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/settings.json +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/settings.json @@ -17,18 +17,12 @@ } ], "update": [ - { - "name": "Group.Read.All" - }, { "name": "Group.ReadWrite.All" }, { "name": "Organization.Read.All" }, - { - "name": "RoleManagement.Read.Directory" - }, { "name": "RoleManagement.ReadWrite.Directory" }, diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOActiveSyncDeviceAccessRule/MSFT_EXOActiveSyncDeviceAccessRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOActiveSyncDeviceAccessRule/MSFT_EXOActiveSyncDeviceAccessRule.psm1 index 6c5bada108..57b2898d9b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOActiveSyncDeviceAccessRule/MSFT_EXOActiveSyncDeviceAccessRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOActiveSyncDeviceAccessRule/MSFT_EXOActiveSyncDeviceAccessRule.psm1 @@ -88,7 +88,7 @@ function Get-TargetResource { $AllActiveSyncDeviceAccessRules = Get-ActiveSyncDeviceAccessRule -ErrorAction Stop - $ActiveSyncDeviceAccessRule = $AllActiveSyncDeviceAccessRules | Where-Object -FilterScript { $_.Identity -eq $Identity } + $ActiveSyncDeviceAccessRule = $AllActiveSyncDeviceAccessRules | Where-Object -FilterScript { $_.Identity -eq "$QueryString ($Characteristic)" } if ($null -eq $ActiveSyncDeviceAccessRule) { @@ -212,7 +212,7 @@ function Set-TargetResource } $SetActiveSyncDeviceAccessRuleParams = @{ - Identity = $Identity + Identity = "$QueryString ($Characteristic)" AccessLevel = $AccessLevel Confirm = $false } @@ -229,7 +229,7 @@ function Set-TargetResource elseif ($Ensure -eq 'Absent' -and $currentActiveSyncDeviceAccessRuleConfig.Ensure -eq 'Present') { Write-Verbose -Message "Active Sync Device Access Rule '$($Identity)' exists but it shouldn't. Remove it." - Remove-ActiveSyncDeviceAccessRule -Identity $Identity -Confirm:$false + Remove-ActiveSyncDeviceAccessRule -Identity "$QueryString ($Characteristic)" -Confirm:$false } # CASE: Active Sync Device Access Rule exists and it should, but has different values than the desired ones elseif ($Ensure -eq 'Present' -and $currentActiveSyncDeviceAccessRuleConfig.Ensure -eq 'Present') @@ -324,6 +324,7 @@ function Test-TargetResource $ValuesToCheck.Remove('CertificatePath') | Out-Null $ValuesToCheck.Remove('CertificatePassword') | Out-Null $ValuesToCheck.Remove('ManagedIdentity') | Out-Null + $ValuesToCheck.Remove('Identity') | Out-Null $TestResult = Test-M365DSCParameterState -CurrentValues $CurrentValues ` -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 index 70aeb12826..60468be205 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 @@ -430,10 +430,14 @@ function Set-TargetResource ConditionalCustomAttribute9 = $ConditionalCustomAttribute9 ConditionalDepartment = $ConditionalDepartment ConditionalStateOrProvince = $ConditionalStateOrProvince - DisplayName = $DisplayName IncludedRecipients = $IncludedRecipients Confirm = $false } + + if (-not [System.String]::IsNullOrEmpty($DisplayName)) + { + $NewAddressListParams.Add('DisplayName', $DisplayName) + } } New-AddressList @NewAddressListParams } diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 index abde1b37c6..a6c009db0d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 @@ -89,20 +89,45 @@ function Get-TargetResource try { + $ApplicationAccessPolicy = $null try { - $AllApplicationAccessPolicies = Get-ApplicationAccessPolicy -ErrorAction Stop + [Array]$ApplicationAccessPolicy = Get-ApplicationAccessPolicy -Identity $Identity -ErrorAction Stop + Write-Verbose -Message "Found policy by Identity {$Identity}" } catch { - if ($_.Exception -like "The operation couldn't be performed because object*") + Write-Verbose -Message "Could not find policy by Identity {$Identity}" + } + + $ScopeIdentityValue = $null + if ($null -eq $ApplicationAccessPolicy) + { + $scopeIdentityGroup = $null + try { - Write-Verbose 'Could not obtain Application Access Policies for Tenant' - return $nullReturn + $scopeIdentityGroup = Get-Group -Identity $PolicyScopeGroupId -ErrorAction Stop + } + catch + { + Write-Verbose -Message "Could not find Group with Identity {$PolicyScopeGroupId}" + } + + if ($null -ne $scopeIdentityGroup) + { + $ScopeIdentityValue = $scopeIdentityGroup.WindowsEmailAddress + $ApplicationAccessPolicy = Get-ApplicationAccessPolicy | Where-Object -FilterScript { $AppID -eq $_.AppId -and $_.ScopeIdentity -eq $scopeIdentityGroup } } - } - $ApplicationAccessPolicy = $AllApplicationAccessPolicies | Where-Object -FilterScript { $_.Identity -eq $Identity } + if ($null -ne $ApplicationAccessPolicy) + { + Write-Verbose -Message "Found Application Access Policy by Scope {$PolicyScopeGroupId}" + } + } + else + { + $ScopeIdentityValue = $ApplicationAccessPolicy.ScopeIdentity + } if ($null -eq $ApplicationAccessPolicy) { @@ -111,11 +136,12 @@ function Get-TargetResource } else { + $ApplicationAccessPolicy = $ApplicationAccessPolicy[0] $result = @{ Identity = $ApplicationAccessPolicy.Identity AccessRight = $ApplicationAccessPolicy.AccessRight AppID = $ApplicationAccessPolicy.AppID - PolicyScopeGroupId = $ApplicationAccessPolicy.ScopeIdentity + PolicyScopeGroupId = $ScopeIdentityValue Description = $ApplicationAccessPolicy.Description Ensure = 'Present' Credential = $Credential @@ -127,7 +153,7 @@ function Get-TargetResource TenantId = $TenantId } - Write-Verbose -Message "Found Application Access Policy $($Identity)" + Write-Verbose -Message "Found Application Access Policy {$($Identity)}" return $result } } @@ -231,7 +257,7 @@ function Set-TargetResource } $SetApplicationAccessPolicyParams = @{ - Identity = $Identity + Identity = $currentApplicationAccessPolicyConfig.Identity Description = $Description Confirm = $false } @@ -253,16 +279,18 @@ function Set-TargetResource # CASE: Application Access Policy exists and it should, but Description attribute has different values than desired (Set-ApplicationAccessPolicy is only able to change description attribute) elseif ($Ensure -eq 'Present' -and $currentApplicationAccessPolicyConfig.Ensure -eq 'Present' -and $currentApplicationAccessPolicyConfig.Description -ne $Description) { - Write-Verbose -Message "Application Access Policy '$($Identity)' already exists, but needs updating." - Write-Verbose -Message "Setting Application Access Policy $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $SetApplicationAccessPolicyParams)" + Write-Verbose -Message "Application Access Policy '$($currentApplicationAccessPolicyConfig.Identity)' already exists, but needs updating." + Write-Verbose -Message "Setting Application Access Policy $($currentApplicationAccessPolicyConfig.Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $SetApplicationAccessPolicyParams)" Set-ApplicationAccessPolicy @SetApplicationAccessPolicyParams } # CASE: Application Access Policy exists and it should, but has different values than the desired one # Set-ApplicationAccessPolicy is only able to change description attribute, therefore re-create policy elseif ($Ensure -eq 'Present' -and $currentApplicationAccessPolicyConfig.Ensure -eq 'Present' -and $currentApplicationAccessPolicyConfig.Description -eq $Description) { - Write-Verbose -Message "Re-create Application Access Policy '$($Identity)'" - Remove-ApplicationAccessPolicy -Identity $Identity -Confirm:$false + Write-Verbose -Message "Re-create Application Access Policy '$($currentApplicationAccessPolicyConfig.Identity)'" + Remove-ApplicationAccessPolicy -Identity $currentApplicationAccessPolicyConfig.Identity -Confirm:$false + Write-Verbose -Message "Removing existing policy was successful" + Write-Verbose -Message "Creating new instance with parameters: $(Convert-M365DscHashtableToString -Hashtable $NewApplicationAccessPolicyParams)" New-ApplicationAccessPolicy @NewApplicationAccessPolicyParams } } @@ -354,6 +382,7 @@ function Test-TargetResource $ValuesToCheck.Remove('CertificatePath') | Out-Null $ValuesToCheck.Remove('CertificatePassword') | Out-Null $ValuesToCheck.Remove('ManagedIdentity') | Out-Null + $ValuesToCheck.Remove('Identity') | Out-Null $TestResult = Test-M365DSCParameterState -CurrentValues $CurrentValues ` -Source $($MyInvocation.MyCommand.Source) ` @@ -487,4 +516,3 @@ function Export-TargetResource } Export-ModuleMember -Function *-TargetResource - diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXODataClassification/MSFT_EXODataClassification.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXODataClassification/MSFT_EXODataClassification.psm1 index 620b2c6ee2..6b03e06a7d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXODataClassification/MSFT_EXODataClassification.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXODataClassification/MSFT_EXODataClassification.psm1 @@ -242,19 +242,9 @@ function Set-TargetResource $DataClassificationParams.Remove('CertificatePassword') | Out-Null $DataClassificationParams.Remove('ManagedIdentity') | Out-Null - if (('Present' -eq $Ensure ) -and ($null -eq $DataClassification)) { - Write-Verbose -Message "Creating Data classification policy $($Identity)." - $DataClassificationParams.Remove('Identity') | Out-Null - $DataClassificationParams.Remove('IsDefault') | Out-Null - if (-Not [String]::IsNullOrEmpty($DataClassificationParams.Locale)) - { - $DataClassificationParams.Locale = New-Object system.globalization.cultureinfo($DataClassificationParams.Locale) - } - - New-DataClassification @DataClassificationParams - Write-Verbose -Message 'Data classification policy created successfully.' + Write-Verbose -Message "Data Classification in Exchange Online are now deprecated in favor of Sensitive Information Types in Security and Compliance." } elseif (('Present' -eq $Ensure ) -and ($Null -ne $DataClassification)) { diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCAutoSensitivityLabelRule/MSFT_SCAutoSensitivityLabelRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCAutoSensitivityLabelRule/MSFT_SCAutoSensitivityLabelRule.psm1 index 1f22ae0608..ab4ff4e9be 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCAutoSensitivityLabelRule/MSFT_SCAutoSensitivityLabelRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCAutoSensitivityLabelRule/MSFT_SCAutoSensitivityLabelRule.psm1 @@ -1275,81 +1275,84 @@ function ConvertTo-SCDLPSensitiveInformationStringGroup foreach ($SensitiveInformationHash in $InformationArray) { - $StringContent = "MSFT_SCDLPContainsSensitiveInformation`r`n {`r`n" + $StringContent = "MSFT_SCDLPContainsSensitiveInformation {`r`n" if ($null -ne $InformationArray.Groups) { - $StringContent += " operator = '$($SensitiveInformationHash.operator.Replace("'", "''"))'`r`n" - $StringContent += " Groups = `r`n@(" + $StringContent += " operator = '$($SensitiveInformationHash.operator.Replace("'", "''"))'`r`n" + $StringContent += " Groups = @(`r`n" } foreach ($group in $SensitiveInformationHash.Groups) { - $StringContent += "MSFT_SCDLPContainsSensitiveInformationGroup`r`n {`r`n" - $StringContent += " operator = '$($group.operator.Replace("'", "''"))'`r`n" - $StringContent += " name = '$($group.name.Replace("'", "''"))'`r`n" + $StringContent += " MSFT_SCDLPContainsSensitiveInformationGroup {`r`n" + $StringContent += " operator = '$($group.operator.Replace("'", "''"))'`r`n" + $StringContent += " name = '$($group.name.Replace("'", "''"))'`r`n" if ($null -ne $group.sensitivetypes) { - $StringContent += ' SensitiveInformation = @(' + $StringContent += " SensitiveInformation = @(`r`n" foreach ($sit in $group.sensitivetypes) { - $StringContent += " MSFT_SCDLPSensitiveInformation`r`n {`r`n" - $StringContent += " name = '$($sit.name.Replace("'", "''"))'`r`n" + $StringContent += " MSFT_SCDLPSensitiveInformation {`r`n" + $StringContent += " name = '$($sit.name.Replace("'", "''"))'`r`n" if ($null -ne $sit.id) { - $StringContent += " id = '$($sit.id)'`r`n" + $StringContent += " id = '$($sit.id)'`r`n" } if ($null -ne $sit.maxconfidence) { - $StringContent += " maxconfidence = '$($sit.maxconfidence)'`r`n" + $StringContent += " maxconfidence = '$($sit.maxconfidence)'`r`n" } if ($null -ne $sit.minconfidence) { - $StringContent += " minconfidence = '$($sit.minconfidence)'`r`n" + $StringContent += " minconfidence = '$($sit.minconfidence)'`r`n" } if ($null -ne $sit.classifiertype) { - $StringContent += " classifiertype = '$($sit.classifiertype)'`r`n" + $StringContent += " classifiertype = '$($sit.classifiertype)'`r`n" } if ($null -ne $sit.mincount) { - $StringContent += " mincount = '$($sit.mincount)'`r`n" + $StringContent += " mincount = '$($sit.mincount)'`r`n" } if ($null -ne $sit.maxcount) { - $StringContent += " maxcount = '$($sit.maxcount)'`r`n" + $StringContent += " maxcount = '$($sit.maxcount)'`r`n" } - $StringContent += " }`r`n" + $StringContent += " }`r`n" } - $StringContent += " )}`r`n" + $StringContent += " )`r`n" + $StringContent += " }`r`n" } if ($null -ne $group.labels) { - $StringContent += ' labels = @(' + $StringContent += " labels = @(`r`n" foreach ($label in $group.labels) { - $StringContent += " MSFT_SCDLPLabel`r`n {`r`n" - $StringContent += " name = '$($label.name.Replace("'", "''"))'`r`n" + $StringContent += " MSFT_SCDLPLabel {`r`n" + $StringContent += " name = '$($label.name.Replace("'", "''"))'`r`n" if ($null -ne $label.id) { - $StringContent += " id = '$($label.id)'`r`n" + $StringContent += " id = '$($label.id)'`r`n" } if ($null -ne $label.type) { - $StringContent += " type = '$($label.type)'`r`n" + $StringContent += " type = '$($label.type)'`r`n" } - $StringContent += " }`r`n" + $StringContent += " }`r`n" } - $StringContent += " )}`r`n" + $StringContent += " )`r`n" + $StringContent += " }`r`n" } } - $StringContent += " )}`r`n" + $StringContent += " )`r`n" + $StringContent += " }`r`n" $result += $StringContent } return $result @@ -1365,50 +1368,50 @@ function ConvertTo-SCDLPSensitiveInformationString $InformationArray ) $result = '' - $StringContent = "MSFT_SCDLPContainsSensitiveInformation`r`n {`r`n" + $StringContent = "MSFT_SCDLPContainsSensitiveInformation {`r`n" $StringContent += ' SensitiveInformation = ' $StringContent += "@(`r`n" $result += $StringContent foreach ($SensitiveInformationHash in $InformationArray) { - $StringContent = "MSFT_SCDLPSensitiveInformation`r`n {`r`n" - $StringContent += " name = '$($SensitiveInformationHash.name.Replace("'", "''"))'`r`n" + $StringContent = " MSFT_SCDLPSensitiveInformation`r`n {`r`n" + $StringContent += " name = '$($SensitiveInformationHash.name.Replace("'", "''"))'`r`n" if ($null -ne $SensitiveInformationHash.id) { - $StringContent += " id = '$($SensitiveInformationHash.id)'`r`n" + $StringContent += " id = '$($SensitiveInformationHash.id)'`r`n" } if ($null -ne $SensitiveInformationHash.maxconfidence) { - $StringContent += " maxconfidence = '$($SensitiveInformationHash.maxconfidence)'`r`n" + $StringContent += " maxconfidence = '$($SensitiveInformationHash.maxconfidence)'`r`n" } if ($null -ne $SensitiveInformationHash.minconfidence) { - $StringContent += " minconfidence = '$($SensitiveInformationHash.minconfidence)'`r`n" + $StringContent += " minconfidence = '$($SensitiveInformationHash.minconfidence)'`r`n" } if ($null -ne $SensitiveInformationHash.classifiertype) { - $StringContent += " classifiertype = '$($SensitiveInformationHash.classifiertype)'`r`n" + $StringContent += " classifiertype = '$($SensitiveInformationHash.classifiertype)'`r`n" } if ($null -ne $SensitiveInformationHash.mincount) { - $StringContent += " mincount = '$($SensitiveInformationHash.mincount)'`r`n" + $StringContent += " mincount = '$($SensitiveInformationHash.mincount)'`r`n" } if ($null -ne $SensitiveInformationHash.maxcount) { - $StringContent += " maxcount = '$($SensitiveInformationHash.maxcount)'`r`n" + $StringContent += " maxcount = '$($SensitiveInformationHash.maxcount)'`r`n" } - $StringContent += " }`r`n" + $StringContent += " }`r`n" $result += $StringContent } - $result += ' )' + $result += " )`r`n" $result += " }`r`n" return $result } diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 index a60538c49d..b8dd694459 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 @@ -193,11 +193,9 @@ function Get-TargetResource { $DefaultLinkPermission = $SPOSharingSettings.DefaultLinkPermission } - - return @{ + $results = @{ IsSingleInstance = 'Yes' SharingCapability = $SPOSharingSettings.SharingCapability - MySiteSharingCapability = $MySiteSharingCapability ShowEveryoneClaim = $SPOSharingSettings.ShowEveryoneClaim ShowAllUsersClaim = $SPOSharingSettings.ShowAllUsersClaim ShowEveryoneExceptExternalUsersClaim = $SPOSharingSettings.ShowEveryoneExceptExternalUsersClaim @@ -229,6 +227,12 @@ function Get-TargetResource Managedidentity = $ManagedIdentity.IsPresent Ensure = 'Present' } + + if (-not [System.String]::IsNullOrEmpty($MySiteSharingCapability)) + { + $results.Add('MySiteSharingCapability', $MySiteSharingCapability) + } + return $results } catch { diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppPermissionPolicy/MSFT_TeamsAppPermissionPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppPermissionPolicy/MSFT_TeamsAppPermissionPolicy.psm1 index a80326694c..2b1116f93a 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppPermissionPolicy/MSFT_TeamsAppPermissionPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppPermissionPolicy/MSFT_TeamsAppPermissionPolicy.psm1 @@ -39,7 +39,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -171,7 +171,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -311,7 +311,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -347,7 +347,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppSetupPolicy/MSFT_TeamsAppSetupPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppSetupPolicy/MSFT_TeamsAppSetupPolicy.psm1 index 8f26f01ac4..7d4a44b0b7 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppSetupPolicy/MSFT_TeamsAppSetupPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppSetupPolicy/MSFT_TeamsAppSetupPolicy.psm1 @@ -39,7 +39,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -153,7 +153,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -307,10 +307,11 @@ function Test-TargetResource [Parameter()] [System.Boolean] $AllowSideLoading, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -346,7 +347,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAudioConferencingPolicy/MSFT_TeamsAudioConferencingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAudioConferencingPolicy/MSFT_TeamsAudioConferencingPolicy.psm1 index 733363ea31..28dd0906ff 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAudioConferencingPolicy/MSFT_TeamsAudioConferencingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAudioConferencingPolicy/MSFT_TeamsAudioConferencingPolicy.psm1 @@ -19,7 +19,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -108,7 +108,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -219,7 +219,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -256,7 +256,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallHoldPolicy/MSFT_TeamsCallHoldPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallHoldPolicy/MSFT_TeamsCallHoldPolicy.psm1 index 35a9a80062..8a4ccd202d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallHoldPolicy/MSFT_TeamsCallHoldPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallHoldPolicy/MSFT_TeamsCallHoldPolicy.psm1 @@ -19,7 +19,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -108,7 +108,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -219,7 +219,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -256,7 +256,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallParkPolicy/MSFT_TeamsCallParkPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallParkPolicy/MSFT_TeamsCallParkPolicy.psm1 index cb03861727..aaba733498 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallParkPolicy/MSFT_TeamsCallParkPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallParkPolicy/MSFT_TeamsCallParkPolicy.psm1 @@ -31,7 +31,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -135,7 +135,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -258,7 +258,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 index 896913588e..4a37550baa 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 @@ -31,7 +31,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -144,7 +144,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -267,7 +267,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -304,7 +304,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 index 25f2da7bb7..6e61b8db5e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 @@ -20,7 +20,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -110,7 +110,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -222,7 +222,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -259,7 +259,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallingPolicy/MSFT_TeamsEmergencyCallingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallingPolicy/MSFT_TeamsEmergencyCallingPolicy.psm1 index 8e9f4a2361..b047caaebe 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallingPolicy/MSFT_TeamsEmergencyCallingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallingPolicy/MSFT_TeamsEmergencyCallingPolicy.psm1 @@ -237,7 +237,7 @@ function Set-TargetResource elseif ($Ensure -eq 'Absent' -and $CurrentValues.Ensure -eq 'Present') { Write-Verbose -Message "Removing existing Teams Emergency Calling Policy {$Identity}" - Remove-CsTeamsEmergencyCallingPolicy -Identity $Identity -Confirm:$false + Remove-CsTeamsEmergencyCallingPolicy -Identity $Identity } } diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEnhancedEncryptionPolicy/MSFT_TeamsEnhancedEncryptionPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEnhancedEncryptionPolicy/MSFT_TeamsEnhancedEncryptionPolicy.psm1 index 09e82d9114..48da559d9d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEnhancedEncryptionPolicy/MSFT_TeamsEnhancedEncryptionPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEnhancedEncryptionPolicy/MSFT_TeamsEnhancedEncryptionPolicy.psm1 @@ -23,7 +23,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -117,7 +117,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -232,7 +232,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -269,7 +269,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.psm1 index 3aecdaae93..8ccbb925c6 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.psm1 @@ -22,6 +22,44 @@ function Get-TargetResource [ValidateSet('Everyone', 'EveryoneInCompanyExcludingGuests')] $EventAccessType, + [Parameter()] + [ValidateSet('Enabled', 'Disabled')] + [System.String] + $AllowEmailEditing, + + [Parameter()] + [System.Boolean] + $AllowEventIntegrations, + + [Parameter()] + [ValidateSet('Enabled', 'Disabled')] + [System.String] + $AllowTownhalls, + + [Parameter()] + [ValidateSet('DefaultOnly', 'DefaultAndPredefinedOnly', 'AllQuestions')] + [System.String] + $AllowedQuestionTypesInRegistrationForm, + + [Parameter()] + [ValidateSet('None', 'InviteOnly', 'EveryoneInCompanyIncludingGuests', 'Everyone')] + [System.String] + $AllowedWebinarTypesForRecordingPublish, + + [Parameter()] + [ValidateSet('None', 'InviteOnly', 'EveryoneInCompanyIncludingGuests', 'Everyone')] + [System.String] + $AllowedTownhallTypesForRecordingPublish, + + [Parameter()] + [ValidateSet('Optimized', 'None')] + [System.String] + $TownhallChatExperience, + + [Parameter()] + [System.Boolean] + $UseMicrosoftECDN, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] @@ -75,15 +113,23 @@ function Get-TargetResource } Write-Verbose -Message "Found Teams Events Policy {$Identity}" $result = @{ - Identity = $Identity - Description = $policy.Description - AllowWebinars = $policy.AllowWebinars - EventAccessType = $policy.EventAccessType - Ensure = 'Present' - Credential = $Credential - ApplicationId = $ApplicationId - TenantId = $TenantId - CertificateThumbprint = $CertificateThumbprint + Identity = $Identity + Description = $policy.Description + AllowWebinars = $policy.AllowWebinars + EventAccessType = $policy.EventAccessType + AllowEmailEditing = $policy.AllowEmailEditing + AllowEventIntegrations = $policy.AllowEventIntegrations + AllowTownhalls = $policy.AllowTownhalls + AllowedQuestionTypesInRegistrationForm = $policy.AllowedQuestionTypesInRegistrationForm + AllowedWebinarTypesForRecordingPublish = $policy.AllowedWebinarTypesForRecordingPublish + AllowedTownhallTypesForRecordingPublish = $policy.AllowedTownhallTypesForRecordingPublish + TownhallChatExperience = $policy.TownhallChatExperience + UseMicrosoftECDN = $policy.UseMicrosoftECDN + Ensure = 'Present' + Credential = $Credential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } return $result @@ -123,6 +169,44 @@ function Set-TargetResource [ValidateSet('Everyone', 'EveryoneInCompanyExcludingGuests')] $EventAccessType, + [Parameter()] + [ValidateSet('Enabled', 'Disabled')] + [System.String] + $AllowEmailEditing, + + [Parameter()] + [System.Boolean] + $AllowEventIntegrations, + + [Parameter()] + [ValidateSet('Enabled', 'Disabled')] + [System.String] + $AllowTownhalls, + + [Parameter()] + [ValidateSet('DefaultOnly', 'DefaultAndPredefinedOnly', 'AllQuestions')] + [System.String] + $AllowedQuestionTypesInRegistrationForm, + + [Parameter()] + [ValidateSet('None', 'InviteOnly', 'EveryoneInCompanyIncludingGuests', 'Everyone')] + [System.String] + $AllowedWebinarTypesForRecordingPublish, + + [Parameter()] + [ValidateSet('None', 'InviteOnly', 'EveryoneInCompanyIncludingGuests', 'Everyone')] + [System.String] + $AllowedTownhallTypesForRecordingPublish, + + [Parameter()] + [ValidateSet('Optimized', 'None')] + [System.String] + $TownhallChatExperience, + + [Parameter()] + [System.Boolean] + $UseMicrosoftECDN, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] @@ -212,6 +296,44 @@ function Test-TargetResource [ValidateSet('Everyone', 'EveryoneInCompanyExcludingGuests')] $EventAccessType, + [Parameter()] + [ValidateSet('Enabled', 'Disabled')] + [System.String] + $AllowEmailEditing, + + [Parameter()] + [System.Boolean] + $AllowEventIntegrations, + + [Parameter()] + [ValidateSet('Enabled', 'Disabled')] + [System.String] + $AllowTownhalls, + + [Parameter()] + [ValidateSet('DefaultOnly', 'DefaultAndPredefinedOnly', 'AllQuestions')] + [System.String] + $AllowedQuestionTypesInRegistrationForm, + + [Parameter()] + [ValidateSet('None', 'InviteOnly', 'EveryoneInCompanyIncludingGuests', 'Everyone')] + [System.String] + $AllowedWebinarTypesForRecordingPublish, + + [Parameter()] + [ValidateSet('None', 'InviteOnly', 'EveryoneInCompanyIncludingGuests', 'Everyone')] + [System.String] + $AllowedTownhallTypesForRecordingPublish, + + [Parameter()] + [ValidateSet('Optimized', 'None')] + [System.String] + $TownhallChatExperience, + + [Parameter()] + [System.Boolean] + $UseMicrosoftECDN, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.schema.mof index 68831ce62f..f8d8aea02d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.schema.mof @@ -3,9 +3,17 @@ class MSFT_TeamsEventsPolicy : OMI_BaseResource { [Key, Description("Identity of the Teams Events Policy.")] String Identity; [Write, Description("Description of the Teams Events Policy.")] String Description; + [Write, Description("This setting governs if a user is allowed to edit the communication emails in Teams Town Hall or Teams Webinar events."), ValueMap{"Disabled","Enabled"}, Values{"Disabled","Enabled"}] String AllowEmailEditing; + [Write, Description("This setting governs access to the integrations tab in the event creation workflow.")] Boolean AllowEventIntegrations; [Write, Description("Determines if webinars are allowed by the policy or not."), ValueMap{"Disabled","Enabled"}, Values{"Disabled","Enabled"}] String AllowWebinars; + [Write, Description("This setting governs if a user can create town halls using Teams Events."), ValueMap{"Disabled","Enabled"}, Values{"Disabled","Enabled"}] String AllowTownhalls; + [Write, Description("This setting governs which users in a tenant can add which registration form questions to an event registration page for attendees to answer when registering for the event."), ValueMap{"DefaultOnly","DefaultAndPredefinedOnly","AllQuestions"}, Values{"DefaultOnly","DefaultAndPredefinedOnly","AllQuestions"}] String AllowedQuestionTypesInRegistrationForm; + [Write, Description("This setting describes how IT admins can control which types of Town Hall attendees can have their recordings published."), ValueMap{"None","InviteOnly","EveryoneInCompanyIncludingGuests","Everyone"}, Values{"None","InviteOnly","EveryoneInCompanyIncludingGuests","Everyone"}] String AllowedTownhallTypesForRecordingPublish; + [Write, Description("This setting describes how IT admins can control which types of webinar attendees can have their recordings published."), ValueMap{"None","InviteOnly","EveryoneInCompanyIncludingGuests","Everyone"}, Values{"None","InviteOnly","EveryoneInCompanyIncludingGuests","Everyone"}] String AllowedWebinarTypesForRecordingPublish; [Write, Description("Defines who is allowed to join the event."), ValueMap{"Everyone", "EveryoneInCompanyExcludingGuests"}, Values{"Everyone", "EveryoneInCompanyExcludingGuests"}] String EventAccessType; [Write, Description("Present ensures the policy exists, absent ensures it is removed."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; + [Write, Description("This setting governs whether the user can enable the Comment Stream chat experience for Town Halls."), ValueMap{"Optimized","None"}, Values{"Optimized","None"}] String TownhallChatExperience; + [Write, Description("This setting governs whether the global admin disables this property and prevents the organizers from creating town halls that use Microsoft eCDN even though they have been assigned a Teams Premium license.")] Boolean UseMicrosoftECDN; [Write, Description("Credentials of the Teams Global Admin."), EmbeddedInstance("MSFT_Credential")] string Credential; [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; [Write, Description("Name of the Azure Active Directory tenant used for authentication. Format contoso.onmicrosoft.com")] String TenantId; diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 index 9747cf0fba..e902ca70c9 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 @@ -36,7 +36,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -146,7 +146,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -274,7 +274,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -311,7 +311,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFilesPolicy/MSFT_TeamsFilesPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFilesPolicy/MSFT_TeamsFilesPolicy.psm1 index 9a5471c6f3..62af2c60f4 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFilesPolicy/MSFT_TeamsFilesPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFilesPolicy/MSFT_TeamsFilesPolicy.psm1 @@ -262,7 +262,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1 index aeeecc7721..3e8ad626f1 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1 @@ -66,39 +66,44 @@ function Get-TargetResource try { - if (-not [System.String]::IsNullOrEmpty($GroupId)) + Write-Verbose -Message "Getting Group with Id {$GroupId}" + $Group = Find-CsGroup -SearchQuery $GroupId -ExactMatchOnly $true -ErrorAction SilentlyContinue + + if ($null -eq $Group) { - Write-Verbose -Message "Getting GroupPolicyAssignment for {$GroupId}" - $group = Find-CsGroup -SearchQuery $GroupId -ErrorAction SilentlyContinue - if ($group.Length -gt 1) + Write-Verbose -Message "Could not find Group with Id {$GroupId}, searching with DisplayName {$GroupDisplayName}" + $Group = Find-CsGroup -SearchQuery $GroupDisplayName -ExactMatchOnly $true -ErrorAction SilentlyContinue + + if ($null -eq $Group) { - Write-Verbose -Message "Found $($group.Length) groups with the id {$GroupId}" - $Group = $Group | Where-Object { $_.DisplayName -eq $GroupDisplayName } + Write-Verbose -Message "Could not find Group with DisplayName {$GroupDisplayName}" + return $nullReturn } - } - else - { - Write-Verbose -Message "Getting GroupPolicyAssignment for {$GroupDisplayName}" - $Group = Find-CsGroup -SearchQuery $GroupDisplayName -ErrorAction SilentlyContinue - if ($Group.Length -gt 1) + + if ($Group -and $Group.Count -gt 1) { - Write-Verbose -Message "Found $($group.Length) groups with the name $GroupDisplayName" - $Group = $Group | Where-Object { $_.DisplayName -eq $GroupDisplayName } + Write-Verbose -Message "Found $($Group.Count) groups with DisplayName {$GroupDisplayName}" + $Group = $Group | Where-Object -FilterScript { $_.DisplayName -eq $GroupDisplayName } + if ($Group -and $Group.Count -gt 1) + { + Write-Verbose -Message "Still found $($Group.Count) groups with DisplayName {$GroupDisplayName}" + return $nullReturn + } } } - if ($null -eq $Group) - { - Write-Verbose -Message "Group not found for $GroupDisplayName" - return $nullReturn - } + + Write-Verbose -Message "Getting GroupPolicyAssignment with PolicyType {$PolicyType} for Group {$($Group.DisplayName)}" $GroupPolicyAssignment = Get-CsGroupPolicyAssignment -GroupId $Group.Id -PolicyType $PolicyType -ErrorAction SilentlyContinue if ($null -eq $GroupPolicyAssignment) { - Write-Verbose -Message "GroupPolicyAssignment not found for $GroupDisplayName" + Write-Verbose -Message "GroupPolicyAssignment not found for Group {$GroupDisplayName}" $nullReturn.GroupId = $Group.Id return $nullReturn } - Write-Verbose -Message "Found GroupPolicyAssignment $($Group.Displayname) with PolicyType:$($GroupPolicyAssignment.PolicyType) and Policy Name:$($GroupPolicyAssignment.PolicyName)" + + $Message = "Found GroupPolicyAssignment with PolicyType {$($GroupPolicyAssignment.PolicyType)}, " + ` + "PolicyName {$($GroupPolicyAssignment.PolicyName)} and Priority {$($GroupPolicyAssignment.Priority)} for Group {$($Group.Displayname)}" + Write-Verbose -Message $Message return @{ GroupId = $Group.Id GroupDisplayName = $Group.Displayname diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 index 72d842411e..c2061ace70 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 @@ -43,7 +43,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -161,7 +161,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -296,7 +296,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -333,7 +333,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastPolicy/MSFT_TeamsMeetingBroadcastPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastPolicy/MSFT_TeamsMeetingBroadcastPolicy.psm1 index bc67268439..8210eeb73e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastPolicy/MSFT_TeamsMeetingBroadcastPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastPolicy/MSFT_TeamsMeetingBroadcastPolicy.psm1 @@ -200,7 +200,7 @@ function Set-TargetResource } elseif ($Ensure -eq 'Absent' -and $currentValues.Ensure -eq 'Present') { - Remove-CsTeamsMeetingBroadcastPolicy -Identity $Identity -Confirm:$false + Remove-CsTeamsMeetingBroadcastPolicy -Identity $Identity } } diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 index 343e946dda..30ff10393e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 @@ -24,12 +24,13 @@ function Get-TargetResource [Parameter()] [System.String] + [ValidateSet('Teams', 'Native', 'UserOverride')] $MobileDialerPreference, [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -125,12 +126,13 @@ function Set-TargetResource [Parameter()] [System.String] + [ValidateSet('Teams', 'Native', 'UserOverride')] $MobileDialerPreference, [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -246,12 +248,13 @@ function Test-TargetResource [Parameter()] [System.String] + [ValidateSet('Teams', 'Native', 'UserOverride')] $MobileDialerPreference, [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -288,7 +291,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.schema.mof index 75a9ae245a..30bf8f182c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.schema.mof @@ -5,7 +5,7 @@ class MSFT_TeamsMobilityPolicy : OMI_BaseResource [Write, Description("Enables administrators to provide explanatory text about the policy. For example, the Description might indicate the users the policy should be assigned to.")] String Description; [Write, Description("When set to WifiOnly, prohibits the user from making and receiving calls or joining meetings using VoIP calls on the mobile device while on a cellular data connection. Possible values are: WifiOnly, AllNetworks."), ValueMap{"WifiOnly","AllNetworks"}, Values{"WifiOnly","AllNetworks"}] String IPAudioMobileMode; [Write, Description("When set to WifiOnly, prohibits the user from making and receiving video calls or enabling video in meetings using VoIP calls on the mobile device while on a cellular data connection. Possible values are: WifiOnly, AllNetworks."), ValueMap{"WifiOnly","AllNetworks"}, Values{"WifiOnly","AllNetworks"}] String IPVideoMobileMode; - [Write, Description("N/A")] String MobileDialerPreference; + [Write, Description("Determines the mobile dialer preference, possible values are: Teams, Native, UserOverride."), ValueMap{"Teams","Native","UserOverride"}, Values{"Teams","Native","UserOverride"}] String MobileDialerPreference; [Write, Description("Present ensures the instance exists, absent ensures it is removed."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; [Write, Description("Credentials of the workload's Admin"), EmbeddedInstance("MSFT_Credential")] string Credential; [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsNetworkRoamingPolicy/MSFT_TeamsNetworkRoamingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsNetworkRoamingPolicy/MSFT_TeamsNetworkRoamingPolicy.psm1 index 429d385483..abe450cad1 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsNetworkRoamingPolicy/MSFT_TeamsNetworkRoamingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsNetworkRoamingPolicy/MSFT_TeamsNetworkRoamingPolicy.psm1 @@ -23,7 +23,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -117,7 +117,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -232,7 +232,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -269,7 +269,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 index 4f05559964..bdab72fdf6 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 @@ -42,7 +42,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -160,7 +160,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -300,7 +300,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -338,7 +338,7 @@ function Test-TargetResource $ValuesToCheck.Remove('Identity') | Out-Null $ValuesToCheck.Remove('EnableShiftPresence') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkRegion/MSFT_TeamsTenantNetworkRegion.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkRegion/MSFT_TeamsTenantNetworkRegion.psm1 index bf582ea221..582fa43630 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkRegion/MSFT_TeamsTenantNetworkRegion.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkRegion/MSFT_TeamsTenantNetworkRegion.psm1 @@ -19,7 +19,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -108,7 +108,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -219,7 +219,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -256,7 +256,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSite/MSFT_TeamsTenantNetworkSite.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSite/MSFT_TeamsTenantNetworkSite.psm1 index 9452d501e5..68c4d63b7b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSite/MSFT_TeamsTenantNetworkSite.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSite/MSFT_TeamsTenantNetworkSite.psm1 @@ -43,7 +43,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -162,7 +162,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -297,7 +297,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -334,7 +334,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSubnet/MSFT_TeamsTenantNetworkSubnet.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSubnet/MSFT_TeamsTenantNetworkSubnet.psm1 index 15b7746e24..e662126d4d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSubnet/MSFT_TeamsTenantNetworkSubnet.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSubnet/MSFT_TeamsTenantNetworkSubnet.psm1 @@ -23,7 +23,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -117,7 +117,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -232,7 +232,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -269,7 +269,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantTrustedIPAddress/MSFT_TeamsTenantTrustedIPAddress.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantTrustedIPAddress/MSFT_TeamsTenantTrustedIPAddress.psm1 index 047bfbad73..a2782d3c9e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantTrustedIPAddress/MSFT_TeamsTenantTrustedIPAddress.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantTrustedIPAddress/MSFT_TeamsTenantTrustedIPAddress.psm1 @@ -19,7 +19,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -110,7 +110,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -221,7 +221,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -258,7 +258,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTranslationRule/MSFT_TeamsTranslationRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTranslationRule/MSFT_TeamsTranslationRule.psm1 index f6757f346a..68ddebee03 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTranslationRule/MSFT_TeamsTranslationRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTranslationRule/MSFT_TeamsTranslationRule.psm1 @@ -23,7 +23,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -117,7 +117,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -232,7 +232,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -269,7 +269,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUnassignedNumberTreatment/MSFT_TeamsUnassignedNumberTreatment.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUnassignedNumberTreatment/MSFT_TeamsUnassignedNumberTreatment.psm1 index 2fe128ea70..2f1287e0b7 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUnassignedNumberTreatment/MSFT_TeamsUnassignedNumberTreatment.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUnassignedNumberTreatment/MSFT_TeamsUnassignedNumberTreatment.psm1 @@ -32,7 +32,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -137,7 +137,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -261,7 +261,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -298,7 +298,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 index 79535d140b..41e02cfed0 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 @@ -19,7 +19,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -108,7 +108,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -219,7 +219,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -256,7 +256,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 index f43356e5b7..d205cf93fd 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 @@ -39,7 +39,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -153,7 +153,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -284,7 +284,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -321,7 +321,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 b/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 index 7da937491b..ed504505f0 100644 --- a/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 +++ b/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 @@ -10,71 +10,71 @@ }, @{ ModuleName = 'Microsoft.Graph.Applications' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Authentication' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.DeviceManagement' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.Devices.CorporateManagement' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.DeviceManagement.Administration' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.DeviceManagement.Enrollment' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.Identity.DirectoryManagement' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.Identity.Governance' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.Identity.SignIns' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.Reports' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.Teams' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.DeviceManagement.Administration' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.DirectoryObjects' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Groups' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Planner' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Users' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Users.Actions' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.PowerApps.Administration.PowerShell' @@ -82,7 +82,7 @@ }, @{ ModuleName = 'MicrosoftTeams' - RequiredVersion = '5.8.0' + RequiredVersion = '5.9.0' }, @{ ModuleName = "MSCloudLoginAssistant" diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/1-Create.ps1 deleted file mode 100644 index 4154df76fb..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/1-Create.ps1 +++ /dev/null @@ -1,66 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyAuthenticator "AADAuthenticationMethodPolicyAuthenticator-MicrosoftAuthenticator" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyAuthenticatorExcludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - FeatureSettings = MSFT_MicrosoftGraphmicrosoftAuthenticatorFeatureSettings{ - DisplayLocationInformationRequiredState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - CompanionAppAllowedState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - DisplayAppInformationRequiredState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - }; - Id = "MicrosoftAuthenticator"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyAuthenticatorIncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyAuthenticatorIncludeTarget{ - Id = 'Northwind Traders' - TargetType = 'group' - } - ); - IsSoftwareOathEnabled = $False; - State = "enabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/1-Create.ps1 deleted file mode 100644 index 4fd4b2ef08..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/1-Create.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyEmail "AADAuthenticationMethodPolicyEmail-Email" - { - AllowExternalIdToUseEmailOtp = "enabled"; - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyEmailExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - ); - Id = "Email"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyEmailIncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyEmailIncludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/2-Update.ps1 index da4c2f15b5..889bee8111 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/2-Update.ps1 @@ -37,7 +37,7 @@ Configuration Example TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/3-Remove.ps1 deleted file mode 100644 index 6ca6f1913c..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/3-Remove.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyEmail "AADAuthenticationMethodPolicyEmail-Email" - { - Ensure = "Absent"; - Id = "Email"; - State = "disabled"; # Updated Property - Credential = $credsCredential; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/1-Create.ps1 deleted file mode 100644 index 5f5610df96..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/1-Create.ps1 +++ /dev/null @@ -1,49 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyFido2 "AADAuthenticationMethodPolicyFido2-Fido2" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - ); - Id = "Fido2"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyFido2IncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsAttestationEnforced = $False; - IsSelfServiceRegistrationAllowed = $True; - KeyRestrictions = MSFT_MicrosoftGraphfido2KeyRestrictions{ - IsEnforced = $False - EnforcementType = 'block' - AaGuids = @() - }; - State = "enabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/2-Update.ps1 index 64b188cf46..cce861359c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/2-Update.ps1 @@ -43,7 +43,7 @@ Configuration Example EnforcementType = 'block' AaGuids = @() }; - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/1-Create.ps1 deleted file mode 100644 index 22f4f8c8a5..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/1-Create.ps1 +++ /dev/null @@ -1,38 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicySms "AADAuthenticationMethodPolicySms-Sms" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicySmsExcludeTarget{ - Id = 'All Employees' - TargetType = 'group' - } - ); - Id = "Sms"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicySmsIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - State = "enabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/2-Update.ps1 index e0f3f6c9a8..7111b8b114 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/2-Update.ps1 @@ -32,7 +32,7 @@ Configuration Example TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/1-Create.ps1 deleted file mode 100644 index 0efd4c1697..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/1-Create.ps1 +++ /dev/null @@ -1,42 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicySoftware "AADAuthenticationMethodPolicySoftware-SoftwareOath" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - ); - Id = "SoftwareOath"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicySoftwareIncludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/2-Update.ps1 index 9223768e7e..808ff41034 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/2-Update.ps1 @@ -36,7 +36,7 @@ Configuration Example TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/1-Create.ps1 deleted file mode 100644 index 383f603274..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/1-Create.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyTemporary "AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass" - { - Credential = $Credscredential; - DefaultLength = 8; - DefaultLifetimeInMinutes = 60; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyTemporaryExcludeTarget{ - Id = 'All Company' - TargetType = 'group' - } - ); - Id = "TemporaryAccessPass"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyTemporaryIncludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - ); - IsUsableOnce = $False; - MaximumLifetimeInMinutes = 480; - MinimumLifetimeInMinutes = 60; - State = "enabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/1-Create.ps1 deleted file mode 100644 index 4a86e634df..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/1-Create.ps1 +++ /dev/null @@ -1,33 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyVoice "AADAuthenticationMethodPolicyVoice-Voice" - { - Credential = $Credscredential; - Ensure = "Present"; - Id = "Voice"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyVoiceIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsOfficePhoneAllowed = $False; - State = "disabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 deleted file mode 100644 index c895589eb3..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 +++ /dev/null @@ -1,33 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyVoice "AADAuthenticationMethodPolicyVoice-Voice" - { - Credential = $Credscredential; - Ensure = "Present"; - Id = "Voice"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyVoiceIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsOfficePhoneAllowed = $True; # Updated Property - State = "disabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/1-Create.ps1 deleted file mode 100644 index 9e05e83498..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/1-Create.ps1 +++ /dev/null @@ -1,59 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyX509 "AADAuthenticationMethodPolicyX509-X509Certificate" - { - AuthenticationModeConfiguration = MSFT_MicrosoftGraphx509CertificateAuthenticationModeConfiguration{ - X509CertificateAuthenticationDefaultMode = 'x509CertificateSingleFactor' - Rules = @(@()) - }; - CertificateUserBindings = @( - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 1 - UserProperty = 'userPrincipalName' - X509CertificateField = 'PrincipalName' - } - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 2 - UserProperty = 'userPrincipalName' - X509CertificateField = 'RFC822Name' - } - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 3 - UserProperty = 'certificateUserIds' - X509CertificateField = 'SubjectKeyIdentifier' - } - ); - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyX509ExcludeTarget{ - Id = 'Sales Team' - TargetType = 'group' - } - ); - Id = "X509Certificate"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyX509IncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 index 644bff924b..cdd98d0524 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 @@ -15,12 +15,10 @@ Configuration Example node localhost { - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - CloudAppSecurityIsEnabled = $False; Credential = $Credscredential; DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; @@ -30,7 +28,6 @@ Configuration Example GrantControlOperator = "OR"; IncludeApplications = @("All"); IncludeRoles = @("Attack Payload Author"); - PersistentBrowserIsEnabled = $False; SignInFrequencyInterval = "timeBased"; SignInFrequencyIsEnabled = $True; SignInFrequencyType = "hours"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 index 6693440a4a..b484a00998 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 @@ -15,12 +15,10 @@ Configuration Example node localhost { - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - CloudAppSecurityIsEnabled = $False; Credential = $Credscredential; DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; @@ -30,7 +28,6 @@ Configuration Example GrantControlOperator = "OR"; IncludeApplications = @("All"); IncludeRoles = @("Attack Payload Author"); - PersistentBrowserIsEnabled = $False; SignInFrequencyInterval = "timeBased"; SignInFrequencyIsEnabled = $True; SignInFrequencyType = "hours"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/3-Remove.ps1 index 667028b7bb..b1e7893a92 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/3-Remove.ps1 @@ -15,9 +15,9 @@ Configuration Example node localhost { - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - DisplayName = 'Allin-example' + DisplayName = 'Example CAP' Ensure = 'Absent' Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicy/3-Remove.ps1 deleted file mode 100644 index f8c66bb0c1..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicy/3-Remove.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADCrossTenantAccessPolicy "AADCrossTenantAccessPolicy" - { - AllowedCloudEndpoints = @("microsoftonline.us"); - Credential = $Credscredential; - DisplayName = "MyXTAPPolicy"; - Ensure = "Absent"; - IsSingleInstance = "Yes"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/3-Remove.ps1 index a71c4849f0..3a8a14b1b3 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/3-Remove.ps1 @@ -16,7 +16,7 @@ Configuration Example { AADEntitlementManagementAccessPackage 'myAccessPackage' { - DisplayName = 'General' + DisplayName = 'Integration Package' Ensure = 'Absent' Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 index 17397660a0..41f8825460 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 @@ -24,7 +24,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 index 0a2a11f894..7862017a86 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 @@ -23,7 +23,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 new file mode 100644 index 0000000000..7c28c8da3a --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOAcceptedDomain 'O365DSCDomain' + { + Identity = $Domain + DomainType = "Authoritative" + OutboundOnly = $false + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 new file mode 100644 index 0000000000..189b0d02d1 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAcceptedDomain 'O365DSCDomain' + { + Identity = $Domain + DomainType = "Authoritative" + OutboundOnly = $true # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-ConfigureAcceptedDomain.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 similarity index 73% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-ConfigureAcceptedDomain.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 index 6e4c8efad3..e255383bdd 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-ConfigureAcceptedDomain.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 @@ -16,10 +16,10 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'contoso.com' - DomainType = "Authoritative" - Ensure = "Present" - Credential = $Credscredential + Identity = $Domain + DomainType = "Authoritative" + Ensure = "Absent" + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-ConfigureActiveSyncDeviceAccessRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-ConfigureActiveSyncDeviceAccessRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-Create.ps1 index 6821be1b73..51c7077886 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-ConfigureActiveSyncDeviceAccessRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-Create.ps1 @@ -19,7 +19,7 @@ Configuration Example { Identity = "ContosoPhone(DeviceOS)" Characteristic = "DeviceOS" - QueryString = "iOS 6.1 10B145" + QueryString = "iOS 6.1 10B146" AccessLevel = "Allow" Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/2-Update.ps1 new file mode 100644 index 0000000000..662f870958 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOActiveSyncDeviceAccessRule 'ConfigureActiveSyncDeviceAccessRule' + { + Identity = "ContosoPhone(DeviceOS)" + Characteristic = "DeviceModel" # Updated Property + QueryString = "iOS 6.1 10B145" + AccessLevel = "Allow" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/3-Remove.ps1 new file mode 100644 index 0000000000..662f870958 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/3-Remove.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOActiveSyncDeviceAccessRule 'ConfigureActiveSyncDeviceAccessRule' + { + Identity = "ContosoPhone(DeviceOS)" + Characteristic = "DeviceModel" # Updated Property + QueryString = "iOS 6.1 10B145" + AccessLevel = "Allow" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-ConfigureAddressBookPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 similarity index 67% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-ConfigureAddressBookPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 index 909eabd2df..976c4867af 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-ConfigureAddressBookPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 @@ -18,10 +18,10 @@ Configuration Example EXOAddressBookPolicy 'ConfigureAddressBookPolicy' { Name = "All Fabrikam ABP" - AddressLists = "\All Fabrikam","\All Fabrikam Mailboxes","\All Fabrikam DLs","\All Fabrikam Contacts" - RoomList = "\All Fabrikam-Rooms" - OfflineAddressBook = "\Fabrikam-All-OAB" - GlobalAddressList = "\All Fabrikam" + AddressLists = "\All Distribution Lists" + RoomList = "\All Rooms" + OfflineAddressBook = "\Default Offline Address Book" + GlobalAddressList = "\Default Global Address List" Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 new file mode 100644 index 0000000000..894b0a6913 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressBookPolicy 'ConfigureAddressBookPolicy' + { + Name = "All Fabrikam ABP" + AddressLists = "\All Users" + RoomList = "\All Rooms" + OfflineAddressBook = "\Default Offline Address Book" + GlobalAddressList = "\Default Global Address List" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..abac6145f0 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressBookPolicy 'ConfigureAddressBookPolicy' + { + Name = "All Fabrikam ABP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/1-ConfigureAddressList.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/1-ConfigureAddressList.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/2-Update.ps1 new file mode 100644 index 0000000000..7c3a151850 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressList 'HRUsersAddressList' + { + Name = "HR Users" + ConditionalCompany = "Contoso" + ConditionalDepartment = "HR2" # Updated Property + ConditionalStateOrProvince = "US" + IncludedRecipients = "AllRecipients" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/3-Remove.ps1 new file mode 100644 index 0000000000..f8e758938b --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressList 'HRUsersAddressList' + { + Name = "HR Users" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/1-ConfigureAntiPhishPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/1-ConfigureAntiPhishPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/2-Update.ps1 new file mode 100644 index 0000000000..7c335a878f --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/2-Update.ps1 @@ -0,0 +1,43 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishPolicy 'ConfigureAntiphishPolicy' + { + Identity = "Our Rule" + MakeDefault = $null + PhishThresholdLevel = 2 # Updated Property + EnableTargetedDomainsProtection = $null + Enabled = $null + TargetedDomainsToProtect = $null + EnableSimilarUsersSafetyTips = $null + ExcludedDomains = $null + TargetedDomainActionRecipients = $null + EnableMailboxIntelligence = $null + EnableSimilarDomainsSafetyTips = $null + AdminDisplayName = "" + AuthenticationFailAction = "MoveToJmf" + TargetedUserProtectionAction = "NoAction" + TargetedUsersToProtect = $null + EnableTargetedUserProtection = $null + ExcludedSenders = $null + EnableOrganizationDomainsProtection = $null + EnableUnusualCharactersSafetyTips = $null + TargetedUserActionRecipients = $null + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..7c335a878f --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/3-Remove.ps1 @@ -0,0 +1,43 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishPolicy 'ConfigureAntiphishPolicy' + { + Identity = "Our Rule" + MakeDefault = $null + PhishThresholdLevel = 2 # Updated Property + EnableTargetedDomainsProtection = $null + Enabled = $null + TargetedDomainsToProtect = $null + EnableSimilarUsersSafetyTips = $null + ExcludedDomains = $null + TargetedDomainActionRecipients = $null + EnableMailboxIntelligence = $null + EnableSimilarDomainsSafetyTips = $null + AdminDisplayName = "" + AuthenticationFailAction = "MoveToJmf" + TargetedUserProtectionAction = "NoAction" + TargetedUsersToProtect = $null + EnableTargetedUserProtection = $null + ExcludedSenders = $null + EnableOrganizationDomainsProtection = $null + EnableUnusualCharactersSafetyTips = $null + TargetedUserActionRecipients = $null + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-ConfigureAntiPhishRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 similarity index 88% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-ConfigureAntiPhishRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 index 37d4883a0d..e2f6aeeba4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-ConfigureAntiPhishRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 @@ -12,6 +12,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAntiPhishRule 'ConfigureAntiPhishRule' @@ -25,8 +26,7 @@ Configuration Example AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True - SentToMemberOf = @("msteams_bb15d4@contoso.onmicrosoft.com") - Priority = 1 + SentToMemberOf = @("executives@$Domain") Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 new file mode 100644 index 0000000000..210bb04776 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 @@ -0,0 +1,34 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOAntiPhishRule 'ConfigureAntiPhishRule' + { + Identity = "Test Rule" + ExceptIfSentToMemberOf = $null + ExceptIfSentTo = $null + SentTo = $null + ExceptIfRecipientDomainIs = $null + Comments = "This is an updated comment." # Updated Property + AntiPhishPolicy = "Our Rule" + RecipientDomainIs = $null + Enabled = $True + SentToMemberOf = @("executives@$Domain") + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/3-Remove.ps1 new file mode 100644 index 0000000000..24f0dc0aa5 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishRule 'ConfigureAntiPhishRule' + { + Identity = "Test Rule" + AntiPhishPolicy = "Our Rule" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-ConfigureApplicationAccessPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 similarity index 72% rename from Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-ConfigureApplicationAccessPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 index a89163017b..b7008e86fb 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-ConfigureApplicationAccessPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 @@ -13,14 +13,15 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' { - Identity = "Global" + Identity = "Integration Policy" AccessRight = "DenyAccess" - AppID = "3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93" - PolicyScopeGroupId = "Engineering Staff" + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' + PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" Description = "Engineering Group Policy" Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 new file mode 100644 index 0000000000..f961e93505 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 @@ -0,0 +1,30 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' + { + Identity = "Integration Policy" + AccessRight = "DenyAccess" + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' + PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" + Description = "Engineering Group Policy Updated" # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..cc0936181d --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' + { + Identity = "Integration Policy" + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAtpPolicyForO365/1-ConfigureAtpPolicyForO365.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAtpPolicyForO365/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAtpPolicyForO365/1-ConfigureAtpPolicyForO365.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAtpPolicyForO365/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/1-ConfigureAuthenticationPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/1-ConfigureAuthenticationPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/2-Update.ps1 new file mode 100644 index 0000000000..c68b7a41be --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/2-Update.ps1 @@ -0,0 +1,36 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicy 'ConfigureAuthenticationPolicy' + { + Identity = "Block Basic Auth" + AllowBasicAuthActiveSync = $False + AllowBasicAuthAutodiscover = $False + AllowBasicAuthImap = $False + AllowBasicAuthMapi = $True # Updated Property + AllowBasicAuthOfflineAddressBook = $False + AllowBasicAuthOutlookService = $False + AllowBasicAuthPop = $False + AllowBasicAuthPowerShell = $False + AllowBasicAuthReportingWebServices = $False + AllowBasicAuthRpc = $False + AllowBasicAuthSmtp = $False + AllowBasicAuthWebServices = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..c68b7a41be --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/3-Remove.ps1 @@ -0,0 +1,36 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicy 'ConfigureAuthenticationPolicy' + { + Identity = "Block Basic Auth" + AllowBasicAuthActiveSync = $False + AllowBasicAuthAutodiscover = $False + AllowBasicAuthImap = $False + AllowBasicAuthMapi = $True # Updated Property + AllowBasicAuthOfflineAddressBook = $False + AllowBasicAuthOutlookService = $False + AllowBasicAuthPop = $False + AllowBasicAuthPowerShell = $False + AllowBasicAuthReportingWebServices = $False + AllowBasicAuthRpc = $False + AllowBasicAuthSmtp = $False + AllowBasicAuthWebServices = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 new file mode 100644 index 0000000000..0fb2f2f613 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 @@ -0,0 +1,20 @@ +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' + { + UserName = "AdeleV" + AuthenticationPolicyName = "Block Basic Auth" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 new file mode 100644 index 0000000000..878bf3ebe1 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 @@ -0,0 +1,21 @@ +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' + { + UserName = "AdeleV" + AuthenticationPolicyName = "Test Policy" # Updaqted Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-AssignAuthenticationPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 similarity index 66% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-AssignAuthenticationPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 index 0cc2ef79c4..becf7194b5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-AssignAuthenticationPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 @@ -3,7 +3,7 @@ Configuration Example param( [Parameter(Mandatory = $true)] [PSCredential] - $EXOAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC @@ -11,10 +11,10 @@ Configuration Example { EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' { - UserName = "John.Smith" + UserName = "AdeleV" AuthenticationPolicyName = "Test Policy" - Ensure = "Present" - Credential = $EXOAdmin + Ensure = "Absent" + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/1-ConfigureAvailabilityAddressSpace.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/1-ConfigureAvailabilityAddressSpace.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/2-Update.ps1 new file mode 100644 index 0000000000..1dcd3fef7a --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' + { + Identity = 'Contoso.com' + AccessMethod = 'OrgWideFBBasic' # Updated Property + ForestName = 'example.contoso.com' + TargetAutodiscoverEpr = 'https://contoso.com/autodiscover/autodiscover.xml' + Ensure = 'Present' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/3-Remove.ps1 new file mode 100644 index 0000000000..7783b26831 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' + { + Identity = 'Contoso.com' + Ensure = 'Absent' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-ConfigureAvailabilityConfig.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-Create.ps1 similarity index 83% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-ConfigureAvailabilityConfig.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-Create.ps1 index 67e8438f81..7c5ab235ba 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-ConfigureAvailabilityConfig.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-Create.ps1 @@ -13,11 +13,12 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAvailabilityConfig 'ConfigureAvailabilityConfig' { - OrgWideAccount = "admin@contoso.onmicrosoft.com" + OrgWideAccount = "adelev@$Domain" Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/2-Update.ps1 new file mode 100644 index 0000000000..fb9414d92c --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/2-Update.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOAvailabilityConfig 'ConfigureAvailabilityConfig' + { + OrgWideAccount = "alexW@$Domain" # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/3-Remove.ps1 new file mode 100644 index 0000000000..395c40d257 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOAvailabilityConfig 'ConfigureAvailabilityConfig' + { + OrgWideAccount = "alexW@$Domain" # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/1-ConfigureCASMailboxPlan.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/2-Update.ps1 similarity index 85% rename from Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/1-ConfigureCASMailboxPlan.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/2-Update.ps1 index 6d124c104e..349cd529f1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/1-ConfigureCASMailboxPlan.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/2-Update.ps1 @@ -18,8 +18,8 @@ Configuration Example { ActiveSyncEnabled = $True OwaMailboxPolicy = "OwaMailboxPolicy-Default" - PopEnabled = $True - Identity = $CASIdentity + PopEnabled = $False # Updated Property + Identity = 'ExchangeOnlineEnterprise' ImapEnabled = $True Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/1-ConfigureCASMailboxSettings.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/2-Update.ps1 similarity index 96% rename from Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/1-ConfigureCASMailboxSettings.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/2-Update.ps1 index 7e76bf9a67..910c0a15a4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/1-ConfigureCASMailboxSettings.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/2-Update.ps1 @@ -26,7 +26,7 @@ Configuration Example ActiveSyncSuppressReadReceipt = $False EwsEnabled = $True Identity = 'AdeleV' - ImapEnabled = $False + ImapEnabled = $True # Updated Property ImapForceICalForCalendarRetrievalOption = $False ImapMessagesRetrievalMimeFormat = 'BestBodyFormat' ImapSuppressReadReceipt = $False diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/1-ConfigureCalendarProcessing.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 similarity index 90% rename from Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/1-ConfigureCalendarProcessing.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 index 8dd79a6a6e..84ae10d81a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/1-ConfigureCalendarProcessing.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 @@ -13,13 +13,14 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOCalendarProcessing "CalendarProcessing" { AddAdditionalResponse = $False; AddNewRequestsTentatively = $True; - AddOrganizerToSubject = $True; + AddOrganizerToSubject = $False; # Updated Property AllBookInPolicy = $True; AllowConflicts = $False; AllowRecurringMeetings = $True; @@ -41,7 +42,7 @@ Configuration Example EnforceSchedulingHorizon = $True; Ensure = "Present"; ForwardRequestsToDelegates = $True; - Identity = "John.Smith"; + Identity = "AdeleV"; MaximumConflictInstances = 0; MaximumDurationInMinutes = 1440; MinimumDurationInMinutes = 0; @@ -52,7 +53,7 @@ Configuration Example RemoveForwardedMeetingNotifications = $False; RemoveOldMeetingMessages = $False; RemovePrivateProperty = $True; - RequestInPolicy = @("Bob.Houle@$OrganizationName"); + RequestInPolicy = @("AlexW@$Domain"); ResourceDelegates = @(); ScheduleOnlyDuringWorkHours = $False; TentativePendingApproval = $True; diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-ConfigureClientAccessRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-Create.ps1 similarity index 94% rename from Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-ConfigureClientAccessRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-Create.ps1 index 796c7e53c4..5eb5199ae4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-ConfigureClientAccessRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-Create.ps1 @@ -30,7 +30,7 @@ Configuration Example ExceptAnyOfClientIPAddressesOrRanges = @() AnyOfClientIPAddressesOrRanges = @() Ensure = "Present" - Credential = $GlobalAdmin + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 new file mode 100644 index 0000000000..023a903f60 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 @@ -0,0 +1,36 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOClientAccessRule 'ConfigureClientAccessRule' + { + Action = "AllowAccess" + UserRecipientFilter = $null + ExceptAnyOfAuthenticationTypes = @() + ExceptUsernameMatchesAnyOfPatterns = @() + AnyOfAuthenticationTypes = @() + UsernameMatchesAnyOfPatterns = @() + Identity = "Always Allow Remote PowerShell" + Priority = 1 + AnyOfProtocols = @("RemotePowerShell") + Enabled = $False # Updated Property + ExceptAnyOfProtocols = @() + ExceptAnyOfClientIPAddressesOrRanges = @() + AnyOfClientIPAddressesOrRanges = @() + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 new file mode 100644 index 0000000000..42f5cf21c7 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOClientAccessRule 'ConfigureClientAccessRule' + { + Action = "AllowAccess" + Identity = "Always Allow Remote PowerShell" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 new file mode 100644 index 0000000000..c13499914c --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODataClassification 'ConfigureDataClassification' + { + Description = "Detects formatted and unformatted Canadian social insurance number."; + Ensure = "Present"; + Identity = "a2f29c85-ecb8-4514-a610-364790c0773e"; + IsDefault = $True; + Locale = "en-US"; + Name = "Canada Social Insurance Number"; + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/1-ConfigureDataEncryptionPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/1-ConfigureDataEncryptionPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/1-ConfigureDataClassification.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/2-Update.ps1 similarity index 60% rename from Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/1-ConfigureDataClassification.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/2-Update.ps1 index 406907f169..b9f21cf1a7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/1-ConfigureDataClassification.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/2-Update.ps1 @@ -14,13 +14,12 @@ Configuration Example node localhost { - EXODataClassification 'ConfigureDataClassification' + EXODataEncryptionPolicy 'ConfigureDataEncryptionPolicy' { - Identity = 'Contoso Confidential' - Name = 'Contoso Confidentiel' - Description = 'Ce message contient des informations confidentielles.' - Locale = 'fr' - IsDefault = $true + Identity = 'US Mailboxes' + Name = 'All US Mailboxes' + Description = 'All Mailboxes of users in the US. Updated' # Updated Property + Enabled = $true Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..e17823fec1 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODataEncryptionPolicy 'ConfigureDataEncryptionPolicy' + { + Identity = 'US Mailboxes' + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-CreateNewDistributionGroup.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 similarity index 74% rename from Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-CreateNewDistributionGroup.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 index 0dbf6928a9..7b5327e6d2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-CreateNewDistributionGroup.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 @@ -9,10 +9,11 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credsAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXODistributionGroup 'DemoDG' @@ -23,18 +24,18 @@ Configuration Example DisplayName = "My Demo DG"; Ensure = "Present"; HiddenGroupMembershipEnabled = $True; - ManagedBy = @("john.smith@contoso.com"); + ManagedBy = @("adeleV@$Domain"); MemberDepartRestriction = "Open"; MemberJoinRestriction = "Closed"; - ModeratedBy = @("admin@contoso.com"); + ModeratedBy = @("alexW@$Domain"); ModerationEnabled = $False; Identity = "DemoDG"; Name = "DemoDG"; - OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/contoso.com"; - PrimarySmtpAddress = "demodg@contoso.com"; + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain"; + PrimarySmtpAddress = "demodg@$Domain"; RequireSenderAuthenticationEnabled = $True; SendModerationNotifications = "Always"; - Credential = $credsAdmin + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 new file mode 100644 index 0000000000..2e59ecff8e --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 @@ -0,0 +1,41 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXODistributionGroup 'DemoDG' + { + Alias = "demodg"; + BccBlocked = $True; # Updated Property + BypassNestedModerationEnabled = $False; + DisplayName = "My Demo DG"; + Ensure = "Present"; + HiddenGroupMembershipEnabled = $True; + ManagedBy = @("adeleV@$Domain"); + MemberDepartRestriction = "Open"; + MemberJoinRestriction = "Closed"; + ModeratedBy = @("alexW@$Domain"); + ModerationEnabled = $False; + Identity = "DemoDG"; + Name = "DemoDG"; + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain"; + PrimarySmtpAddress = "demodg@$Domain"; + RequireSenderAuthenticationEnabled = $True; + SendModerationNotifications = "Always"; + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 new file mode 100644 index 0000000000..5160570364 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + $Domain = $Credscredential.Username.Split('@')[1] + EXODistributionGroup 'DemoDG' + { + DisplayName = "My Demo DG"; + Ensure = "Absent"; + Identity = "DemoDG"; + Name = "DemoDG"; + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/1-ConfigureDkimSigningConfig.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/1-ConfigureDkimSigningConfig.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/2-Update.ps1 new file mode 100644 index 0000000000..f9d8760554 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODkimSigningConfig 'ConfigureDKIMSigning' + { + KeySize = 1024 + Identity = 'contoso.onmicrosoft.com' + HeaderCanonicalization = "Relaxed" + Enabled = $False # Updated Property + BodyCanonicalization = "Relaxed" + AdminDisplayName = "" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/3-Remove.ps1 new file mode 100644 index 0000000000..39c018e8b5 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODkimSigningConfig 'ConfigureDKIMSigning' + { + Identity = 'contoso.onmicrosoft.com' + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-ConfigureMailboxAutoReplyConfiguration.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 similarity index 67% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-ConfigureMailboxAutoReplyConfiguration.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 index 08e1fc7bad..5f61c9a780 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-ConfigureMailboxAutoReplyConfiguration.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 @@ -12,15 +12,16 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { - Name = "Default Policy" - EnabledEmailAddressTemplates = @("SMTP:@contoso.onmicrosoft.com") - EnabledPrimarySMTPAddressTemplate = "@contoso.onmicrosoft.com" + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" ManagedByFilter = "" - Priority = "Lowest" + Priority = 1 Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-ConfigureEmailAddressPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 similarity index 66% rename from Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-ConfigureEmailAddressPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 index 08e1fc7bad..59a62ba67e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-ConfigureEmailAddressPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 @@ -12,15 +12,16 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { - Name = "Default Policy" - EnabledEmailAddressTemplates = @("SMTP:@contoso.onmicrosoft.com") - EnabledPrimarySMTPAddressTemplate = "@contoso.onmicrosoft.com" + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" ManagedByFilter = "" - Priority = "Lowest" + Priority = 2 # Updated Property Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..b6d8b3907a --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + $Domain = $Credscredential.Username.Split('@')[1] + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/1-ConfigureGlobalAddressList.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/1-ConfigureGlobalAddressList.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/2-Update.ps1 new file mode 100644 index 0000000000..4e0ecce8c3 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOGlobalAddressList 'ConfigureGlobalAddressList' + { + Name = "Contoso Human Resources in Washington" + ConditionalCompany = "Contoso" + ConditionalDepartment = "Finances" # Updated Property + ConditionalStateOrProvince = "Washington" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/3-Remove.ps1 new file mode 100644 index 0000000000..9ea08ce6cf --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOGlobalAddressList 'ConfigureGlobalAddressList' + { + Name = "Contoso Human Resources in Washington" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/1-ConfigureGroupSettings.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 similarity index 86% rename from Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/1-ConfigureGroupSettings.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 index a9c7d17766..a7b38e6fd1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/1-ConfigureGroupSettings.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 @@ -9,11 +9,12 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credential + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOGroupSettings 'TestGroup' @@ -24,8 +25,8 @@ Configuration Example AuditLogAgeLimit = "90.00:00:00"; AutoSubscribeNewMembers = $False; CalendarMemberReadOnly = $False; - ConnectorsEnabled = $True; - Credential = $credential; + ConnectorsEnabled = $False; # Updated Property + Credential = $Credscredential; HiddenFromAddressListsEnabled = $True; HiddenFromExchangeClientsEnabled = $True; InformationBarrierMode = "Open"; @@ -34,7 +35,7 @@ Configuration Example MaxSendSize = "35 MB (36,700,160 bytes)"; ModerationEnabled = $False; Notes = "My Notes"; - PrimarySmtpAddress = "TestGroup@contoso.com"; + PrimarySmtpAddress = "TestGroup@$Domain"; RequireSenderAuthenticationEnabled = $True; SubscriptionEnabled = $False; } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/1-ConfigureHostedConnectionFilterPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/1-ConfigureHostedConnectionFilterPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/1-Create.ps1 index 8f22f2840c..dc5cfd26cb 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/1-ConfigureHostedConnectionFilterPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' { - Identity = "Default" + Identity = "Integration Policy" AdminDisplayName = "" EnableSafeList = $False IPAllowList = @() diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/2-Update.ps1 new file mode 100644 index 0000000000..5f06631889 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' + { + Identity = "Integration Policy" + AdminDisplayName = "" + EnableSafeList = $True # Updated Property + IPAllowList = @() + IPBlockList = @() + MakeDefault = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..dcba8d2b18 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' + { + Identity = "Integration Policy" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-ConfigureHostedContentFilterPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-Create.ps1 similarity index 97% rename from Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-ConfigureHostedContentFilterPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-Create.ps1 index 994279d2bd..8ad924b9f0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-ConfigureHostedContentFilterPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' { - Identity = "Default" + Identity = "Integration CFP" AddXHeaderValue = "" AdminDisplayName = "" BulkSpamAction = "MoveToJmf" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/2-Update.ps1 new file mode 100644 index 0000000000..68f54d10fd --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/2-Update.ps1 @@ -0,0 +1,66 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' + { + Identity = "Integration CFP" + AddXHeaderValue = "" + AdminDisplayName = "" + BulkSpamAction = "MoveToJmf" + BulkThreshold = 7 + DownloadLink = $True # Updated Property + EnableEndUserSpamNotifications = $False + EnableLanguageBlockList = $False + EnableRegionBlockList = $False + EndUserSpamNotificationCustomSubject = "" + EndUserSpamNotificationFrequency = 3 + EndUserSpamNotificationLanguage = "Default" + HighConfidencePhishAction = "Quarantine" + HighConfidenceSpamAction = "MoveToJmf" + IncreaseScoreWithBizOrInfoUrls = "Off" + IncreaseScoreWithImageLinks = "Off" + IncreaseScoreWithNumericIps = "Off" + IncreaseScoreWithRedirectToOtherPort = "Off" + InlineSafetyTipsEnabled = $True + LanguageBlockList = @() + MakeDefault = $True + MarkAsSpamBulkMail = "On" + MarkAsSpamEmbedTagsInHtml = "Off" + MarkAsSpamEmptyMessages = "Off" + MarkAsSpamFormTagsInHtml = "Off" + MarkAsSpamFramesInHtml = "Off" + MarkAsSpamFromAddressAuthFail = "Off" + MarkAsSpamJavaScriptInHtml = "Off" + MarkAsSpamNdrBackscatter = "Off" + MarkAsSpamObjectTagsInHtml = "Off" + MarkAsSpamSensitiveWordList = "Off" + MarkAsSpamSpfRecordHardFail = "Off" + MarkAsSpamWebBugsInHtml = "Off" + ModifySubjectValue = "" + PhishSpamAction = "MoveToJmf" + PhishZapEnabled = $True + QuarantineRetentionPeriod = 15 + RedirectToRecipients = @() + RegionBlockList = @() + SpamAction = "MoveToJmf" + SpamZapEnabled = $True + TestModeAction = "None" + TestModeBccToRecipients = @() + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..3a7d7dd917 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' + { + Identity = "Integration CFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-ConfigureHostedContentFilterRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-ConfigureHostedContentFilterRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-Create.ps1 index 6e3d3da7a5..304e2d1e99 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-ConfigureHostedContentFilterRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-Create.ps1 @@ -21,7 +21,7 @@ Configuration Example Comments = "Applies to all users, except when member of HR group" Enabled = $True ExceptIfSentToMemberOf = "Contoso Human Resources" - HostedContentFilterPolicy = "Default" + HostedContentFilterPolicy = "Integration CFP" Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/2-Update.ps1 new file mode 100644 index 0000000000..4c0bbf0035 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' + { + Identity = "Contoso Recipients" + Comments = "Applies to all users, except when member of HR group" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Contoso Human Resources" + HostedContentFilterPolicy = "Integration CFP" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/3-Remove.ps1 new file mode 100644 index 0000000000..4af57b4f29 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' + { + Identity = "Contoso Recipients" + HostedContentFilterPolicy = "Integration CFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-ConfigureHostedOutboundSpamFilterPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-Create.ps1 similarity index 94% rename from Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-ConfigureHostedOutboundSpamFilterPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-Create.ps1 index faabfc4d7c..ea0c0cf6a3 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-ConfigureHostedOutboundSpamFilterPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' { - Identity = "Default" + Identity = "Integration SFP" ActionWhenThresholdReached = "BlockUserForToday" AdminDisplayName = "" AutoForwardingMode = "Automatic" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/2-Update.ps1 new file mode 100644 index 0000000000..d5d9157e3e --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/2-Update.ps1 @@ -0,0 +1,34 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' + { + Identity = "Integration SFP" + ActionWhenThresholdReached = "BlockUserForToday" + AdminDisplayName = "" + AutoForwardingMode = "Automatic" + BccSuspiciousOutboundAdditionalRecipients = @() + BccSuspiciousOutboundMail = $False + NotifyOutboundSpam = $False + NotifyOutboundSpamRecipients = @() + RecipientLimitExternalPerHour = 0 + RecipientLimitInternalPerHour = 1 # Updated Property + RecipientLimitPerDay = 0 + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..891b4a4be9 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' + { + Identity = "Integration SFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-ConfigureHostedOutboundSpamFilterRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-Create.ps1 similarity index 86% rename from Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-ConfigureHostedOutboundSpamFilterRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-Create.ps1 index 336307c6e8..b2680a0974 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-ConfigureHostedOutboundSpamFilterRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-Create.ps1 @@ -20,8 +20,8 @@ Configuration Example Identity = "Contoso Executives" Comments = "Does not apply to Executives" Enabled = $True - ExceptIfFrom = "Elizabeth Brunner" - HostedOutboundSpamFilterPolicy = "Default" + ExceptIfFrom = "John Smith" + HostedOutboundSpamFilterPolicy = "Integration SFP" Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/2-Update.ps1 new file mode 100644 index 0000000000..4d7ae70dd0 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' + { + Identity = "Contoso Executives" + Comments = "Does not apply to Executives" + Enabled = $False # Updated Property + ExceptIfFrom = "John Smith" + HostedOutboundSpamFilterPolicy = "Integration SFP" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/3-Remove.ps1 new file mode 100644 index 0000000000..fd568fae34 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/3-Remove.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' + { + Identity = "Contoso Executives" + Enabled = $False # Updated Property + HostedOutboundSpamFilterPolicy = "Integration SFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOIRMConfiguration/1-ConfigureIRMConfiguration.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOIRMConfiguration/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOIRMConfiguration/1-ConfigureIRMConfiguration.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOIRMConfiguration/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/1-ConfigureInboundConnector.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/1-ConfigureInboundConnector.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/2-Update.ps1 new file mode 100644 index 0000000000..7a38b9078b --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/2-Update.ps1 @@ -0,0 +1,34 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOInboundConnector 'ConfigureInboundConnector' + { + Identity = "Contoso Inbound Connector" + CloudServicesMailEnabled = $True + Comment = "Inbound connector for Contoso" + ConnectorSource = "Default" + ConnectorType = "OnPremises" + Enabled = $False # Updated Property + RequireTls = $True + SenderDomains = "*.contoso.com" + TlsSenderCertificateName = "contoso.com" + TreatMessagesAsInternal = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/3-Remove.ps1 new file mode 100644 index 0000000000..974357ff51 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOInboundConnector 'ConfigureInboundConnector' + { + Identity = "Contoso Inbound Connector" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/1-ConfigureIntraOrganizationConnector.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/1-ConfigureIntraOrganizationConnector.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/2-Update.ps1 new file mode 100644 index 0000000000..34b31fcc80 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOIntraOrganizationConnector 'ConfigureIntraOrganizationConnector' + { + Identity = "MainCloudConnector" + DiscoveryEndpoint = "https://ExternalDiscovery.Contoso.com" + TargetAddressDomains = "Cloud1.contoso.com","Cloud2.contoso.com" + Enabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/3-Remove.ps1 new file mode 100644 index 0000000000..e5c9f58607 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOIntraOrganizationConnector 'ConfigureIntraOrganizationConnector' + { + Identity = "MainCloudConnector" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-CreateJournalRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-Create.ps1 similarity index 79% rename from Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-CreateJournalRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-Create.ps1 index 46d4a9ac00..b69332c585 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-CreateJournalRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-Create.ps1 @@ -12,13 +12,14 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOJournalRule 'CreateJournalRule' { Enabled = $True - JournalEmailAddress = "John.Smith@contoso.com" - Name = "Send to John" + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" RuleScope = "Global" Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/2-Update.ps1 new file mode 100644 index 0000000000..1161e39a67 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOJournalRule 'CreateJournalRule' + { + Enabled = $False # Updated Property + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" + RuleScope = "Global" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/3-Remove.ps1 new file mode 100644 index 0000000000..fdc5d0c87e --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOJournalRule 'CreateJournalRule' + { + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-NewMailContact.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-Create.ps1 similarity index 92% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-NewMailContact.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-Create.ps1 index 74c7a2ac87..a4577146ab 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-NewMailContact.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-Create.ps1 @@ -12,6 +12,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailContact 'TestMailContact' @@ -27,7 +28,7 @@ Configuration Example ModeratedBy = @() ModerationEnabled = $false Name = 'My Test Contact' - OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$OrganizationName" + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" SendModerationNotifications = 'Always' UsePreferMessageFormat = $true CustomAttribute1 = 'Custom Value 1' diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/2-Update.ps1 new file mode 100644 index 0000000000..c9b69b8bec --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/2-Update.ps1 @@ -0,0 +1,38 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailContact 'TestMailContact' + { + Alias = 'TestMailContact' + Credential = $Credscredential + DisplayName = 'My Test Contact' + Ensure = 'Present' + ExternalEmailAddress = 'SMTP:test@tailspintoys.com' + MacAttachmentFormat = 'BinHex' + MessageBodyFormat = 'TextAndHtml' + MessageFormat = 'Mime' + ModeratedBy = @() + ModerationEnabled = $false + Name = 'My Test Contact' + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" + SendModerationNotifications = 'Always' + UsePreferMessageFormat = $false # Updated Property + CustomAttribute1 = 'Custom Value 1' + ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/3-Remove.ps1 new file mode 100644 index 0000000000..f84f309064 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/3-Remove.ps1 @@ -0,0 +1,33 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailContact 'TestMailContact' + { + Alias = 'TestMailContact' + Credential = $Credscredential + DisplayName = 'My Test Contact' + Ensure = 'Absent' + ExternalEmailAddress = 'SMTP:test@tailspintoys.com' + Name = 'My Test Contact' + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" + SendModerationNotifications = 'Always' + UsePreferMessageFormat = $false # Updated Property + CustomAttribute1 = 'Custom Value 1' + ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-ConfigureMailtips.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-Create.ps1 similarity index 88% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-ConfigureMailtips.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-Create.ps1 index 25b357232c..3c71726bab 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-ConfigureMailtips.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-Create.ps1 @@ -12,11 +12,12 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailTips 'OrgWideMailTips' { - Organization = "contoso.com" + Organization = $Domain MailTipsAllTipsEnabled = $True MailTipsGroupMetricsEnabled = $True MailTipsLargeAudienceThreshold = 100 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/2-Update.ps1 new file mode 100644 index 0000000000..172deb2c04 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/2-Update.ps1 @@ -0,0 +1,30 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailTips 'OrgWideMailTips' + { + Organization = $Domain + MailTipsAllTipsEnabled = $True + MailTipsGroupMetricsEnabled = $False # Updated Property + MailTipsLargeAudienceThreshold = 100 + MailTipsMailboxSourcedTipsEnabled = $True + MailTipsExternalRecipientsTipsEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/3-Remove.ps1 new file mode 100644 index 0000000000..d4e681aa7d --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailTips 'OrgWideMailTips' + { + Organization = $Domain + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 new file mode 100644 index 0000000000..3fb5e18e6a --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 @@ -0,0 +1,37 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailboxAutoReplyConfiguration "EXOMailboxAutoReplyConfiguration" + { + AutoDeclineFutureRequestsWhenOOF = $False; + AutoReplyState = "Disabled"; + CreateOOFEvent = $False; + Credential = $Credscredential; + DeclineAllEventsForScheduledOOF = $False; + DeclineEventsForScheduledOOF = $True; # Updated Property + DeclineMeetingMessage = ""; + EndTime = "1/23/2024 3:00:00 PM"; + Ensure = "Present"; + ExternalAudience = "All"; + ExternalMessage = ""; + Identity = "AdeleV@$Domain"; + InternalMessage = ""; + OOFEventSubject = ""; + StartTime = "1/22/2024 3:00:00 PM"; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/1-ConfigureCalendarFolder.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/2-Update.ps1 similarity index 86% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/1-ConfigureCalendarFolder.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/2-Update.ps1 index d5256cf626..12a8ee1f95 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/1-ConfigureCalendarFolder.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/2-Update.ps1 @@ -20,10 +20,10 @@ Configuration Example Credential = $credsCredential; DetailLevel = "AvailabilityOnly"; Ensure = "Present"; - Identity = "john.smith:\Calendar"; + Identity = "AdeleV:\Calendar"; PublishDateRangeFrom = "ThreeMonths"; PublishDateRangeTo = "ThreeMonths"; - PublishEnabled = $False; + PublishEnabled = $True; # Updated Property SearchableUrlEnabled = $False; } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/1-ConfigureMailboxPermission.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/2-Update.ps1 similarity index 86% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/1-ConfigureMailboxPermission.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/2-Update.ps1 index d3dd22581f..732a1e769d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/1-ConfigureMailboxPermission.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/2-Update.ps1 @@ -18,9 +18,9 @@ Configuration Example { AccessRights = @("FullAccess","ReadPermission"); Credential = $credsCredential; - Deny = $False; + Deny = $True; # Updated Property Ensure = "Present"; - Identity = "John.Smith"; + Identity = "AdeleV"; InheritanceType = "All"; User = "NT AUTHORITY\SELF"; } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/1-ConfigureMailboxPlan.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/2-Update.ps1 similarity index 86% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/1-ConfigureMailboxPlan.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/2-Update.ps1 index 6d01ededb7..998d3222d6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/1-ConfigureMailboxPlan.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/2-Update.ps1 @@ -17,12 +17,12 @@ Configuration Example EXOMailboxPlan 'ConfigureMailboxPlan' { Ensure = "Present"; - Identity = "ExchangeOnlineEnterprise"; + Identity = "Integration Plan"; IssueWarningQuota = "98 GB (105,226,698,752 bytes)"; MaxReceiveSize = "25 MB (26,214,400 bytes)"; MaxSendSize = "25 MB (26,214,400 bytes)"; ProhibitSendQuota = "99 GB (106,300,440,576 bytes)"; - ProhibitSendReceiveQuota = "100 GB (107,374,182,400 bytes)"; + ProhibitSendReceiveQuota = "15 GB (16,106,127,360 bytes)"; # Updated Property RetainDeletedItemsFor = "14.00:00:00"; RoleAssignmentPolicy = "Default Role Assignment Policy"; Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/1-ConfigureMailboxSettings.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/2-Update.ps1 similarity index 92% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/1-ConfigureMailboxSettings.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/2-Update.ps1 index 615e477505..91d0da31c2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/1-ConfigureMailboxSettings.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/2-Update.ps1 @@ -20,7 +20,7 @@ Configuration Example { DisplayName = 'Ottawa Employees' TimeZone = 'Eastern Standard Time' - Locale = 'fr-CA' + Locale = 'en-US' # Updated Property Ensure = 'Present' Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-ConfigureMalwareFilterPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-Create.ps1 similarity index 94% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-ConfigureMalwareFilterPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-Create.ps1 index aeaed230e3..283795ee7b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-ConfigureMalwareFilterPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' { - Identity = "Default" + Identity = "IntegrationMFP" CustomNotifications = $False EnableExternalSenderAdminNotifications = $False EnableFileFilter = $False diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/2-Update.ps1 new file mode 100644 index 0000000000..862d17b0bb --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/2-Update.ps1 @@ -0,0 +1,32 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' + { + Identity = "IntegrationMFP" + CustomNotifications = $False + EnableExternalSenderAdminNotifications = $False + EnableFileFilter = $False + EnableInternalSenderAdminNotifications = $False + FileTypeAction = "Quarantine" + FileTypes = @("ace", "ani", "app", "cab", "docm", "exe", "iso", "jar", "jnlp", "reg", "scr", "vbe", "vbs") + QuarantineTag = "AdminOnlyAccessPolicy" + ZapEnabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..22d47da26d --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' + { + Identity = "IntegrationMFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-ConfigureMalwareFilterRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-Create.ps1 similarity index 91% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-ConfigureMalwareFilterRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-Create.ps1 index ee7f700720..91edbc4237 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-ConfigureMalwareFilterRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-Create.ps1 @@ -18,7 +18,7 @@ Configuration Example EXOMalwareFilterRule 'ConfigureMalwareFilterRule' { Identity = "Contoso Recipients" - MalwareFilterPolicy = "Contoso Malware Filter Policy" + MalwareFilterPolicy = "IntegrationMFP" Comments = "Apply the filter to all Contoso users" Enabled = $True RecipientDomainIs = "contoso.com" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/2-Update.ps1 new file mode 100644 index 0000000000..e36ce09244 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterRule 'ConfigureMalwareFilterRule' + { + Identity = "Contoso Recipients" + MalwareFilterPolicy = "IntegrationMFP" + Comments = "Apply the filter to all Contoso users" + Enabled = $False # Updated Property + RecipientDomainIs = "contoso.com" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/3-Remove.ps1 new file mode 100644 index 0000000000..f6f2a1a2a4 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterRule 'ConfigureMalwareFilterRule' + { + Identity = "Contoso Recipients" + MalwareFilterPolicy = "IntegrationMFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/1-ConfigureManagementRole.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/1-ConfigureManagementRole.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/2-Update.ps1 new file mode 100644 index 0000000000..512cd43c77 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/2-Update.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRole 'ConfigureManagementRole' + { + Name = "MyDisplayName" + Description = "Updated Description" # Updated Property + Parent = "contoso.onmicrosoft.com\MyProfileInformation" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/3-Remove.ps1 new file mode 100644 index 0000000000..65e2e25345 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRole 'ConfigureManagementRole' + { + Name = "MyDisplayName" + Description = "Updated Description" # Updated Property + Parent = "contoso.onmicrosoft.com\MyProfileInformation" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-NewManagementRoleAssignment.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-NewManagementRoleAssignment.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-Create.ps1 index 4ee5ae6f22..aee17ea1b5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-NewManagementRoleAssignment.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-Create.ps1 @@ -20,7 +20,7 @@ Configuration Example Ensure = "Present"; Name = "MyManagementRoleAssignment"; Role = "UserApplication"; - User = "John.Smith"; + User = "AdeleV"; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/2-Update.ps1 new file mode 100644 index 0000000000..76465f6366 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/2-Update.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsCredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRoleAssignment 'AssignManagementRole' + { + Credential = $credsCredential; + Ensure = "Present"; + Name = "MyManagementRoleAssignment"; + Role = "UserApplication"; + User = "AlexW"; # Updated Property + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationDefault/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/3-Remove.ps1 similarity index 50% rename from Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationDefault/3-Remove.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/3-Remove.ps1 index 9941723b9b..27ba43c715 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationDefault/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/3-Remove.ps1 @@ -12,13 +12,15 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC - Node localhost + node localhost { - AADCrossTenantAccessPolicyConfigurationDefault "AADCrossTenantAccessPolicyConfigurationDefault" + EXOManagementRoleAssignment 'AssignManagementRole' { - Credential = $Credscredential; - Ensure = "Absent"; - IsSingleInstance = "Yes"; + Credential = $credsCredential; + Ensure = "Absent"; + Name = "MyManagementRoleAssignment"; + Role = "UserApplication"; + User = "AlexW"; # Updated Property } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/1-ConfigureMessageClassification.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/1-ConfigureMessageClassification.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/2-Update.ps1 new file mode 100644 index 0000000000..9054444658 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/2-Update.ps1 @@ -0,0 +1,32 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMessageClassification 'ConfigureMessageClassification' + { + Identity = "Contoso Message Classification" + Name = "Contoso Message Classification" + DisplayName = "Contoso Message Classification" + DisplayPrecedence = "Highest" + PermissionMenuVisible = $True + RecipientDescription = "Shown to receipients" + SenderDescription = "Shown to senders" + RetainClassificationEnabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/3-Remove.ps1 new file mode 100644 index 0000000000..f02998c20b --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/3-Remove.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMessageClassification 'ConfigureMessageClassification' + { + Identity = "Contoso Message Classification" + Name = "Contoso Message Classification" + DisplayName = "Contoso Message Classification" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/1-ConfigureMobileDeviceMailboxPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/1-ConfigureMobileDeviceMailboxPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/2-Update.ps1 new file mode 100644 index 0000000000..1c21d6c9cc --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/2-Update.ps1 @@ -0,0 +1,77 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMobileDeviceMailboxPolicy 'ConfigureMobileDeviceMailboxPolicy' + { + Name = "Default" + AllowApplePushNotifications = $True + AllowBluetooth = "Allow" + AllowBrowser = $False # Updated Property + AllowCamera = $True + AllowConsumerEmail = $True + AllowDesktopSync = $True + AllowExternalDeviceManagement = $False + AllowGooglePushNotifications = $True + AllowHTMLEmail = $True + AllowInternetSharing = $True + AllowIrDA = $True + AllowMicrosoftPushNotifications = $True + AllowMobileOTAUpdate = $True + AllowNonProvisionableDevices = $True + AllowPOPIMAPEmail = $True + AllowRemoteDesktop = $True + AllowSimplePassword = $True + AllowSMIMEEncryptionAlgorithmNegotiation = "AllowAnyAlgorithmNegotiation" + AllowSMIMESoftCerts = $True + AllowStorageCard = $True + AllowTextMessaging = $True + AllowUnsignedApplications = $True + AllowUnsignedInstallationPackages = $True + AllowWiFi = $True + AlphanumericPasswordRequired = $False + ApprovedApplicationList = @() + AttachmentsEnabled = $True + DeviceEncryptionEnabled = $False + DevicePolicyRefreshInterval = "Unlimited" + IrmEnabled = $True + IsDefault = $True + MaxAttachmentSize = "Unlimited" + MaxCalendarAgeFilter = "All" + MaxEmailAgeFilter = "All" + MaxEmailBodyTruncationSize = "Unlimited" + MaxEmailHTMLBodyTruncationSize = "Unlimited" + MaxInactivityTimeLock = "Unlimited" + MaxPasswordFailedAttempts = "Unlimited" + MinPasswordComplexCharacters = 1 + PasswordEnabled = $False + PasswordExpiration = "Unlimited" + PasswordHistory = 0 + PasswordRecoveryEnabled = $False + RequireDeviceEncryption = $False + RequireEncryptedSMIMEMessages = $False + RequireEncryptionSMIMEAlgorithm = "TripleDES" + RequireManualSyncWhenRoaming = $False + RequireSignedSMIMEAlgorithm = "SHA1" + RequireSignedSMIMEMessages = $False + RequireStorageCardEncryption = $False + UnapprovedInROMApplicationList = @() + UNCAccessEnabled = $True + WSSAccessEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..c2fe96cf2f --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMobileDeviceMailboxPolicy 'ConfigureMobileDeviceMailboxPolicy' + { + Name = "Default" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/1-ConfigureOMEConfiguration.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/1-ConfigureOMEConfiguration.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/2-Update.ps1 new file mode 100644 index 0000000000..bb802a8b64 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/2-Update.ps1 @@ -0,0 +1,33 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOMEConfiguration 'ConfigureOMEConfiguration' + { + Identity = "Contoso Marketing" + BackgroundColor = "0x00FFFF00" + DisclaimerText = "Encryption security disclaimer." + EmailText = "Encrypted message enclosed." + ExternalMailExpiryInDays = 1 # Updated Property + IntroductionText = "You have received an encypted message" + OTPEnabled = $True + PortalText = "This portal is encrypted." + SocialIdSignIn = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/3-Remove.ps1 new file mode 100644 index 0000000000..25ed2cde98 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOMEConfiguration 'ConfigureOMEConfiguration' + { + Identity = "Contoso Marketing" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-ConfigureEXOOfflineAddressBook.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-Create.ps1 similarity index 97% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-ConfigureEXOOfflineAddressBook.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-Create.ps1 index 2c911527ce..ce73e90fb1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-ConfigureEXOOfflineAddressBook.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-Create.ps1 @@ -18,7 +18,7 @@ Configuration Example { EXOOfflineAddressBook 'ConfigureOfflineAddressBook' { - Name = "Default Offline Address Book" + Name = "Integration Address Book" AddressLists = @('\Offline Global Address List') ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') DiffRetentionPeriod = "30" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/2-Update.ps1 new file mode 100644 index 0000000000..a6e6f375cf --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/2-Update.ps1 @@ -0,0 +1,30 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOfflineAddressBook 'ConfigureOfflineAddressBook' + { + Name = "Integration Address Book" + AddressLists = @('\Offline Global Address List') + ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') + DiffRetentionPeriod = "30" + IsDefault = $false # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/3-Remove.ps1 new file mode 100644 index 0000000000..d8927dce08 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/3-Remove.ps1 @@ -0,0 +1,30 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOfflineAddressBook 'ConfigureOfflineAddressBook' + { + Name = "Integration Address Book" + AddressLists = @('\Offline Global Address List') + ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') + DiffRetentionPeriod = "30" + IsDefault = $true + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/1-ConfigureOnPremisesOrganization.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/1-ConfigureOnPremisesOrganization.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/2-Update.ps1 new file mode 100644 index 0000000000..8f94e907b8 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/2-Update.ps1 @@ -0,0 +1,32 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' + { + Identity = 'Contoso' + Comment = 'Mail for Contoso. Updated' # Updated Property + HybridDomains = 'contoso.com', 'sales.contoso.com' + InboundConnector = 'Inbound to Contoso' + OrganizationGuid = 'a1bc23cb-3456-bcde-abcd-feb363cacc88' + OrganizationName = 'Contoso' + OutboundConnector = 'Outbound to Contoso' + Ensure = 'Present' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/3-Remove.ps1 new file mode 100644 index 0000000000..ca38670405 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' + { + Identity = 'Contoso' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationConfig/1-ConfigureOrganizationSettings.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationConfig/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationConfig/1-ConfigureOrganizationSettings.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationConfig/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/1-ConfigureOrganizationRelationship.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/1-ConfigureOrganizationRelationship.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/2-Update.ps1 new file mode 100644 index 0000000000..36971ac851 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/2-Update.ps1 @@ -0,0 +1,37 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOrganizationRelationship 'ConfigureOrganizationRelationship' + { + Name = "Contoso" + ArchiveAccessEnabled = $False # Updated Property + DeliveryReportEnabled = $True + DomainNames = "mail.contoso.com" + Enabled = $True + FreeBusyAccessEnabled = $True + FreeBusyAccessLevel = "AvailabilityOnly" + MailboxMoveEnabled = $True + MailTipsAccessEnabled = $True + MailTipsAccessLevel = "None" + PhotosEnabled = $True + TargetApplicationUri = "mail.contoso.com" + TargetAutodiscoverEpr = "https://mail.contoso.com/autodiscover/autodiscover.svc/wssecurity" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/3-Remove.ps1 new file mode 100644 index 0000000000..8a554c5e2a --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOrganizationRelationship 'ConfigureOrganizationRelationship' + { + Name = "Contoso" + Enabled = $True + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/1-ConfigureOutboundConnector.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/1-ConfigureOutboundConnector.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/2-Update.ps1 new file mode 100644 index 0000000000..9f20787d0a --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/2-Update.ps1 @@ -0,0 +1,37 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOutboundConnector 'ConfigureOutboundConnector' + { + Identity = "Contoso Outbound Connector" + AllAcceptedDomains = $True + CloudServicesMailEnabled = $True + Comment = "Outbound connector to Contoso" + ConnectorSource = "Default" + ConnectorType = "OnPremises" + Enabled = $False # Updated Property + IsTransportRuleScoped = $True + RecipientDomains = "*.contoso.com" + RouteAllMessagesViaOnPremises = $True + TlsDomain = "*.contoso.com" + TlsSettings = "DomainValidation" + UseMxRecord = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/3-Remove.ps1 new file mode 100644 index 0000000000..a9841310b1 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOutboundConnector 'ConfigureOutboundConnector' + { + Identity = "Contoso Outbound Connector" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-ConfigureOwaMailboxPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-Create.ps1 similarity index 99% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-ConfigureOwaMailboxPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-Create.ps1 index 7d4bae417f..1a725a4c29 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-ConfigureOwaMailboxPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' { - Name = "OwaMailboxPolicy-Default" + Name = "OwaMailboxPolicy-Integration" ActionForUnknownFileAndMIMETypes = "ForceSave" ActiveSyncIntegrationEnabled = $True AdditionalStorageProvidersAvailable = $True diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/2-Update.ps1 new file mode 100644 index 0000000000..b6fe6ee87d --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/2-Update.ps1 @@ -0,0 +1,96 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' + { + Name = "OwaMailboxPolicy-Integration" + ActionForUnknownFileAndMIMETypes = "ForceSave" + ActiveSyncIntegrationEnabled = $True + AdditionalStorageProvidersAvailable = $True + AllAddressListsEnabled = $True + AllowCopyContactsToDeviceAddressBook = $True + AllowedFileTypes = @(".rpmsg",".xlsx",".xlsm",".xlsb",".tiff",".pptx",".pptm",".ppsx",".ppsm",".docx",".docm",".zip",".xls",".wmv",".wma",".wav",".vsd",".txt",".tif",".rtf",".pub",".ppt",".png",".pdf",".one",".mp3",".jpg",".gif",".doc",".bmp",".avi") + AllowedMimeTypes = @("image/jpeg","image/png","image/gif","image/bmp") + BlockedFileTypes = @(".settingcontent-ms",".printerexport",".appcontent-ms",".appref-ms",".vsmacros",".website",".msh2xml",".msh1xml",".diagcab",".webpnp",".ps2xml",".ps1xml",".mshxml",".gadget",".theme",".psdm1",".mhtml",".cdxml",".xbap",".vhdx",".pyzw",".pssc",".psd1",".psc2",".psc1",".msh2",".msh1",".jnlp",".aspx",".appx",".xnk",".xml",".xll",".wsh",".wsf",".wsc",".wsb",".vsw",".vst",".vss",".vhd",".vbs",".vbp",".vbe",".url",".udl",".tmp",".shs",".shb",".sct",".scr",".scf",".reg",".pyz",".pyw",".pyo",".pyc",".pst",".ps2",".ps1",".prg",".prf",".plg",".pif",".pcd",".ops",".msu",".mst",".msp",".msi",".msh",".msc",".mht",".mdz",".mdw",".mdt",".mde",".mdb",".mda",".mcf",".maw",".mav",".mau",".mat",".mas",".mar",".maq",".mam",".mag",".maf",".mad",".lnk",".ksh",".jse",".jar",".its",".isp",".ins",".inf",".htc",".hta",".hpj",".hlp",".grp",".fxp",".exe",".der",".csh",".crt",".cpl",".com",".cnt",".cmd",".chm",".cer",".bat",".bas",".asx",".asp",".app",".apk",".adp",".ade",".ws",".vb",".py",".pl",".js") + BlockedMimeTypes = @("application/x-javascript","application/javascript","application/msaccess","x-internet-signup","text/javascript","application/xml","application/prg","application/hta","text/scriplet","text/xml") + ClassicAttachmentsEnabled = $True + ConditionalAccessPolicy = "Off" + DefaultTheme = "" + DirectFileAccessOnPrivateComputersEnabled = $True + DirectFileAccessOnPublicComputersEnabled = $False # Updated Property + DisplayPhotosEnabled = $True + ExplicitLogonEnabled = $True + ExternalImageProxyEnabled = $True + ForceSaveAttachmentFilteringEnabled = $False + ForceSaveFileTypes = @(".vsmacros",".ps2xml",".ps1xml",".mshxml",".gadget",".psc2",".psc1",".aspx",".wsh",".wsf",".wsc",".vsw",".vst",".vss",".vbs",".vbe",".url",".tmp",".swf",".spl",".shs",".shb",".sct",".scr",".scf",".reg",".pst",".ps2",".ps1",".prg",".prf",".plg",".pif",".pcd",".ops",".mst",".msp",".msi",".msh",".msc",".mdz",".mdw",".mdt",".mde",".mdb",".mda",".maw",".mav",".mau",".mat",".mas",".mar",".maq",".mam",".mag",".maf",".mad",".lnk",".ksh",".jse",".its",".isp",".ins",".inf",".hta",".hlp",".fxp",".exe",".dir",".dcr",".csh",".crt",".cpl",".com",".cmd",".chm",".cer",".bat",".bas",".asx",".asp",".app",".adp",".ade",".ws",".vb",".js") + ForceSaveMimeTypes = @("Application/x-shockwave-flash","Application/octet-stream","Application/futuresplash","Application/x-director") + ForceWacViewingFirstOnPrivateComputers = $False + ForceWacViewingFirstOnPublicComputers = $False + FreCardsEnabled = $True + GlobalAddressListEnabled = $True + GroupCreationEnabled = $True + InstantMessagingEnabled = $True + InstantMessagingType = "Ocs" + InterestingCalendarsEnabled = $True + IRMEnabled = $True + IsDefault = $True + JournalEnabled = $True + LocalEventsEnabled = $False + LogonAndErrorLanguage = 0 + NotesEnabled = $True + NpsSurveysEnabled = $True + OnSendAddinsEnabled = $False + OrganizationEnabled = $True + OutboundCharset = "AutoDetect" + OutlookBetaToggleEnabled = $True + OWALightEnabled = $True + PersonalAccountCalendarsEnabled = $True + PhoneticSupportEnabled = $False + PlacesEnabled = $True + PremiumClientEnabled = $True + PrintWithoutDownloadEnabled = $True + PublicFoldersEnabled = $True + RecoverDeletedItemsEnabled = $True + ReferenceAttachmentsEnabled = $True + RemindersAndNotificationsEnabled = $True + ReportJunkEmailEnabled = $True + RulesEnabled = $True + SatisfactionEnabled = $True + SaveAttachmentsToCloudEnabled = $True + SearchFoldersEnabled = $True + SetPhotoEnabled = $True + SetPhotoURL = "" + SignaturesEnabled = $True + SkipCreateUnifiedGroupCustomSharepointClassification = $True + TeamSnapCalendarsEnabled = $True + TextMessagingEnabled = $True + ThemeSelectionEnabled = $True + UMIntegrationEnabled = $True + UseGB18030 = $False + UseISO885915 = $False + UserVoiceEnabled = $True + WacEditingEnabled = $True + WacExternalServicesEnabled = $True + WacOMEXEnabled = $False + WacViewingOnPrivateComputersEnabled = $True + WacViewingOnPublicComputersEnabled = $True + WeatherEnabled = $True + WebPartsFrameOptionsType = "SameOrigin" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..c443618a36 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' + { + Name = "OwaMailboxPolicy-Integration" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/1-ConfigurePartnerApplication.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/1-ConfigurePartnerApplication.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/2-Update.ps1 new file mode 100644 index 0000000000..29be55ca27 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPartnerApplication 'ConfigurePartnerApplication' + { + Name = "HRApp" + ApplicationIdentifier = "00000006-0000-0dd1-ac00-000000000000" + AccountType = "OrganizationalAccount" + Enabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/3-Remove.ps1 new file mode 100644 index 0000000000..2cb2adb985 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPartnerApplication 'ConfigurePartnerApplication' + { + Name = "HRApp" + ApplicationIdentifier = "00000006-0000-0dd1-ac00-000000000000" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPerimeterConfiguration/1-ConfigurePerimeterConfiguration.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPerimeterConfiguration/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOPerimeterConfiguration/1-ConfigurePerimeterConfiguration.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOPerimeterConfiguration/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-ConfigurePlace.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 similarity index 83% rename from Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-ConfigurePlace.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 index 6a0952ab08..a520894b77 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-ConfigurePlace.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 @@ -9,11 +9,12 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credential + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOPlace 'TestPlace' @@ -21,10 +22,10 @@ Configuration Example AudioDeviceName = "MyAudioDevice"; Capacity = 15; #Drift City = ""; - Credential = $credential + Credential = $Credscredential DisplayDeviceName = "DisplayDeviceName"; Ensure = 'Present' - Identity = "MyRoom@$contoso.com"; + Identity = "MyRoom@$Domain"; IsWheelChairAccessible = $True; MTREnabled = $False; ParentType = "None"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 new file mode 100644 index 0000000000..0652a062c7 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 @@ -0,0 +1,37 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOPlace 'TestPlace' + { + AudioDeviceName = "MyAudioDevice"; + Capacity = 16; # Updated Property + City = ""; + Credential = $Credscredential + DisplayDeviceName = "DisplayDeviceName"; + Ensure = 'Present' + Identity = "MyRoom@$Domain"; + IsWheelChairAccessible = $True; + MTREnabled = $False; + ParentType = "None"; + Phone = "555-555-5555"; + Tags = @("Tag1", "Tag2"); + VideoDeviceName = "VideoDevice"; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 new file mode 100644 index 0000000000..9be622e644 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOPlace 'TestPlace' + { + AudioDeviceName = "MyAudioDevice"; + Credential = $Credscredential + DisplayDeviceName = "DisplayDeviceName"; + Ensure = 'Absent' + Identity = "MyRoom@$Domain"; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/1-ConfigurePolicyTipConfig.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/1-ConfigurePolicyTipConfig.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/2-Update.ps1 new file mode 100644 index 0000000000..1d23f23daf --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/2-Update.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPolicyTipConfig 'ConfigurePolicyTipConfig' + { + Name = "en\NotifyOnly" + Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/3-Remove.ps1 new file mode 100644 index 0000000000..aae3186d10 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPolicyTipConfig 'ConfigurePolicyTipConfig' + { + Name = "en\NotifyOnly" + Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-ConfigureQuarantinePolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-Create.ps1 similarity index 84% rename from Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-ConfigureQuarantinePolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-Create.ps1 index 50af10b486..03e8295d46 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-ConfigureQuarantinePolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-Create.ps1 @@ -13,13 +13,14 @@ Configuration Example $OrganizationName = $Credscredential.UserName.Split('@')[1] Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOQuarantinePolicy 'ConfigureQuarantinePolicy' { EndUserQuarantinePermissionsValue = 87; ESNEnabled = $False; - Identity = "$OrganizationName\DefaultFullAccessPolicy"; + Identity = "$Domain\DefaultFullAccessPolicy"; Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/2-Update.ps1 new file mode 100644 index 0000000000..feb94715b4 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + $OrganizationName = $Credscredential.UserName.Split('@')[1] + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOQuarantinePolicy 'ConfigureQuarantinePolicy' + { + EndUserQuarantinePermissionsValue = 87; + ESNEnabled = $True; # Updated Property + Identity = "$Domain\DefaultFullAccessPolicy"; + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/3-Remove.ps1 new file mode 100644 index 0000000000..0281fc3468 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + $OrganizationName = $Credscredential.UserName.Split('@')[1] + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOQuarantinePolicy 'ConfigureQuarantinePolicy' + { + Identity = "$Domain\DefaultFullAccessPolicy"; + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-ConfigureRemoteDomain.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-Create.ps1 similarity index 96% rename from Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-ConfigureRemoteDomain.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-Create.ps1 index 9bd7084585..2bc4e0aee5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-ConfigureRemoteDomain.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXORemoteDomain 583b0b70-b45d-401f-98a6-0e7fa8434946 { - Identity = "Default" + Identity = "Integration" AllowedOOFType = "External" AutoForwardEnabled = $True AutoReplyEnabled = $True diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/2-Update.ps1 new file mode 100644 index 0000000000..beeaa531a9 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/2-Update.ps1 @@ -0,0 +1,43 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORemoteDomain 583b0b70-b45d-401f-98a6-0e7fa8434946 + { + Identity = "Integration" + AllowedOOFType = "External" + AutoForwardEnabled = $True + AutoReplyEnabled = $False # Updated Property + ByteEncoderTypeFor7BitCharsets = "Undefined" + CharacterSet = "iso-8859-1" + ContentType = "MimeHtmlText" + DeliveryReportEnabled = $True + DisplaySenderName = $True + DomainName = "*" + IsInternal = $False + LineWrapSize = "Unlimited" + MeetingForwardNotificationEnabled = $False + Name = "Default" + NonMimeCharacterSet = "iso-8859-1" + PreferredInternetCodePageForShiftJis = "Undefined" + TargetDeliveryDomain = $False + TrustedMailInboundEnabled = $False + TrustedMailOutboundEnabled = $False + UseSimpleDisplayName = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/3-Remove.ps1 new file mode 100644 index 0000000000..2ec3881cd3 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORemoteDomain 583b0b70-b45d-401f-98a6-0e7fa8434946 + { + Identity = "Integration" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionPolicy/1-ConfigureReportSubmissionPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionPolicy/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionPolicy/1-ConfigureReportSubmissionPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionPolicy/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionRule/1-ConfigureReportSubmissionRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionRule/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionRule/1-ConfigureReportSubmissionRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionRule/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOResourceConfiguration/1-ConfigureResourceConfiguration.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOResourceConfiguration/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOResourceConfiguration/1-ConfigureResourceConfiguration.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOResourceConfiguration/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-ConfigureRoleAssignmentPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-ConfigureRoleAssignmentPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-Create.ps1 index 4841f189bd..e4ac25a96a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-ConfigureRoleAssignmentPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' { - Name = "Default Role Assignment Policy" + Name = "Integration Policy" Description = "This policy grants end users the permission to set their options in Outlook on the web and perform other self-administration tasks." IsDefault = $True Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/2-Update.ps1 new file mode 100644 index 0000000000..7005a4835f --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/2-Update.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' + { + Name = "Integration Policy" + Description = "This policy grants end users the permission to set their options in Outlook on the web and perform other self-administration tasks." + IsDefault = $False # Updated Property + Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..f00c24b593 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' + { + Name = "Integration Policy" + IsDefault = $False # Updated Property + Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/1-ConfigureRoleGroup.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/1-ConfigureRoleGroup.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/2-Update.ps1 new file mode 100644 index 0000000000..e8546060e8 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleGroup 'ConfigureRoleGroup' + { + Name = "Contoso Role Group" + Description = "Address Lists Role for Exchange Administrators. Updated" # Updated Property + Members = @("Exchange Administrator") + Roles = @("Address Lists") + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/3-Remove.ps1 new file mode 100644 index 0000000000..b897864cc5 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/3-Remove.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleGroup 'ConfigureRoleGroup' + { + Name = "Contoso Role Group" + Members = @("Exchange Administrator") + Roles = @("Address Lists") + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-ConfigureSafeAttachmentPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-Create.ps1 similarity index 86% rename from Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-ConfigureSafeAttachmentPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-Create.ps1 index 486bd307dd..d670be256a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-ConfigureSafeAttachmentPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-Create.ps1 @@ -13,6 +13,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' @@ -20,7 +21,7 @@ Configuration Example Identity = "Marketing Block Attachments" Enable = $True Redirect = $True - RedirectAddress = "admin@contoso.com" + RedirectAddress = "admin@$Domain" Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/2-Update.ps1 new file mode 100644 index 0000000000..2caf85bed1 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' + { + Identity = "Marketing Block Attachments" + Enable = $False # Updated Property + Redirect = $True + RedirectAddress = "admin@$Domain" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..fb3378fa92 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/3-Remove.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' + { + Identity = "Marketing Block Attachments" + Enable = $False # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-ConfigureSafeAttachmentRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-Create.ps1 similarity index 92% rename from Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-ConfigureSafeAttachmentRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-Create.ps1 index 5e44a65fd5..b10f42c4aa 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-ConfigureSafeAttachmentRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-Create.ps1 @@ -21,7 +21,7 @@ Configuration Example Comments = "Applies to Research Department, except managers" Enabled = $True ExceptIfSentToMemberOf = "Research Department Managers" - SafeAttachmentPolicy = "Research Block Attachments" + SafeAttachmentPolicy = "Marketing Block Attachments" SentToMemberOf = "Research Department" Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/2-Update.ps1 new file mode 100644 index 0000000000..7b064d7d99 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/2-Update.ps1 @@ -0,0 +1,30 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' + { + Identity = "Research Department Attachment Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Research Department Managers" + SafeAttachmentPolicy = "Marketing Block Attachments" + SentToMemberOf = "Research Department" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/3-Remove.ps1 new file mode 100644 index 0000000000..3ba7d01996 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/3-Remove.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' + { + Identity = "Research Department Attachment Rule" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Research Department Managers" + SafeAttachmentPolicy = "Marketing Block Attachments" + SentToMemberOf = "Research Department" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/1-ConfigureSafeLinksPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/1-ConfigureSafeLinksPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/2-Update.ps1 new file mode 100644 index 0000000000..09de5e45b7 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/2-Update.ps1 @@ -0,0 +1,32 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksPolicy 'ConfigureSafeLinksPolicy' + { + Identity = 'Marketing Block URL' + AdminDisplayName = 'Marketing Block URL' + CustomNotificationText = 'Blocked URLs for Marketing' + DeliverMessageAfterScan = $True + EnableOrganizationBranding = $False # Updated Property + EnableSafeLinksForTeams = $True + ScanUrls = $True + UseTranslatedNotificationText = $True + Ensure = 'Present' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..f8659eed81 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksPolicy 'ConfigureSafeLinksPolicy' + { + Identity = 'Marketing Block URL' + Ensure = 'Absent' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-ConfigureSafeLinksRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-ConfigureSafeLinksRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-Create.ps1 index b239e80793..c94452d712 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-ConfigureSafeLinksRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-Create.ps1 @@ -21,7 +21,7 @@ Configuration Example Comments = "Applies to Research Department, except managers" Enabled = $True ExceptIfSentToMemberOf = "Research Department Managers" - SafeLinksPolicy = "Research Block URL" + SafeLinksPolicy = "Marketing Block URL" SentToMemberOf = "Research Department" Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/2-Update.ps1 new file mode 100644 index 0000000000..6a672a2158 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/2-Update.ps1 @@ -0,0 +1,30 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksRule 'ConfigureSafeLinksRule' + { + Identity = "Research Department URL Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Research Department Managers" + SafeLinksPolicy = "Marketing Block URL" + SentToMemberOf = "Research Department" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/3-Remove.ps1 new file mode 100644 index 0000000000..12fe46f671 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/3-Remove.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksRule 'ConfigureSafeLinksRule' + { + Identity = "Research Department URL Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $False # Updated Property + SafeLinksPolicy = "Marketing Block URL" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1 - CreateSharedMailbox.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1-Create.ps1 similarity index 76% rename from Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1 - CreateSharedMailbox.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1-Create.ps1 index 1e3a12deee..b672e18961 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1 - CreateSharedMailbox.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1-Create.ps1 @@ -12,13 +12,14 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSharedMailbox 'SharedMailbox' { DisplayName = "Test" - PrimarySMTPAddress = "Test@O365DSC1.onmicrosoft.com" - EmailAddresses = @("Joufflu@o365dsc1.onmicrosoft.com", "Gilles@O365dsc1.onmicrosoft.com") + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/2-Update.ps1 new file mode 100644 index 0000000000..a009e6f9bc --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/2-Update.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSharedMailbox 'SharedMailbox' + { + DisplayName = "Test" + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain", "AlexW@$Domain") # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/3-Remove.ps1 new file mode 100644 index 0000000000..3b1b6ce72b --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/3-Remove.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSharedMailbox 'SharedMailbox' + { + DisplayName = "Test" + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain", "AlexW@$Domain") # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-ConfigureSharingPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-Create.ps1 similarity index 92% rename from Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-ConfigureSharingPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-Create.ps1 index 9d86681134..ddce10e578 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-ConfigureSharingPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOSharingPolicy 'ConfigureSharingPolicy' { - Name = "Default Sharing Policy" + Name = "Integration Sharing Policy" Default = $True Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") Enabled = $True diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/2-Update.ps1 new file mode 100644 index 0000000000..5f08c125a7 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/2-Update.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSharingPolicy 'ConfigureSharingPolicy' + { + Name = "Integration Sharing Policy" + Default = $False # Updated Property + Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..54a8e868f4 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/3-Remove.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSharingPolicy 'ConfigureSharingPolicy' + { + Name = "Integration Sharing Policy" + Default = $False # Updated Property + Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") + Enabled = $True + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportConfig/1-ConfigureTransportSettings.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportConfig/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOTransportConfig/1-ConfigureTransportSettings.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOTransportConfig/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/1-ConfigureTransportRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/1-ConfigureTransportRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/2-Update.ps1 new file mode 100644 index 0000000000..39e2e3a262 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/2-Update.ps1 @@ -0,0 +1,31 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOTransportRule 'ConfigureTransportRule' + { + Name = "Ethical Wall - Sales and Brokerage Departments" + BetweenMemberOf1 = "Sales Department" + BetweenMemberOf2 = "Brokerage Department" + ExceptIfFrom = "Tony Smith","Pilar Ackerman" + ExceptIfSubjectContainsWords = "Press Release","Corporate Communication" + RejectMessageReasonText = "Updated" # Updated Property + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/3-Remove.ps1 new file mode 100644 index 0000000000..5c40c4a7b7 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOTransportRule 'ConfigureTransportRule' + { + Name = "Ethical Wall - Sales and Brokerage Departments" + Enabled = $True + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 index 3715c9ef21..4b432876d5 100644 --- a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 +++ b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 2024-01-17 +# Generated on: 2024-01-25 @{ @@ -11,7 +11,7 @@ # RootModule = '' # Version number of this module. - ModuleVersion = '1.24.117.1' + ModuleVersion = '1.24.124.1' # Supported PSEditions # CompatiblePSEditions = @() @@ -140,32 +140,90 @@ IconUri = 'https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Dependencies/Images/Logo.png?raw=true' # ReleaseNotes of this module - ReleaseNotes = '* AADAdministrativeUnit - * Used generic Graph API URL from MSCloudLoginConnectionProfile. - * AADApplication - * Ignore Permissions in tests if not passed. Preventing null comparison errors. - * AADAttributeSet - * Removed the ability to specify a value of Absent for the Ensure property. + ReleaseNotes = '* AADAuthenticationMethodPolicyAuthenticator + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicyEmail + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicyFido2 + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicySms + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicySoftware + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicyTemporary + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicyVoice + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicyX509 + * Remove the logic path to create a new instance in favor of the update flow. * AADConditionalAccessPolicy - * Fixes an error where the ApplicationEnforcedRestrictionsIsEnabled parameter - was always set to false in scenarios where it should have been null. - * AADAuthenticationMethodPolicy + * Fix issue when not all parameters are specified + FIXES [[#4202](https://github.com/microsoft/Microsoft365DSC/issues/4202)] + * AADCrossTenantAccessPolicy * Removed the ability to specify a value of Absent for the Ensure property. - * AADAuthenticationMethodPolicyX509 - * Fix the way we returned an empty rule set from the Get method. This caused - the Test-TargetResource method to return true even when instances matched. - * AADRoleSetting + * AADCrossTenantAccessPolicyCOnfigurationDefault * Removed the ability to specify a value of Absent for the Ensure property. - * EXOAntiPhishPolicy - * Add support for HonorDmarcPolicy parameter - FIXES [[#4138](https://github.com/microsoft/Microsoft365DSC/issues/4138)] - * IntuneDeviceConfigurationPolicyMacOS - * Fix CIM instances comparison in Test-TargetResource and export - CompliantAppsList with the correct type - FIXES [#4144](https://github.com/microsoft/Microsoft365DSC/issues/4144) + * AADGroup + * Changed Set logic to restore groups from the deleted list if a match by + DisplayName is found. + * EXOActiveSyncDeviceAccessRule + * Changed the way Identity is determined by using a combination of the + QueryString and Characteristic parameters. + * EXOAddressList + * Fixed an issue trying to create a new instance when DisplayName is empty. + * EXOApplicationAccessPolicy + * Changed the logic to retrieve existing instances based on Scope. + * EXODataClassification + * DEPRECATED Resource. + * SCAutoSensitivityLabelRule + * Correct export indentation, which caused an issue with report conversion to JSON. + FIXES [[#4240](https://github.com/microsoft/Microsoft365DSC/issues/4240)] + * SPOSharingSettings + * Fixed an Issue where the MySiteSharingCapability could be returned as an + empty string instead of a null value from the Get method. + * TeamsAppPermissionPolicy, TeamsAppSetupPolicy, TeamsCallHoldPolicy, + TeamsIPPhonePolicy, TeamsMobilityPolicy, TeamsNetworkRoamingPolicy, + TeamsShiftsPolicy, TeamsTenantNetworkRegion, TeamsTenantNetworkSite, + TeamsTenantNetworkSubnet, TeamsTenantTrustedIPAddress, TeamsTranslationRule, + TeamsUnassignedNumberTreatment, TeamsVdiPolicy, TeamsWorkloadPolicy + * Fix condition when resource is absent + FIXES [#4227](https://github.com/microsoft/Microsoft365DSC/issues/4227) + * TeamsAudioConferencingPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4215](https://github.com/microsoft/Microsoft365DSC/issues/4215) + * TeamsCallParkPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4210](https://github.com/microsoft/Microsoft365DSC/issues/4210) + * TeamsComplianceRecordingPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4212](https://github.com/microsoft/Microsoft365DSC/issues/4212) + * TeamsCortanaPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4208](https://github.com/microsoft/Microsoft365DSC/issues/4208) + * TeamsEnhancedEncryptionPolicy + * Fix condition when resource is absent + FIXES [#4221](https://github.com/microsoft/Microsoft365DSC/issues/4221) + * TeamsEventsPolicy + * Add missing attributes + FIXES [#4242](https://github.com/microsoft/Microsoft365DSC/issues/4242) + * TeamsFeedbackPolicy + * Fix condition when resource is absent + FIXES [#4223](https://github.com/microsoft/Microsoft365DSC/issues/4223) + * TeamsFilesPolicy + * Fix condition when resource is absent + FIXES [#4225](https://github.com/microsoft/Microsoft365DSC/issues/4225) + * TeamsGroupPolicyAssignment + * Ensure assignment can still be created if GroupId is not found by trying to + search by DisplayName afterwards + FIXES [#4248](https://github.com/microsoft/Microsoft365DSC/issues/4248) + * TeamsMeetingBroadcastPolicy + * Fix deletion of resource + FIXES [#4231](https://github.com/microsoft/Microsoft365DSC/issues/4231) + * TeamsMobilityPolicy + * Validate string set on parameter MobileDialerPreference * DEPENDENCIES - * Updated Microsoft.PowerApps.Administration.PowerShell to version 2.0.178. - * Updated MSCloudLoginAssistant to version 1.1.6.' + * Updated Microsoft.Graph dependencies to version 2.12.0. + * Updated MicrosoftTeams dependencies to version 5.9.0.' # Flag to indicate whether the module requires explicit user acceptance for install/update # RequireLicenseAcceptance = $false diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 index 1d417c6905..4875dab41a 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 @@ -82,227 +82,6 @@ Id = "c3"; IsAvailable = $True; } - AADAuthenticationMethodPolicyAuthenticator 'AADAuthenticationMethodPolicyAuthenticator-MicrosoftAuthenticator' - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyAuthenticatorExcludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - FeatureSettings = MSFT_MicrosoftGraphmicrosoftAuthenticatorFeatureSettings{ - DisplayLocationInformationRequiredState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - CompanionAppAllowedState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - DisplayAppInformationRequiredState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - }; - Id = "MicrosoftAuthenticator"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyAuthenticatorIncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyAuthenticatorIncludeTarget{ - Id = 'Northwind Traders' - TargetType = 'group' - } - ); - IsSoftwareOathEnabled = $False; - State = "enabled"; - } - AADAuthenticationMethodPolicyEmail 'AADAuthenticationMethodPolicyEmail-Email' - { - AllowExternalIdToUseEmailOtp = "enabled"; - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyEmailExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - ); - Id = "Email"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyEmailIncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyEmailIncludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - AADAuthenticationMethodPolicyFido2 'AADAuthenticationMethodPolicyFido2-Fido2' - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - ); - Id = "Fido2"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyFido2IncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsAttestationEnforced = $False; - IsSelfServiceRegistrationAllowed = $True; - KeyRestrictions = MSFT_MicrosoftGraphfido2KeyRestrictions{ - IsEnforced = $False - EnforcementType = 'block' - AaGuids = @() - }; - State = "enabled"; - } - AADAuthenticationMethodPolicySms 'AADAuthenticationMethodPolicySms-Sms' - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicySmsExcludeTarget{ - Id = 'All Employees' - TargetType = 'group' - } - ); - Id = "Sms"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicySmsIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - State = "enabled"; - } - AADAuthenticationMethodPolicySoftware 'AADAuthenticationMethodPolicySoftware-SoftwareOath' - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - ); - Id = "SoftwareOath"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicySoftwareIncludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - AADAuthenticationMethodPolicyTemporary 'AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass' - { - Credential = $Credscredential; - DefaultLength = 8; - DefaultLifetimeInMinutes = 60; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyTemporaryExcludeTarget{ - Id = 'All Company' - TargetType = 'group' - } - ); - Id = "TemporaryAccessPass"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyTemporaryIncludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - ); - IsUsableOnce = $False; - MaximumLifetimeInMinutes = 480; - MinimumLifetimeInMinutes = 60; - State = "enabled"; - } - AADAuthenticationMethodPolicyVoice 'AADAuthenticationMethodPolicyVoice-Voice' - { - Credential = $Credscredential; - Ensure = "Present"; - Id = "Voice"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyVoiceIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsOfficePhoneAllowed = $False; - State = "disabled"; - } - AADAuthenticationMethodPolicyX509 'AADAuthenticationMethodPolicyX509-X509Certificate' - { - AuthenticationModeConfiguration = MSFT_MicrosoftGraphx509CertificateAuthenticationModeConfiguration{ - X509CertificateAuthenticationDefaultMode = 'x509CertificateSingleFactor' - Rules = @(@()) - }; - CertificateUserBindings = @( - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 1 - UserProperty = 'userPrincipalName' - X509CertificateField = 'PrincipalName' - } - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 2 - UserProperty = 'userPrincipalName' - X509CertificateField = 'RFC822Name' - } - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 3 - UserProperty = 'certificateUserIds' - X509CertificateField = 'SubjectKeyIdentifier' - } - ); - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyX509ExcludeTarget{ - Id = 'Sales Team' - TargetType = 'group' - } - ); - Id = "X509Certificate"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyX509IncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - ); - State = "enabled"; - } AADAuthenticationStrengthPolicy 'AADAuthenticationStrengthPolicy-Example' { AllowedCombinations = @("windowsHelloForBusiness","fido2","x509CertificateMultiFactor","deviceBasedPush"); @@ -311,12 +90,10 @@ Ensure = "Present"; Credential = $Credscredential; } - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - CloudAppSecurityIsEnabled = $False; Credential = $Credscredential; DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; @@ -326,7 +103,6 @@ GrantControlOperator = "OR"; IncludeApplications = @("All"); IncludeRoles = @("Attack Payload Author"); - PersistentBrowserIsEnabled = $False; SignInFrequencyInterval = "timeBased"; SignInFrequencyIsEnabled = $True; SignInFrequencyType = "hours"; @@ -451,7 +227,7 @@ GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 index 6f5166aed9..6415d0c12a 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 @@ -53,13 +53,6 @@ State = "enabled"; Credential = $credsCredential; } - AADAuthenticationMethodPolicyEmail 'AADAuthenticationMethodPolicyEmail-Email' - { - Ensure = "Absent"; - Id = "Email"; - State = "disabled"; # Updated Property - Credential = $credsCredential; - } AADAuthenticationMethodPolicyFido2 'AADAuthenticationMethodPolicyFido2-Fido2' { Ensure = "Absent"; @@ -102,26 +95,12 @@ Ensure = "Absent"; Credential = $Credscredential; } - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - DisplayName = 'Allin-example' + DisplayName = 'Example CAP' Ensure = 'Absent' Credential = $Credscredential } - AADCrossTenantAccessPolicy 'AADCrossTenantAccessPolicy' - { - AllowedCloudEndpoints = @("microsoftonline.us"); - Credential = $Credscredential; - DisplayName = "MyXTAPPolicy"; - Ensure = "Absent"; - IsSingleInstance = "Yes"; - } - AADCrossTenantAccessPolicyConfigurationDefault 'AADCrossTenantAccessPolicyConfigurationDefault' - { - Credential = $Credscredential; - Ensure = "Absent"; - IsSingleInstance = "Yes"; - } AADCrossTenantAccessPolicyConfigurationPartner 'AADCrossTenantAccessPolicyConfigurationPartner' { Credential = $Credscredential; @@ -130,7 +109,7 @@ } AADEntitlementManagementAccessPackage 'myAccessPackage' { - DisplayName = 'General' + DisplayName = 'Integration Package' Ensure = 'Absent' Credential = $Credscredential } @@ -220,50 +199,6 @@ } }; } - AADRoleSetting '28b253d8-cde5-471f-a331-fe7320023cdd' - { - ActivateApprover = @(); - ActivationMaxDuration = "PT8H"; - ActivationReqJustification = $False; # Updated Property - ActivationReqMFA = $False; - ActivationReqTicket = $False; - ActiveAlertNotificationAdditionalRecipient = @(); - ActiveAlertNotificationDefaultRecipient = $True; - ActiveAlertNotificationOnlyCritical = $False; - ActiveApproveNotificationAdditionalRecipient = @(); - ActiveApproveNotificationDefaultRecipient = $True; - ActiveApproveNotificationOnlyCritical = $False; - ActiveAssigneeNotificationAdditionalRecipient = @(); - ActiveAssigneeNotificationDefaultRecipient = $True; - ActiveAssigneeNotificationOnlyCritical = $False; - ApprovaltoActivate = $False; - AssignmentReqJustification = $True; - AssignmentReqMFA = $False; - Displayname = "Application Administrator"; - ElegibilityAssignmentReqJustification = $False; - ElegibilityAssignmentReqMFA = $False; - EligibleAlertNotificationAdditionalRecipient = @(); - EligibleAlertNotificationDefaultRecipient = $True; - EligibleAlertNotificationOnlyCritical = $False; - EligibleApproveNotificationAdditionalRecipient = @(); - EligibleApproveNotificationDefaultRecipient = $True; - EligibleApproveNotificationOnlyCritical = $False; - EligibleAssigneeNotificationAdditionalRecipient = @(); - EligibleAssigneeNotificationDefaultRecipient = $True; - EligibleAssigneeNotificationOnlyCritical = $False; - EligibleAssignmentAlertNotificationAdditionalRecipient = @(); - EligibleAssignmentAlertNotificationDefaultRecipient = $True; - EligibleAssignmentAlertNotificationOnlyCritical = $False; - EligibleAssignmentAssigneeNotificationAdditionalRecipient = @(); - EligibleAssignmentAssigneeNotificationDefaultRecipient = $True; - EligibleAssignmentAssigneeNotificationOnlyCritical = $False; - ExpireActiveAssignment = "P180D"; - ExpireEligibleAssignment = "P365D"; - PermanentActiveAssignmentisExpirationRequired = $False; - PermanentEligibleAssignmentisExpirationRequired = $False; - Credential = $Credscredential - Ensure = 'Absent' - } AADSecurityDefaults 'Defaults' { Credential = $Credscredential; diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 index ef2eeadf00..a7e5141668 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 @@ -172,7 +172,7 @@ TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } AADAuthenticationMethodPolicyFido2 'AADAuthenticationMethodPolicyFido2-Fido2' { @@ -202,7 +202,7 @@ EnforcementType = 'block' AaGuids = @() }; - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } AADAuthenticationMethodPolicySms 'AADAuthenticationMethodPolicySms-Sms' { @@ -221,7 +221,7 @@ TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } AADAuthenticationMethodPolicySoftware 'AADAuthenticationMethodPolicySoftware-SoftwareOath' { @@ -244,7 +244,7 @@ TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } AADAuthenticationMethodPolicyTemporary 'AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass' { @@ -270,20 +270,6 @@ MinimumLifetimeInMinutes = 60; State = "enabled"; } - AADAuthenticationMethodPolicyVoice 'AADAuthenticationMethodPolicyVoice-Voice' - { - Credential = $Credscredential; - Ensure = "Present"; - Id = "Voice"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyVoiceIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsOfficePhoneAllowed = $True; # Updated Property - State = "disabled"; - } AADAuthenticationMethodPolicyX509 'AADAuthenticationMethodPolicyX509-X509Certificate' { AuthenticationModeConfiguration = MSFT_MicrosoftGraphx509CertificateAuthenticationModeConfiguration{ @@ -350,12 +336,10 @@ Ensure = 'Present' Credential = $Credscredential } - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - CloudAppSecurityIsEnabled = $False; Credential = $Credscredential; DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; @@ -365,7 +349,6 @@ GrantControlOperator = "OR"; IncludeApplications = @("All"); IncludeRoles = @("Attack Payload Author"); - PersistentBrowserIsEnabled = $False; SignInFrequencyInterval = "timeBased"; SignInFrequencyIsEnabled = $True; SignInFrequencyType = "hours"; @@ -596,7 +579,7 @@ GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 new file mode 100644 index 0000000000..56c0957ebf --- /dev/null +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 @@ -0,0 +1,823 @@ + param + ( + [Parameter()] + [System.Management.Automation.PSCredential] + $Credential + ) + + Configuration Master + { + param + ( + [Parameter(Mandatory = $true)] + [System.Management.Automation.PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] + Node Localhost + { + EXOAcceptedDomain 'O365DSCDomain' + { + Identity = $Domain + DomainType = "Authoritative" + OutboundOnly = $false + Ensure = "Present" + Credential = $Credscredential + } + EXOActiveSyncDeviceAccessRule 'ConfigureActiveSyncDeviceAccessRule' + { + Identity = "ContosoPhone(DeviceOS)" + Characteristic = "DeviceOS" + QueryString = "iOS 6.1 10B146" + AccessLevel = "Allow" + Ensure = "Present" + Credential = $Credscredential + } + EXOAddressBookPolicy 'ConfigureAddressBookPolicy' + { + Name = "All Fabrikam ABP" + AddressLists = "\All Distribution Lists" + RoomList = "\All Rooms" + OfflineAddressBook = "\Default Offline Address Book" + GlobalAddressList = "\Default Global Address List" + Ensure = "Present" + Credential = $Credscredential + } + EXOAddressList 'HRUsersAddressList' + { + Name = "HR Users" + ConditionalCompany = "Contoso" + ConditionalDepartment = "HR" + ConditionalStateOrProvince = "US" + IncludedRecipients = "AllRecipients" + Ensure = "Present" + Credential = $Credscredential + } + EXOAntiPhishPolicy 'ConfigureAntiphishPolicy' + { + Identity = "Our Rule" + MakeDefault = $null + PhishThresholdLevel = 1 + EnableTargetedDomainsProtection = $null + Enabled = $null + TargetedDomainsToProtect = $null + EnableSimilarUsersSafetyTips = $null + ExcludedDomains = $null + TargetedDomainActionRecipients = $null + EnableMailboxIntelligence = $null + EnableSimilarDomainsSafetyTips = $null + AdminDisplayName = "" + AuthenticationFailAction = "MoveToJmf" + TargetedUserProtectionAction = "NoAction" + TargetedUsersToProtect = $null + EnableTargetedUserProtection = $null + ExcludedSenders = $null + EnableOrganizationDomainsProtection = $null + EnableUnusualCharactersSafetyTips = $null + TargetedUserActionRecipients = $null + Ensure = "Present" + Credential = $Credscredential + } + EXOAntiPhishRule 'ConfigureAntiPhishRule' + { + Identity = "Test Rule" + ExceptIfSentToMemberOf = $null + ExceptIfSentTo = $null + SentTo = $null + ExceptIfRecipientDomainIs = $null + Comments = $null + AntiPhishPolicy = "Our Rule" + RecipientDomainIs = $null + Enabled = $True + SentToMemberOf = @("executives@$Domain") + Ensure = "Present" + Credential = $Credscredential + } + EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' + { + Identity = "Integration Policy" + AccessRight = "DenyAccess" + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' + PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" + Description = "Engineering Group Policy" + Ensure = "Present" + Credential = $Credscredential + } + EXOAuthenticationPolicy 'ConfigureAuthenticationPolicy' + { + Identity = "Block Basic Auth" + AllowBasicAuthActiveSync = $False + AllowBasicAuthAutodiscover = $False + AllowBasicAuthImap = $False + AllowBasicAuthMapi = $False + AllowBasicAuthOfflineAddressBook = $False + AllowBasicAuthOutlookService = $False + AllowBasicAuthPop = $False + AllowBasicAuthPowerShell = $False + AllowBasicAuthReportingWebServices = $False + AllowBasicAuthRpc = $False + AllowBasicAuthSmtp = $False + AllowBasicAuthWebServices = $False + Ensure = "Present" + Credential = $Credscredential + } + EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' + { + UserName = "AdeleV" + AuthenticationPolicyName = "Block Basic Auth" + Ensure = "Present" + Credential = $Credscredential + } + EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' + { + Identity = 'Contoso.com' + AccessMethod = 'OrgWideFB' + ForestName = 'example.contoso.com' + TargetAutodiscoverEpr = 'https://contoso.com/autodiscover/autodiscover.xml' + Ensure = 'Present' + Credential = $Credscredential + } + EXOAvailabilityConfig 'ConfigureAvailabilityConfig' + { + OrgWideAccount = "adelev@$Domain" + Ensure = "Present" + Credential = $Credscredential + } + EXOClientAccessRule 'ConfigureClientAccessRule' + { + Action = "AllowAccess" + UserRecipientFilter = $null + ExceptAnyOfAuthenticationTypes = @() + ExceptUsernameMatchesAnyOfPatterns = @() + AnyOfAuthenticationTypes = @() + UsernameMatchesAnyOfPatterns = @() + Identity = "Always Allow Remote PowerShell" + Priority = 1 + AnyOfProtocols = @("RemotePowerShell") + Enabled = $True + ExceptAnyOfProtocols = @() + ExceptAnyOfClientIPAddressesOrRanges = @() + AnyOfClientIPAddressesOrRanges = @() + Ensure = "Present" + Credential = $Credscredential + } + EXODataEncryptionPolicy 'ConfigureDataEncryptionPolicy' + { + Identity = 'US Mailboxes' + Name = 'All US Mailboxes' + Description = 'All Mailboxes of users in the US' + Enabled = $true + Ensure = "Present" + Credential = $Credscredential + } + EXODistributionGroup 'DemoDG' + { + Alias = "demodg"; + BccBlocked = $False; + BypassNestedModerationEnabled = $False; + DisplayName = "My Demo DG"; + Ensure = "Present"; + HiddenGroupMembershipEnabled = $True; + ManagedBy = @("adeleV@$Domain"); + MemberDepartRestriction = "Open"; + MemberJoinRestriction = "Closed"; + ModeratedBy = @("alexW@$Domain"); + ModerationEnabled = $False; + Identity = "DemoDG"; + Name = "DemoDG"; + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain"; + PrimarySmtpAddress = "demodg@$Domain"; + RequireSenderAuthenticationEnabled = $True; + SendModerationNotifications = "Always"; + Credential = $Credscredential + } + EXODkimSigningConfig 'ConfigureDKIMSigning' + { + KeySize = 1024 + Identity = 'contoso.onmicrosoft.com' + HeaderCanonicalization = "Relaxed" + Enabled = $True + BodyCanonicalization = "Relaxed" + AdminDisplayName = "" + Ensure = "Present" + Credential = $Credscredential + } + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" + ManagedByFilter = "" + Priority = 1 + Ensure = "Present" + Credential = $Credscredential + } + EXOGlobalAddressList 'ConfigureGlobalAddressList' + { + Name = "Contoso Human Resources in Washington" + ConditionalCompany = "Contoso" + ConditionalDepartment = "Human Resources" + ConditionalStateOrProvince = "Washington" + Ensure = "Present" + Credential = $Credscredential + } + EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' + { + Identity = "Integration Policy" + AdminDisplayName = "" + EnableSafeList = $False + IPAllowList = @() + IPBlockList = @() + MakeDefault = $False + Ensure = "Present" + Credential = $Credscredential + } + EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' + { + Identity = "Integration CFP" + AddXHeaderValue = "" + AdminDisplayName = "" + BulkSpamAction = "MoveToJmf" + BulkThreshold = 7 + DownloadLink = $False + EnableEndUserSpamNotifications = $False + EnableLanguageBlockList = $False + EnableRegionBlockList = $False + EndUserSpamNotificationCustomSubject = "" + EndUserSpamNotificationFrequency = 3 + EndUserSpamNotificationLanguage = "Default" + HighConfidencePhishAction = "Quarantine" + HighConfidenceSpamAction = "MoveToJmf" + IncreaseScoreWithBizOrInfoUrls = "Off" + IncreaseScoreWithImageLinks = "Off" + IncreaseScoreWithNumericIps = "Off" + IncreaseScoreWithRedirectToOtherPort = "Off" + InlineSafetyTipsEnabled = $True + LanguageBlockList = @() + MakeDefault = $True + MarkAsSpamBulkMail = "On" + MarkAsSpamEmbedTagsInHtml = "Off" + MarkAsSpamEmptyMessages = "Off" + MarkAsSpamFormTagsInHtml = "Off" + MarkAsSpamFramesInHtml = "Off" + MarkAsSpamFromAddressAuthFail = "Off" + MarkAsSpamJavaScriptInHtml = "Off" + MarkAsSpamNdrBackscatter = "Off" + MarkAsSpamObjectTagsInHtml = "Off" + MarkAsSpamSensitiveWordList = "Off" + MarkAsSpamSpfRecordHardFail = "Off" + MarkAsSpamWebBugsInHtml = "Off" + ModifySubjectValue = "" + PhishSpamAction = "MoveToJmf" + PhishZapEnabled = $True + QuarantineRetentionPeriod = 15 + RedirectToRecipients = @() + RegionBlockList = @() + SpamAction = "MoveToJmf" + SpamZapEnabled = $True + TestModeAction = "None" + TestModeBccToRecipients = @() + Ensure = "Present" + Credential = $Credscredential + } + EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' + { + Identity = "Contoso Recipients" + Comments = "Applies to all users, except when member of HR group" + Enabled = $True + ExceptIfSentToMemberOf = "Contoso Human Resources" + HostedContentFilterPolicy = "Integration CFP" + Ensure = "Present" + Credential = $Credscredential + } + EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' + { + Identity = "Integration SFP" + ActionWhenThresholdReached = "BlockUserForToday" + AdminDisplayName = "" + AutoForwardingMode = "Automatic" + BccSuspiciousOutboundAdditionalRecipients = @() + BccSuspiciousOutboundMail = $False + NotifyOutboundSpam = $False + NotifyOutboundSpamRecipients = @() + RecipientLimitExternalPerHour = 0 + RecipientLimitInternalPerHour = 0 + RecipientLimitPerDay = 0 + Ensure = "Present" + Credential = $Credscredential + } + EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' + { + Identity = "Contoso Executives" + Comments = "Does not apply to Executives" + Enabled = $True + ExceptIfFrom = "John Smith" + HostedOutboundSpamFilterPolicy = "Integration SFP" + Ensure = "Present" + Credential = $Credscredential + } + EXOInboundConnector 'ConfigureInboundConnector' + { + Identity = "Contoso Inbound Connector" + CloudServicesMailEnabled = $True + Comment = "Inbound connector for Contoso" + ConnectorSource = "Default" + ConnectorType = "OnPremises" + Enabled = $True + RequireTls = $True + SenderDomains = "*.contoso.com" + TlsSenderCertificateName = "contoso.com" + TreatMessagesAsInternal = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOIntraOrganizationConnector 'ConfigureIntraOrganizationConnector' + { + Identity = "MainCloudConnector" + DiscoveryEndpoint = "https://ExternalDiscovery.Contoso.com" + TargetAddressDomains = "Cloud1.contoso.com","Cloud2.contoso.com" + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOJournalRule 'CreateJournalRule' + { + Enabled = $True + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" + RuleScope = "Global" + Ensure = "Present" + Credential = $Credscredential + } + EXOMailContact 'TestMailContact' + { + Alias = 'TestMailContact' + Credential = $Credscredential + DisplayName = 'My Test Contact' + Ensure = 'Present' + ExternalEmailAddress = 'SMTP:test@tailspintoys.com' + MacAttachmentFormat = 'BinHex' + MessageBodyFormat = 'TextAndHtml' + MessageFormat = 'Mime' + ModeratedBy = @() + ModerationEnabled = $false + Name = 'My Test Contact' + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" + SendModerationNotifications = 'Always' + UsePreferMessageFormat = $true + CustomAttribute1 = 'Custom Value 1' + ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + } + EXOMailTips 'OrgWideMailTips' + { + Organization = $Domain + MailTipsAllTipsEnabled = $True + MailTipsGroupMetricsEnabled = $True + MailTipsLargeAudienceThreshold = 100 + MailTipsMailboxSourcedTipsEnabled = $True + MailTipsExternalRecipientsTipsEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' + { + Identity = "IntegrationMFP" + CustomNotifications = $False + EnableExternalSenderAdminNotifications = $False + EnableFileFilter = $False + EnableInternalSenderAdminNotifications = $False + FileTypeAction = "Quarantine" + FileTypes = @("ace", "ani", "app", "cab", "docm", "exe", "iso", "jar", "jnlp", "reg", "scr", "vbe", "vbs") + QuarantineTag = "AdminOnlyAccessPolicy" + ZapEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOMalwareFilterRule 'ConfigureMalwareFilterRule' + { + Identity = "Contoso Recipients" + MalwareFilterPolicy = "IntegrationMFP" + Comments = "Apply the filter to all Contoso users" + Enabled = $True + RecipientDomainIs = "contoso.com" + Ensure = "Present" + Credential = $Credscredential + } + EXOManagementRole 'ConfigureManagementRole' + { + Name = "MyDisplayName" + Description = "" + Parent = "contoso.onmicrosoft.com\MyProfileInformation" + Ensure = "Present" + Credential = $Credscredential + } + EXOManagementRoleAssignment 'AssignManagementRole' + { + Credential = $credsCredential; + Ensure = "Present"; + Name = "MyManagementRoleAssignment"; + Role = "UserApplication"; + User = "AdeleV"; + } + EXOMessageClassification 'ConfigureMessageClassification' + { + Identity = "Contoso Message Classification" + Name = "Contoso Message Classification" + DisplayName = "Contoso Message Classification" + DisplayPrecedence = "Highest" + PermissionMenuVisible = $True + RecipientDescription = "Shown to receipients" + SenderDescription = "Shown to senders" + RetainClassificationEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOMobileDeviceMailboxPolicy 'ConfigureMobileDeviceMailboxPolicy' + { + Name = "Default" + AllowApplePushNotifications = $True + AllowBluetooth = "Allow" + AllowBrowser = $True + AllowCamera = $True + AllowConsumerEmail = $True + AllowDesktopSync = $True + AllowExternalDeviceManagement = $False + AllowGooglePushNotifications = $True + AllowHTMLEmail = $True + AllowInternetSharing = $True + AllowIrDA = $True + AllowMicrosoftPushNotifications = $True + AllowMobileOTAUpdate = $True + AllowNonProvisionableDevices = $True + AllowPOPIMAPEmail = $True + AllowRemoteDesktop = $True + AllowSimplePassword = $True + AllowSMIMEEncryptionAlgorithmNegotiation = "AllowAnyAlgorithmNegotiation" + AllowSMIMESoftCerts = $True + AllowStorageCard = $True + AllowTextMessaging = $True + AllowUnsignedApplications = $True + AllowUnsignedInstallationPackages = $True + AllowWiFi = $True + AlphanumericPasswordRequired = $False + ApprovedApplicationList = @() + AttachmentsEnabled = $True + DeviceEncryptionEnabled = $False + DevicePolicyRefreshInterval = "Unlimited" + IrmEnabled = $True + IsDefault = $True + MaxAttachmentSize = "Unlimited" + MaxCalendarAgeFilter = "All" + MaxEmailAgeFilter = "All" + MaxEmailBodyTruncationSize = "Unlimited" + MaxEmailHTMLBodyTruncationSize = "Unlimited" + MaxInactivityTimeLock = "Unlimited" + MaxPasswordFailedAttempts = "Unlimited" + MinPasswordComplexCharacters = 1 + PasswordEnabled = $False + PasswordExpiration = "Unlimited" + PasswordHistory = 0 + PasswordRecoveryEnabled = $False + RequireDeviceEncryption = $False + RequireEncryptedSMIMEMessages = $False + RequireEncryptionSMIMEAlgorithm = "TripleDES" + RequireManualSyncWhenRoaming = $False + RequireSignedSMIMEAlgorithm = "SHA1" + RequireSignedSMIMEMessages = $False + RequireStorageCardEncryption = $False + UnapprovedInROMApplicationList = @() + UNCAccessEnabled = $True + WSSAccessEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOOfflineAddressBook 'ConfigureOfflineAddressBook' + { + Name = "Integration Address Book" + AddressLists = @('\Offline Global Address List') + ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') + DiffRetentionPeriod = "30" + IsDefault = $true + Ensure = "Present" + Credential = $Credscredential + } + EXOOMEConfiguration 'ConfigureOMEConfiguration' + { + Identity = "Contoso Marketing" + BackgroundColor = "0x00FFFF00" + DisclaimerText = "Encryption security disclaimer." + EmailText = "Encrypted message enclosed." + ExternalMailExpiryInDays = 0 + IntroductionText = "You have received an encypted message" + OTPEnabled = $True + PortalText = "This portal is encrypted." + SocialIdSignIn = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' + { + Identity = 'Contoso' + Comment = 'Mail for Contoso' + HybridDomains = 'contoso.com', 'sales.contoso.com' + InboundConnector = 'Inbound to Contoso' + OrganizationGuid = 'a1bc23cb-3456-bcde-abcd-feb363cacc88' + OrganizationName = 'Contoso' + OutboundConnector = 'Outbound to Contoso' + Ensure = 'Present' + Credential = $Credscredential + } + EXOOrganizationRelationship 'ConfigureOrganizationRelationship' + { + Name = "Contoso" + ArchiveAccessEnabled = $True + DeliveryReportEnabled = $True + DomainNames = "mail.contoso.com" + Enabled = $True + FreeBusyAccessEnabled = $True + FreeBusyAccessLevel = "AvailabilityOnly" + MailboxMoveEnabled = $True + MailTipsAccessEnabled = $True + MailTipsAccessLevel = "None" + PhotosEnabled = $True + TargetApplicationUri = "mail.contoso.com" + TargetAutodiscoverEpr = "https://mail.contoso.com/autodiscover/autodiscover.svc/wssecurity" + Ensure = "Present" + Credential = $Credscredential + } + EXOOutboundConnector 'ConfigureOutboundConnector' + { + Identity = "Contoso Outbound Connector" + AllAcceptedDomains = $True + CloudServicesMailEnabled = $True + Comment = "Outbound connector to Contoso" + ConnectorSource = "Default" + ConnectorType = "OnPremises" + Enabled = $True + IsTransportRuleScoped = $True + RecipientDomains = "*.contoso.com" + RouteAllMessagesViaOnPremises = $True + TlsDomain = "*.contoso.com" + TlsSettings = "DomainValidation" + UseMxRecord = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' + { + Name = "OwaMailboxPolicy-Integration" + ActionForUnknownFileAndMIMETypes = "ForceSave" + ActiveSyncIntegrationEnabled = $True + AdditionalStorageProvidersAvailable = $True + AllAddressListsEnabled = $True + AllowCopyContactsToDeviceAddressBook = $True + AllowedFileTypes = @(".rpmsg",".xlsx",".xlsm",".xlsb",".tiff",".pptx",".pptm",".ppsx",".ppsm",".docx",".docm",".zip",".xls",".wmv",".wma",".wav",".vsd",".txt",".tif",".rtf",".pub",".ppt",".png",".pdf",".one",".mp3",".jpg",".gif",".doc",".bmp",".avi") + AllowedMimeTypes = @("image/jpeg","image/png","image/gif","image/bmp") + BlockedFileTypes = @(".settingcontent-ms",".printerexport",".appcontent-ms",".appref-ms",".vsmacros",".website",".msh2xml",".msh1xml",".diagcab",".webpnp",".ps2xml",".ps1xml",".mshxml",".gadget",".theme",".psdm1",".mhtml",".cdxml",".xbap",".vhdx",".pyzw",".pssc",".psd1",".psc2",".psc1",".msh2",".msh1",".jnlp",".aspx",".appx",".xnk",".xml",".xll",".wsh",".wsf",".wsc",".wsb",".vsw",".vst",".vss",".vhd",".vbs",".vbp",".vbe",".url",".udl",".tmp",".shs",".shb",".sct",".scr",".scf",".reg",".pyz",".pyw",".pyo",".pyc",".pst",".ps2",".ps1",".prg",".prf",".plg",".pif",".pcd",".ops",".msu",".mst",".msp",".msi",".msh",".msc",".mht",".mdz",".mdw",".mdt",".mde",".mdb",".mda",".mcf",".maw",".mav",".mau",".mat",".mas",".mar",".maq",".mam",".mag",".maf",".mad",".lnk",".ksh",".jse",".jar",".its",".isp",".ins",".inf",".htc",".hta",".hpj",".hlp",".grp",".fxp",".exe",".der",".csh",".crt",".cpl",".com",".cnt",".cmd",".chm",".cer",".bat",".bas",".asx",".asp",".app",".apk",".adp",".ade",".ws",".vb",".py",".pl",".js") + BlockedMimeTypes = @("application/x-javascript","application/javascript","application/msaccess","x-internet-signup","text/javascript","application/xml","application/prg","application/hta","text/scriplet","text/xml") + ClassicAttachmentsEnabled = $True + ConditionalAccessPolicy = "Off" + DefaultTheme = "" + DirectFileAccessOnPrivateComputersEnabled = $True + DirectFileAccessOnPublicComputersEnabled = $True + DisplayPhotosEnabled = $True + ExplicitLogonEnabled = $True + ExternalImageProxyEnabled = $True + ForceSaveAttachmentFilteringEnabled = $False + ForceSaveFileTypes = @(".vsmacros",".ps2xml",".ps1xml",".mshxml",".gadget",".psc2",".psc1",".aspx",".wsh",".wsf",".wsc",".vsw",".vst",".vss",".vbs",".vbe",".url",".tmp",".swf",".spl",".shs",".shb",".sct",".scr",".scf",".reg",".pst",".ps2",".ps1",".prg",".prf",".plg",".pif",".pcd",".ops",".mst",".msp",".msi",".msh",".msc",".mdz",".mdw",".mdt",".mde",".mdb",".mda",".maw",".mav",".mau",".mat",".mas",".mar",".maq",".mam",".mag",".maf",".mad",".lnk",".ksh",".jse",".its",".isp",".ins",".inf",".hta",".hlp",".fxp",".exe",".dir",".dcr",".csh",".crt",".cpl",".com",".cmd",".chm",".cer",".bat",".bas",".asx",".asp",".app",".adp",".ade",".ws",".vb",".js") + ForceSaveMimeTypes = @("Application/x-shockwave-flash","Application/octet-stream","Application/futuresplash","Application/x-director") + ForceWacViewingFirstOnPrivateComputers = $False + ForceWacViewingFirstOnPublicComputers = $False + FreCardsEnabled = $True + GlobalAddressListEnabled = $True + GroupCreationEnabled = $True + InstantMessagingEnabled = $True + InstantMessagingType = "Ocs" + InterestingCalendarsEnabled = $True + IRMEnabled = $True + IsDefault = $True + JournalEnabled = $True + LocalEventsEnabled = $False + LogonAndErrorLanguage = 0 + NotesEnabled = $True + NpsSurveysEnabled = $True + OnSendAddinsEnabled = $False + OrganizationEnabled = $True + OutboundCharset = "AutoDetect" + OutlookBetaToggleEnabled = $True + OWALightEnabled = $True + PersonalAccountCalendarsEnabled = $True + PhoneticSupportEnabled = $False + PlacesEnabled = $True + PremiumClientEnabled = $True + PrintWithoutDownloadEnabled = $True + PublicFoldersEnabled = $True + RecoverDeletedItemsEnabled = $True + ReferenceAttachmentsEnabled = $True + RemindersAndNotificationsEnabled = $True + ReportJunkEmailEnabled = $True + RulesEnabled = $True + SatisfactionEnabled = $True + SaveAttachmentsToCloudEnabled = $True + SearchFoldersEnabled = $True + SetPhotoEnabled = $True + SetPhotoURL = "" + SignaturesEnabled = $True + SkipCreateUnifiedGroupCustomSharepointClassification = $True + TeamSnapCalendarsEnabled = $True + TextMessagingEnabled = $True + ThemeSelectionEnabled = $True + UMIntegrationEnabled = $True + UseGB18030 = $False + UseISO885915 = $False + UserVoiceEnabled = $True + WacEditingEnabled = $True + WacExternalServicesEnabled = $True + WacOMEXEnabled = $False + WacViewingOnPrivateComputersEnabled = $True + WacViewingOnPublicComputersEnabled = $True + WeatherEnabled = $True + WebPartsFrameOptionsType = "SameOrigin" + Ensure = "Present" + Credential = $Credscredential + } + EXOPartnerApplication 'ConfigurePartnerApplication' + { + Name = "HRApp" + ApplicationIdentifier = "00000006-0000-0dd1-ac00-000000000000" + AccountType = "OrganizationalAccount" + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOPlace 'TestPlace' + { + AudioDeviceName = "MyAudioDevice"; + Capacity = 15; #Drift + City = ""; + Credential = $Credscredential + DisplayDeviceName = "DisplayDeviceName"; + Ensure = 'Present' + Identity = "MyRoom@$Domain"; + IsWheelChairAccessible = $True; + MTREnabled = $False; + ParentType = "None"; + Phone = "555-555-5555"; + Tags = @("Tag1", "Tag2"); + VideoDeviceName = "VideoDevice"; + } + EXOPolicyTipConfig 'ConfigurePolicyTipConfig' + { + Name = "en\NotifyOnly" + Value = "This message contains content that is restricted by Contoso company policy." + Ensure = "Present" + Credential = $Credscredential + } + EXOQuarantinePolicy 'ConfigureQuarantinePolicy' + { + EndUserQuarantinePermissionsValue = 87; + ESNEnabled = $False; + Identity = "$Domain\DefaultFullAccessPolicy"; + Ensure = "Present" + Credential = $Credscredential + } + EXORemoteDomain '583b0b70-b45d-401f-98a6-0e7fa8434946' + { + Identity = "Integration" + AllowedOOFType = "External" + AutoForwardEnabled = $True + AutoReplyEnabled = $True + ByteEncoderTypeFor7BitCharsets = "Undefined" + CharacterSet = "iso-8859-1" + ContentType = "MimeHtmlText" + DeliveryReportEnabled = $True + DisplaySenderName = $True + DomainName = "*" + IsInternal = $False + LineWrapSize = "Unlimited" + MeetingForwardNotificationEnabled = $False + Name = "Default" + NonMimeCharacterSet = "iso-8859-1" + PreferredInternetCodePageForShiftJis = "Undefined" + TargetDeliveryDomain = $False + TrustedMailInboundEnabled = $False + TrustedMailOutboundEnabled = $False + UseSimpleDisplayName = $False + Ensure = "Present" + Credential = $Credscredential + } + EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' + { + Name = "Integration Policy" + Description = "This policy grants end users the permission to set their options in Outlook on the web and perform other self-administration tasks." + IsDefault = $True + Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") + Ensure = "Present" + Credential = $Credscredential + } + EXORoleGroup 'ConfigureRoleGroup' + { + Name = "Contoso Role Group" + Description = "Address Lists Role for Exchange Administrators" + Members = @("Exchange Administrator") + Roles = @("Address Lists") + Ensure = "Present" + Credential = $Credscredential + } + EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' + { + Identity = "Marketing Block Attachments" + Enable = $True + Redirect = $True + RedirectAddress = "admin@$Domain" + Ensure = "Present" + Credential = $Credscredential + } + EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' + { + Identity = "Research Department Attachment Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $True + ExceptIfSentToMemberOf = "Research Department Managers" + SafeAttachmentPolicy = "Marketing Block Attachments" + SentToMemberOf = "Research Department" + Ensure = "Present" + Credential = $Credscredential + } + EXOSafeLinksPolicy 'ConfigureSafeLinksPolicy' + { + Identity = 'Marketing Block URL' + AdminDisplayName = 'Marketing Block URL' + CustomNotificationText = 'Blocked URLs for Marketing' + DeliverMessageAfterScan = $True + EnableOrganizationBranding = $True + EnableSafeLinksForTeams = $True + ScanUrls = $True + UseTranslatedNotificationText = $True + Ensure = 'Present' + Credential = $Credscredential + } + EXOSafeLinksRule 'ConfigureSafeLinksRule' + { + Identity = "Research Department URL Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $True + ExceptIfSentToMemberOf = "Research Department Managers" + SafeLinksPolicy = "Marketing Block URL" + SentToMemberOf = "Research Department" + Ensure = "Present" + Credential = $Credscredential + } + EXOSharedMailbox 'SharedMailbox' + { + DisplayName = "Test" + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain") + Ensure = "Present" + Credential = $Credscredential + } + EXOSharingPolicy 'ConfigureSharingPolicy' + { + Name = "Integration Sharing Policy" + Default = $True + Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOTransportRule 'ConfigureTransportRule' + { + Name = "Ethical Wall - Sales and Brokerage Departments" + BetweenMemberOf1 = "Sales Department" + BetweenMemberOf2 = "Brokerage Department" + ExceptIfFrom = "Tony Smith","Pilar Ackerman" + ExceptIfSubjectContainsWords = "Press Release","Corporate Communication" + RejectMessageReasonText = "Messages sent between the Sales and Brokerage departments are strictly prohibited." + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } + } + + $ConfigurationData = @{ + AllNodes = @( + @{ + NodeName = "Localhost" + PSDSCAllowPlaintextPassword = $true + } + ) + } + + # Compile and deploy configuration + try + { + Master -ConfigurationData $ConfigurationData -Credscredential $Credential + Start-DscConfiguration Master -Wait -Force -Verbose -ErrorAction Stop + } + catch + { + throw $_ + } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyAuthenticator.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyAuthenticator.Tests.ps1 index 571c082318..b687b228f7 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyAuthenticator.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyAuthenticator.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -121,7 +118,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyEmail.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyEmail.Tests.ps1 index 5a9690a10b..03554e3dfb 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyEmail.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyEmail.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -86,7 +83,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyFido2.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyFido2.Tests.ps1 index cdb5d09402..5a44697019 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyFido2.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyFido2.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -92,7 +89,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySms.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySms.Tests.ps1 index dbc3e2f1b5..434432df8b 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySms.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySms.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -85,7 +82,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySoftware.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySoftware.Tests.ps1 index 5d0df700fd..3cd28fd14d 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySoftware.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySoftware.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -85,7 +82,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyTemporary.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyTemporary.Tests.ps1 index 4f64eca856..bf484b051b 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyTemporary.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyTemporary.Tests.ps1 @@ -29,9 +29,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -89,7 +86,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyVoice.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyVoice.Tests.ps1 index 7ecb78c1b9..0b4497e9ed 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyVoice.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyVoice.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -86,7 +83,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyX509.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyX509.Tests.ps1 index 76fd4dafe5..06f7f1210f 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyX509.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyX509.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -95,7 +92,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADConditionalAccessPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADConditionalAccessPolicy.Tests.ps1 index 22aa9e4086..8d87fc35f5 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADConditionalAccessPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADConditionalAccessPolicy.Tests.ps1 @@ -296,6 +296,124 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } } + Context -Name 'Policy exists but is not in the Desired State. Not all params specified' -Fixture { + BeforeAll { + $testParams = @{ + DisplayName = 'Allin' + Ensure = 'Present' + Credential = $Credscredential + State = 'disabled' + } + + Mock -CommandName Get-MgBetaPolicyAuthenticationStrengthPolicy -MockWith { + return @{ + Id = "00000000-0000-0000-0000-000000000004" + DisplayName = "Phishing-resistant MFA" + } + } + + Mock -CommandName Get-MgBetaIdentityConditionalAccessPolicy -MockWith { + return @{ + Id = 'bcc0cf19-ee89-46f0-8e12-4b89123ee6f9' + DisplayName = 'Allin' + State = 'enabled' + Conditions = @{ + Applications = @{ + IncludeApplications = @('All') + ExcludeApplications = @('00000012-0000-0000-c000-000000000000', 'Office365') + IncludeUserActions = @('urn:user:registersecurityinfo') + } + Users = @{ + IncludeUsers = 'All' + ExcludeUsers = '76d3c3f6-8269-462b-9385-37435cb33f1e' + IncludeGroups = @('f1eb1a09-c0c2-4df4-9e69-fee01f00db31') + ExcludeGroups = @('f1eb1a09-c0c2-4df4-9e69-fee01f00db31') + IncludeRoles = @('17315797-102d-40b4-93e0-432062caca18') + ExcludeRoles = @('17315797-102d-40b4-93e0-432062caca18') + } + Platforms = @{ + IncludePlatforms = @('Android', 'IOS') + ExcludePlatforms = @('Windows', 'WindowsPhone', 'MacOS') + } + Locations = @{ + IncludeLocations = 'AllTrusted' + ExcludeLocations = '9e4ca5f3-0ba9-4257-b906-74d3038ac970' + } + Devices = @{ + IncludeDevices = @('All') + ExcludeDevices = @('Compliant', 'DomainJoined') + } + ClientAppTypes = @('Browser', 'MobileAppsAndDesktopClients') + SignInRiskLevels = @('High') + UserRiskLevels = @('High') + } + GrantControls = @{ + _Operator = 'AND' + BuiltInControls = @('Mfa', 'CompliantDevice', 'DomainJoinedDevice', 'ApprovedApplication', 'CompliantApplication') + AuthenticationStrength = @{ + Id = "00000000-0000-0000-0000-000000000004" + } + } + SessionControls = @{ + ApplicationEnforcedRestrictions = @{ + IsEnabled = $True + } + CloudAppSecurity = @{ + IsEnabled = $True + CloudAppSecurityType = 'MonitorOnly' + } + SignInFrequency = @{ + IsEnabled = $True + Type = 'Days' + Value = 5 + } + PersistentBrowser = @{ + IsEnabled = $True + Mode = 'Always' + } + } + } + } + Mock -CommandName Get-MgUser -MockWith { + return @{ + Id = '76d3c3f6-8269-462b-9385-37435cb33f1e' + UserPrincipalName = 'alexw@contoso.com' + } + } + Mock -CommandName Get-MgGroup -MockWith { + return @{ + Id = 'f1eb1a09-c0c2-4df4-9e69-fee01f00db31' + DisplayName = 'Group 01' + } + } + Mock -CommandName Get-MgBetaDirectoryRoleTemplate -MockWith { + return @{ + Id = '17315797-102d-40b4-93e0-432062caca18' + DisplayName = 'Compliance Administrator' + } + } + Mock -CommandName Get-MgBetaIdentityConditionalAccessNamedLocation -MockWith { + return @{ + Id = '9e4ca5f3-0ba9-4257-b906-74d3038ac970' + DisplayName = 'Contoso LAN' + } + } + } + + It 'Should return Present from the Get method' { + (Get-TargetResource @testParams).Ensure | Should -Be 'Present' + } + + It 'Should return false from the Test method' { + Test-TargetResource @testParams | Should -Be $false + } + + It 'Should update the settings from the Set method' { + Set-TargetResource @testParams + Should -Invoke -CommandName Update-MgBetaIdentityConditionalAccessPolicy -Exactly 1 + } + } + Context -Name 'Policy exists and is already in the Desired State' -Fixture { BeforeAll { $testParams = @{ diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 index be6fd42cef..a07cd9c6d9 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 @@ -37,6 +37,11 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-MgGroupMember -MockWith { } + Mock -CommandName Restore-MgBetaDirectoryDeletedItem -MockWith { + } + Mock -CommandName Get-MgBetaDirectoryDeletedItemAsGroup -MockWith { + } + Mock -CommandName Get-MgGroupMemberOf -MockWith { } @@ -395,7 +400,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { MailNickname = 'M365DSC' GroupTypes = @() } - + # Set-TargetResource expects object-type of answer to contain 'group' $returnData.psobject.TypeNames.insert(0, 'Group') return $returnData diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 index 96abf2b46a..999602c7c6 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 @@ -45,7 +45,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'Active Sync Device Access Rule should exist. Active Sync Device Access Rule is missing. Test should fail.' -Fixture { BeforeAll { $testParams = @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -55,7 +55,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-ActiveSyncDeviceAccessRule -MockWith { return @{ - Identity = 'ContosoDifferentPhone' + Identity = 'iOS 6.1 10B145 (WrongOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -63,7 +63,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } Mock -CommandName Set-ActiveSyncDeviceAccessRule -MockWith { return @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -89,7 +89,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'Active Sync Device Access Rule should exist. Active Sync Device Access Rule exists. Test should pass.' -Fixture { BeforeAll { $testParams = @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -99,7 +99,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-ActiveSyncDeviceAccessRule -MockWith { return @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -119,7 +119,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'Active Sync Device Access Rule should exist. Active Sync Device Access Rule exists, AccessLevel mismatch. Test should fail.' -Fixture { BeforeAll { $testParams = @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -129,7 +129,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-ActiveSyncDeviceAccessRule -MockWith { return @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Block' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -137,7 +137,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } Mock -CommandName Set-ActiveSyncDeviceAccessRule -MockWith { return @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -165,7 +165,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } $ActiveSyncDeviceAccessRule = @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOApplicationAccessPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOApplicationAccessPolicy.Tests.ps1 index 8d7b010ff8..f16ed46c56 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOApplicationAccessPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOApplicationAccessPolicy.Tests.ps1 @@ -21,6 +21,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Invoke-Command -ScriptBlock $Global:DscHelper.InitializeScript -NoNewScope BeforeAll { + $Script:ExportMode = $false $secpasswd = ConvertTo-SecureString 'test@password1' -AsPlainText -Force $Credential = New-Object System.Management.Automation.PSCredential ('tenantadmin@mydomain.com', $secpasswd) @@ -56,13 +57,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } Mock -CommandName Get-ApplicationAccessPolicy -MockWith { - return @{ - Identity = 'DifferentApplicationAccessPolicy1' - AccessRight = 'DenyAccess' - AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' - ScopeIdentity = 'Engineering Staff' - Description = 'Engineering Group Policy' - } + return $null } Mock -CommandName Set-ApplicationAccessPolicy -MockWith { @@ -101,13 +96,13 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } Mock -CommandName Get-ApplicationAccessPolicy -MockWith { - return @{ + return @(@{ Identity = 'ApplicationAccessPolicy1' AccessRight = 'DenyAccess' AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' ScopeIdentity = 'Engineering Staff' Description = 'Engineering Group Policy' - } + }) } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXODataClassification.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXODataClassification.Tests.ps1 index 38d9729b8f..e2c9b7fe7d 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXODataClassification.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXODataClassification.Tests.ps1 @@ -70,7 +70,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It 'Should call the New- cmdlet' { Set-TargetResource @testParams - Should -Invoke -CommandName 'New-DataClassification' -Exactly 1 } } @@ -107,7 +106,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It 'Should set Call into the Set-DataClassification command exactly once' { Set-TargetResource @testParams - Should -Invoke -CommandName 'Set-DataClassification' -Exactly 1 } } @@ -144,7 +142,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It 'Should call into the Remove-DataClassification cmdlet once' { Set-TargetResource @testParams - Should -Invoke -CommandName 'Remove-DataClassification' -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneAccountProtectionPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneAccountProtectionPolicy.Tests.ps1 index b1fbf8669a..19e09bc2af 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneAccountProtectionPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneAccountProtectionPolicy.Tests.ps1 @@ -267,7 +267,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should return Present from the Get method' { - (Get-TargetResource @testParams -Verbose).Ensure | Should -Be 'Present' + (Get-TargetResource @testParams).Ensure | Should -Be 'Present' } It 'Should return true from the Test method' { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.M365DSCRuleEvaluation.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.M365DSCRuleEvaluation.Tests.ps1 index b92477995b..e8699a1723 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.M365DSCRuleEvaluation.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.M365DSCRuleEvaluation.Tests.ps1 @@ -15,7 +15,7 @@ Import-Module -Name (Join-Path -Path $M365DSCTestFolder ` -Resolve) $Global:DscHelper = New-M365DscUnitTestHelper -StubModule $CmdletModule ` - -DscResource 'M365DScRuleEvaluation' -GenericStubModule $GenericStubPath + -DscResource 'M365DSCRuleEvaluation' -GenericStubModule $GenericStubPath Describe -Name $Global:DscHelper.DescribeHeader -Fixture { InModuleScope -ModuleName $Global:DscHelper.ModuleName -ScriptBlock { Invoke-Command -ScriptBlock $Global:DscHelper.InitializeScript -NoNewScope @@ -32,7 +32,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } Mock -CommandName MSFT_AADConditionalAccessPolicy\Export-TargetResource -MockWith { - return "AADConditionalAccessPolicy 'FakeItem1'{`r`n State = 'Enabled'`r`n}`r`nAADConditionalAccessPolicy 'FakeItem2'{`r`n State = 'Disabled'`r`n}" + return "AADConditionalAccessPolicy 'FakeItem1'{`r`n DisplayName='test';State = 'Enabled'`r`n}`r`nAADConditionalAccessPolicy 'FakeItem2'{`r`n DisplayName='test';State = 'Disabled'`r`n}" } Mock -CommandName New-M365DSCConnection -MockWith { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEventsPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEventsPolicy.Tests.ps1 index 1be3297a5b..46df144cb8 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEventsPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEventsPolicy.Tests.ps1 @@ -53,12 +53,19 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name "When Policy doesn't exist but should" -Fixture { BeforeAll { $testParams = @{ - Description = 'Desc' - Ensure = 'Present' - Credential = $Credential - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Ensure = 'Present' + Credential = $Credential + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled' + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; } Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { @@ -83,20 +90,34 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'Policy exists but is not in the Desired State' -Fixture { BeforeAll { $testParams = @{ - Description = 'Desc' - Ensure = 'Present' - Credential = $Credential - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Ensure = 'Present' + Credential = $Credential + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled' + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; } Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { return @{ - Description = 'Desc' - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Disabled'; #Drift + Description = 'Desc' + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Disabled'; # Drift + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; } } } @@ -119,20 +140,34 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'Policy exists and is already in the Desired State' -Fixture { BeforeAll { $testParams = @{ - Description = 'Desc' - Ensure = 'Present' - Credential = $Credential - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Ensure = 'Present' + Credential = $Credential + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled'; + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; } Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { return @{ - Description = 'Desc' - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled'; + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; } } } @@ -149,20 +184,34 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'Policy exists but it should not' -Fixture { BeforeAll { $testParams = @{ - Description = 'Desc' - Ensure = 'Absent' - Credential = $Credential - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Ensure = 'Absent' + Credential = $Credential + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled'; + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; } Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { return @{ - Description = 'Desc' - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled'; + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; } } } @@ -191,10 +240,17 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { return @{ - Description = 'Desc' - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled'; + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; } } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMobilityPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMobilityPolicy.Tests.ps1 index 95e0e9fc61..08712766e6 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMobilityPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMobilityPolicy.Tests.ps1 @@ -16,11 +16,11 @@ Import-Module -Name (Join-Path -Path $M365DSCTestFolder ` $Global:DscHelper = New-M365DscUnitTestHelper -StubModule $CmdletModule ` -DscResource 'TeamsMobilityPolicy' -GenericStubModule $GenericStubPath + Describe -Name $Global:DscHelper.DescribeHeader -Fixture { InModuleScope -ModuleName $Global:DscHelper.ModuleName -ScriptBlock { Invoke-Command -ScriptBlock $Global:DscHelper.InitializeScript -NoNewScope BeforeAll { - $secpasswd = ConvertTo-SecureString 'f@kepassword1' -AsPlainText -Force $Credential = New-Object System.Management.Automation.PSCredential ('tenantadmin@mydomain.com', $secpasswd) @@ -59,7 +59,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'The TeamsMobilityPolicy should exist but it DOES NOT' -Fixture { BeforeAll { $testParams = @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -90,7 +90,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'The TeamsMobilityPolicy exists but it SHOULD NOT' -Fixture { BeforeAll { $testParams = @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -101,7 +101,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-CsTeamsMobilityPolicy -MockWith { return @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -127,7 +127,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'The TeamsMobilityPolicy Exists and Values are already in the desired state' -Fixture { BeforeAll { $testParams = @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -138,7 +138,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-CsTeamsMobilityPolicy -MockWith { return @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -155,7 +155,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'The TeamsMobilityPolicy exists and values are NOT in the desired state' -Fixture { BeforeAll { $testParams = @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -166,7 +166,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-CsTeamsMobilityPolicy -MockWith { return @{ - MobileDialerPreference = 'FakeStringValueDrift #Drift' + MobileDialerPreference = 'Native' Description = 'FakeStringValueDrift #Drift' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -199,7 +199,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-CsTeamsMobilityPolicy -MockWith { return @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' diff --git a/Tests/Unit/Stubs/Microsoft365.psm1 b/Tests/Unit/Stubs/Microsoft365.psm1 index f5544b9f0f..dc213dcafb 100644 --- a/Tests/Unit/Stubs/Microsoft365.psm1 +++ b/Tests/Unit/Stubs/Microsoft365.psm1 @@ -1,4 +1,4 @@ -#region ExchangeOnlineManagement +# region ExchangeOnlineManagement function Get-DefaultTenantBriefingConfig { [CmdletBinding()] @@ -51825,6 +51825,26 @@ function Remove-MgBetaDirectoryAdministrativeUnitMemberByRef $Break ) } +function Restore-MgBetaDirectoryDeletedItem +{ + [CmdletBinding()] + param( + [Parameter()] + [String] + $DirectoryObjectId + ) +} + +function Get-MgBetaDirectoryDeletedItemAsGroup +{ + [CmdletBinding()] + param( + [Parameter()] + [String] + $Filter + ) +} + function Remove-MgBetaDirectoryAdministrativeUnitScopedRoleMember { [CmdletBinding()] diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyAuthenticator.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyAuthenticator.md index 14cbb25b2e..585d391c5a 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyAuthenticator.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyAuthenticator.md @@ -104,75 +104,6 @@ To authenticate with the Microsoft Graph API, this resource required the followi This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyAuthenticator "AADAuthenticationMethodPolicyAuthenticator-MicrosoftAuthenticator" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyAuthenticatorExcludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - FeatureSettings = MSFT_MicrosoftGraphmicrosoftAuthenticatorFeatureSettings{ - DisplayLocationInformationRequiredState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - CompanionAppAllowedState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - DisplayAppInformationRequiredState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - }; - Id = "MicrosoftAuthenticator"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyAuthenticatorIncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyAuthenticatorIncludeTarget{ - Id = 'Northwind Traders' - TargetType = 'group' - } - ); - IsSoftwareOathEnabled = $False; - State = "enabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { @@ -237,7 +168,7 @@ Configuration Example } ``` -### Example 3 +### Example 2 This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md index 2b5c62d557..369f220f49 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md @@ -108,82 +108,7 @@ Configuration Example TargetType = 'group' } ); - State = "enabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyEmail "AADAuthenticationMethodPolicyEmail-Email" - { - AllowExternalIdToUseEmailOtp = "enabled"; - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyEmailExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - ); - Id = "Email"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyEmailIncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyEmailIncludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - State = "disabled"; # Updated Property - } - } -} -``` - -### Example 3 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyEmail "AADAuthenticationMethodPolicyEmail-Email" - { - Ensure = "Absent"; - Id = "Email"; - State = "disabled"; # Updated Property - Credential = $credsCredential; + State = "enabled"; # Updated Property } } } diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md index 3f3d52b50c..5cdddd32b0 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md @@ -126,7 +126,7 @@ Configuration Example EnforcementType = 'block' AaGuids = @() }; - State = "enabled"; + State = "enabled"; # Updated Property } } } @@ -137,58 +137,6 @@ Configuration Example This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyFido2 "AADAuthenticationMethodPolicyFido2-Fido2" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - ); - Id = "Fido2"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyFido2IncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsAttestationEnforced = $False; - IsSelfServiceRegistrationAllowed = $True; - KeyRestrictions = MSFT_MicrosoftGraphfido2KeyRestrictions{ - IsEnforced = $False - EnforcementType = 'block' - AaGuids = @() - }; - State = "disabled"; # Updated Property - } - } -} -``` - -### Example 3 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md index 69360fefdb..a19bdaeda1 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md @@ -102,7 +102,7 @@ Configuration Example TargetType = 'group' } ); - State = "enabled"; + State = "enabled"; # Updated Property } } } @@ -113,47 +113,6 @@ Configuration Example This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicySms "AADAuthenticationMethodPolicySms-Sms" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicySmsExcludeTarget{ - Id = 'All Employees' - TargetType = 'group' - } - ); - Id = "Sms"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicySmsIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - State = "disabled"; # Updated Property - } - } -} -``` - -### Example 3 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md index b74df2e7f8..b1f4fc5af0 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md @@ -106,7 +106,7 @@ Configuration Example TargetType = 'group' } ); - State = "enabled"; + State = "enabled"; # Updated Property } } } @@ -117,51 +117,6 @@ Configuration Example This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicySoftware "AADAuthenticationMethodPolicySoftware-SoftwareOath" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - ); - Id = "SoftwareOath"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicySoftwareIncludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - State = "disabled"; # Updated Property - } - } -} -``` - -### Example 3 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyTemporary.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyTemporary.md index 23c2499d7c..c5b01b925c 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyTemporary.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyTemporary.md @@ -77,52 +77,6 @@ To authenticate with the Microsoft Graph API, this resource required the followi This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyTemporary "AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass" - { - Credential = $Credscredential; - DefaultLength = 8; - DefaultLifetimeInMinutes = 60; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyTemporaryExcludeTarget{ - Id = 'All Company' - TargetType = 'group' - } - ); - Id = "TemporaryAccessPass"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyTemporaryIncludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - ); - IsUsableOnce = $False; - MaximumLifetimeInMinutes = 480; - MinimumLifetimeInMinutes = 60; - State = "enabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { @@ -164,7 +118,7 @@ Configuration Example } ``` -### Example 3 +### Example 2 This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md index a8ae86de8f..fed2b086d0 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md @@ -73,78 +73,6 @@ To authenticate with the Microsoft Graph API, this resource required the followi This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyVoice "AADAuthenticationMethodPolicyVoice-Voice" - { - Credential = $Credscredential; - Ensure = "Present"; - Id = "Voice"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyVoiceIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsOfficePhoneAllowed = $False; - State = "disabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyVoice "AADAuthenticationMethodPolicyVoice-Voice" - { - Credential = $Credscredential; - Ensure = "Present"; - Id = "Voice"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyVoiceIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsOfficePhoneAllowed = $True; # Updated Property - State = "disabled"; - } - } -} -``` - -### Example 3 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyX509.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyX509.md index 501599cef5..85181df313 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyX509.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyX509.md @@ -104,68 +104,6 @@ To authenticate with the Microsoft Graph API, this resource required the followi This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyX509 "AADAuthenticationMethodPolicyX509-X509Certificate" - { - AuthenticationModeConfiguration = MSFT_MicrosoftGraphx509CertificateAuthenticationModeConfiguration{ - X509CertificateAuthenticationDefaultMode = 'x509CertificateSingleFactor' - Rules = @(@()) - }; - CertificateUserBindings = @( - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 1 - UserProperty = 'userPrincipalName' - X509CertificateField = 'PrincipalName' - } - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 2 - UserProperty = 'userPrincipalName' - X509CertificateField = 'RFC822Name' - } - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 3 - UserProperty = 'certificateUserIds' - X509CertificateField = 'SubjectKeyIdentifier' - } - ); - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyX509ExcludeTarget{ - Id = 'Sales Team' - TargetType = 'group' - } - ); - Id = "X509Certificate"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyX509IncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { @@ -223,7 +161,7 @@ Configuration Example } ``` -### Example 3 +### Example 2 This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. diff --git a/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md b/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md index c3283880ec..bbeec98b03 100644 --- a/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md +++ b/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md @@ -106,12 +106,10 @@ Configuration Example node localhost { - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - CloudAppSecurityIsEnabled = $False; Credential = $Credscredential; DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; @@ -121,7 +119,6 @@ Configuration Example GrantControlOperator = "OR"; IncludeApplications = @("All"); IncludeRoles = @("Attack Payload Author"); - PersistentBrowserIsEnabled = $False; SignInFrequencyInterval = "timeBased"; SignInFrequencyIsEnabled = $True; SignInFrequencyType = "hours"; @@ -150,12 +147,10 @@ Configuration Example node localhost { - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - CloudAppSecurityIsEnabled = $False; Credential = $Credscredential; DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; @@ -165,7 +160,6 @@ Configuration Example GrantControlOperator = "OR"; IncludeApplications = @("All"); IncludeRoles = @("Attack Payload Author"); - PersistentBrowserIsEnabled = $False; SignInFrequencyInterval = "timeBased"; SignInFrequencyIsEnabled = $True; SignInFrequencyType = "hours"; @@ -194,9 +188,9 @@ Configuration Example node localhost { - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - DisplayName = 'Allin-example' + DisplayName = 'Example CAP' Ensure = 'Absent' Credential = $Credscredential } diff --git a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicy.md b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicy.md index a29350a291..7e69eb68fb 100644 --- a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicy.md +++ b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicy.md @@ -7,7 +7,7 @@ | **IsSingleInstance** | Key | String | Only valid value is 'Yes'. | `Yes` | | **DisplayName** | Write | String | The name of the policy. | | | **AllowedCloudEndpoints** | Write | StringArray[] | Used to specify which Microsoft clouds an organization would like to collaborate with. By default, this value is empty. | `microsoftonline.com`, `microsoftonline.us`, `partner.microsoftonline.cn` | -| **Ensure** | Write | String | Specify if the policy should exist or not. | `Present`, `Absent` | +| **Ensure** | Write | String | Specify if the policy should exist or not. | `Present` | | **Credential** | Write | PSCredential | Credentials of the Admin | | | **ApplicationId** | Write | String | Id of the Azure Active Directory application to authenticate with. | | | **TenantId** | Write | String | Id of the Azure Active Directory tenant used for authentication. | | @@ -77,32 +77,3 @@ Configuration Example } ``` -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - -```powershell -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADCrossTenantAccessPolicy "AADCrossTenantAccessPolicy" - { - AllowedCloudEndpoints = @("microsoftonline.us"); - Credential = $Credscredential; - DisplayName = "MyXTAPPolicy"; - Ensure = "Absent"; - IsSingleInstance = "Yes"; - } - } -} -``` - diff --git a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationDefault.md b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationDefault.md index 8f0ea3db8f..4cc692275d 100644 --- a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationDefault.md +++ b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationDefault.md @@ -10,7 +10,7 @@ | **B2BDirectConnectInbound** | Write | MSFT_AADCrossTenantAccessPolicyB2BSetting | Defines your partner-specific configuration for users from other organizations accessing your resources via Azure AD B2B direct connect. | | | **B2BDirectConnectOutbound** | Write | MSFT_AADCrossTenantAccessPolicyB2BSetting | Defines your partner-specific configuration for users in your organization going outbound to access resources in another organization via Azure AD B2B direct connect. | | | **InboundTrust** | Write | MSFT_AADCrossTenantAccessPolicyInboundTrust | Determines the partner-specific configuration for trusting other Conditional Access claims from external Azure AD organizations. | | -| **Ensure** | Write | String | Specify if the instance should exist or not. | `Present`, `Absent` | +| **Ensure** | Write | String | Specify if the instance should exist or not. | `Present` | | **Credential** | Write | PSCredential | Credentials of the Admin | | | **ApplicationId** | Write | String | Id of the Azure Active Directory application to authenticate with. | | | **TenantId** | Write | String | Id of the Azure Active Directory tenant used for authentication. | | @@ -200,30 +200,3 @@ Configuration Example } ``` -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - -```powershell -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADCrossTenantAccessPolicyConfigurationDefault "AADCrossTenantAccessPolicyConfigurationDefault" - { - Credential = $Credscredential; - Ensure = "Absent"; - IsSingleInstance = "Yes"; - } - } -} -``` - diff --git a/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackage.md b/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackage.md index 37af8361ef..f3857ed52c 100644 --- a/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackage.md +++ b/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackage.md @@ -148,7 +148,7 @@ Configuration Example { AADEntitlementManagementAccessPackage 'myAccessPackage' { - DisplayName = 'General' + DisplayName = 'Integration Package' Ensure = 'Absent' Credential = $Credscredential } diff --git a/docs/docs/resources/azure-ad/AADGroup.md b/docs/docs/resources/azure-ad/AADGroup.md index 2c56cbc78a..d2d18e4949 100644 --- a/docs/docs/resources/azure-ad/AADGroup.md +++ b/docs/docs/resources/azure-ad/AADGroup.md @@ -57,7 +57,7 @@ To authenticate with the Microsoft Graph API, this resource required the followi - **Update** - - Group.Read.All, Group.ReadWrite.All, Organization.Read.All, RoleManagement.Read.Directory, RoleManagement.ReadWrite.Directory, User.Read.All, ReportSettings.ReadWrite.All + - Group.ReadWrite.All, Organization.Read.All, RoleManagement.ReadWrite.Directory, User.Read.All, ReportSettings.ReadWrite.All #### Application permissions @@ -98,7 +98,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } @@ -132,7 +132,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } diff --git a/docs/docs/resources/exchange/EXOAcceptedDomain.md b/docs/docs/resources/exchange/EXOAcceptedDomain.md index 6e3d82d2d7..c9a01aebbc 100644 --- a/docs/docs/resources/exchange/EXOAcceptedDomain.md +++ b/docs/docs/resources/exchange/EXOAcceptedDomain.md @@ -52,14 +52,73 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'contoso.com' - DomainType = "Authoritative" - Ensure = "Present" - Credential = $Credscredential + Identity = $Domain + DomainType = "Authoritative" + OutboundOnly = $false + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAcceptedDomain 'O365DSCDomain' + { + Identity = $Domain + DomainType = "Authoritative" + OutboundOnly = $true # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAcceptedDomain 'O365DSCDomain' + { + Identity = $Domain + DomainType = "Authoritative" + Ensure = "Absent" + Credential = $Credscredential } } } diff --git a/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md b/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md index 6f8c3bed60..89fa8cecdf 100644 --- a/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md +++ b/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md @@ -59,6 +59,68 @@ Configuration Example { Identity = "ContosoPhone(DeviceOS)" Characteristic = "DeviceOS" + QueryString = "iOS 6.1 10B146" + AccessLevel = "Allow" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOActiveSyncDeviceAccessRule 'ConfigureActiveSyncDeviceAccessRule' + { + Identity = "ContosoPhone(DeviceOS)" + Characteristic = "DeviceModel" # Updated Property + QueryString = "iOS 6.1 10B145" + AccessLevel = "Allow" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOActiveSyncDeviceAccessRule 'ConfigureActiveSyncDeviceAccessRule' + { + Identity = "ContosoPhone(DeviceOS)" + Characteristic = "DeviceModel" # Updated Property QueryString = "iOS 6.1 10B145" AccessLevel = "Allow" Ensure = "Present" diff --git a/docs/docs/resources/exchange/EXOAddressBookPolicy.md b/docs/docs/resources/exchange/EXOAddressBookPolicy.md index e74c5ec8ed..8c9fbd7320 100644 --- a/docs/docs/resources/exchange/EXOAddressBookPolicy.md +++ b/docs/docs/resources/exchange/EXOAddressBookPolicy.md @@ -59,10 +59,10 @@ Configuration Example EXOAddressBookPolicy 'ConfigureAddressBookPolicy' { Name = "All Fabrikam ABP" - AddressLists = "\All Fabrikam","\All Fabrikam Mailboxes","\All Fabrikam DLs","\All Fabrikam Contacts" - RoomList = "\All Fabrikam-Rooms" - OfflineAddressBook = "\Fabrikam-All-OAB" - GlobalAddressList = "\All Fabrikam" + AddressLists = "\All Distribution Lists" + RoomList = "\All Rooms" + OfflineAddressBook = "\Default Offline Address Book" + GlobalAddressList = "\Default Global Address List" Ensure = "Present" Credential = $Credscredential } @@ -70,3 +70,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressBookPolicy 'ConfigureAddressBookPolicy' + { + Name = "All Fabrikam ABP" + AddressLists = "\All Users" + RoomList = "\All Rooms" + OfflineAddressBook = "\Default Offline Address Book" + GlobalAddressList = "\Default Global Address List" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressBookPolicy 'ConfigureAddressBookPolicy' + { + Name = "All Fabrikam ABP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAddressList.md b/docs/docs/resources/exchange/EXOAddressList.md index 942e94f8bb..db9260e246 100644 --- a/docs/docs/resources/exchange/EXOAddressList.md +++ b/docs/docs/resources/exchange/EXOAddressList.md @@ -86,3 +86,61 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressList 'HRUsersAddressList' + { + Name = "HR Users" + ConditionalCompany = "Contoso" + ConditionalDepartment = "HR2" # Updated Property + ConditionalStateOrProvince = "US" + IncludedRecipients = "AllRecipients" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressList 'HRUsersAddressList' + { + Name = "HR Users" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAntiPhishPolicy.md b/docs/docs/resources/exchange/EXOAntiPhishPolicy.md index 1c27b27741..af3d8f579b 100644 --- a/docs/docs/resources/exchange/EXOAntiPhishPolicy.md +++ b/docs/docs/resources/exchange/EXOAntiPhishPolicy.md @@ -114,3 +114,95 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishPolicy 'ConfigureAntiphishPolicy' + { + Identity = "Our Rule" + MakeDefault = $null + PhishThresholdLevel = 2 # Updated Property + EnableTargetedDomainsProtection = $null + Enabled = $null + TargetedDomainsToProtect = $null + EnableSimilarUsersSafetyTips = $null + ExcludedDomains = $null + TargetedDomainActionRecipients = $null + EnableMailboxIntelligence = $null + EnableSimilarDomainsSafetyTips = $null + AdminDisplayName = "" + AuthenticationFailAction = "MoveToJmf" + TargetedUserProtectionAction = "NoAction" + TargetedUsersToProtect = $null + EnableTargetedUserProtection = $null + ExcludedSenders = $null + EnableOrganizationDomainsProtection = $null + EnableUnusualCharactersSafetyTips = $null + TargetedUserActionRecipients = $null + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishPolicy 'ConfigureAntiphishPolicy' + { + Identity = "Our Rule" + MakeDefault = $null + PhishThresholdLevel = 2 # Updated Property + EnableTargetedDomainsProtection = $null + Enabled = $null + TargetedDomainsToProtect = $null + EnableSimilarUsersSafetyTips = $null + ExcludedDomains = $null + TargetedDomainActionRecipients = $null + EnableMailboxIntelligence = $null + EnableSimilarDomainsSafetyTips = $null + AdminDisplayName = "" + AuthenticationFailAction = "MoveToJmf" + TargetedUserProtectionAction = "NoAction" + TargetedUsersToProtect = $null + EnableTargetedUserProtection = $null + ExcludedSenders = $null + EnableOrganizationDomainsProtection = $null + EnableUnusualCharactersSafetyTips = $null + TargetedUserActionRecipients = $null + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAntiPhishRule.md b/docs/docs/resources/exchange/EXOAntiPhishRule.md index 46f2016d29..f58f4814ba 100644 --- a/docs/docs/resources/exchange/EXOAntiPhishRule.md +++ b/docs/docs/resources/exchange/EXOAntiPhishRule.md @@ -60,6 +60,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAntiPhishRule 'ConfigureAntiPhishRule' @@ -73,8 +74,7 @@ Configuration Example AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True - SentToMemberOf = @("msteams_bb15d4@contoso.onmicrosoft.com") - Priority = 1 + SentToMemberOf = @("executives@$Domain") Ensure = "Present" Credential = $Credscredential } @@ -82,3 +82,68 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOAntiPhishRule 'ConfigureAntiPhishRule' + { + Identity = "Test Rule" + ExceptIfSentToMemberOf = $null + ExceptIfSentTo = $null + SentTo = $null + ExceptIfRecipientDomainIs = $null + Comments = "This is an updated comment." # Updated Property + AntiPhishPolicy = "Our Rule" + RecipientDomainIs = $null + Enabled = $True + SentToMemberOf = @("executives@$Domain") + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishRule 'ConfigureAntiPhishRule' + { + Identity = "Test Rule" + AntiPhishPolicy = "Our Rule" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md b/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md index d84d3f17c2..5db92e5322 100644 --- a/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md +++ b/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md @@ -54,14 +54,15 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' { - Identity = "Global" + Identity = "Integration Policy" AccessRight = "DenyAccess" - AppID = "3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93" - PolicyScopeGroupId = "Engineering Staff" + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' + PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" Description = "Engineering Group Policy" Ensure = "Present" Credential = $Credscredential @@ -70,3 +71,65 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' + { + Identity = "Integration Policy" + AccessRight = "DenyAccess" + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' + PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" + Description = "Engineering Group Policy Updated" # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' + { + Identity = "Integration Policy" + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAuthenticationPolicy.md b/docs/docs/resources/exchange/EXOAuthenticationPolicy.md index ddf4a3d03d..c873435a65 100644 --- a/docs/docs/resources/exchange/EXOAuthenticationPolicy.md +++ b/docs/docs/resources/exchange/EXOAuthenticationPolicy.md @@ -85,3 +85,81 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicy 'ConfigureAuthenticationPolicy' + { + Identity = "Block Basic Auth" + AllowBasicAuthActiveSync = $False + AllowBasicAuthAutodiscover = $False + AllowBasicAuthImap = $False + AllowBasicAuthMapi = $True # Updated Property + AllowBasicAuthOfflineAddressBook = $False + AllowBasicAuthOutlookService = $False + AllowBasicAuthPop = $False + AllowBasicAuthPowerShell = $False + AllowBasicAuthReportingWebServices = $False + AllowBasicAuthRpc = $False + AllowBasicAuthSmtp = $False + AllowBasicAuthWebServices = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicy 'ConfigureAuthenticationPolicy' + { + Identity = "Block Basic Auth" + AllowBasicAuthActiveSync = $False + AllowBasicAuthAutodiscover = $False + AllowBasicAuthImap = $False + AllowBasicAuthMapi = $True # Updated Property + AllowBasicAuthOfflineAddressBook = $False + AllowBasicAuthOutlookService = $False + AllowBasicAuthPop = $False + AllowBasicAuthPowerShell = $False + AllowBasicAuthReportingWebServices = $False + AllowBasicAuthRpc = $False + AllowBasicAuthSmtp = $False + AllowBasicAuthWebServices = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md b/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md index 24a24686de..96b4ec6b82 100644 --- a/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md +++ b/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md @@ -44,7 +44,7 @@ Configuration Example param( [Parameter(Mandatory = $true)] [PSCredential] - $EXOAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC @@ -52,10 +52,63 @@ Configuration Example { EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' { - UserName = "John.Smith" - AuthenticationPolicyName = "Test Policy" + UserName = "AdeleV" + AuthenticationPolicyName = "Block Basic Auth" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 2 + + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' + { + UserName = "AdeleV" + AuthenticationPolicyName = "Test Policy" # Updaqted Property Ensure = "Present" - Credential = $EXOAdmin + Credential = $Credscredential + } + } +} +``` + +### Example 3 + + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' + { + UserName = "AdeleV" + AuthenticationPolicyName = "Test Policy" + Ensure = "Absent" + Credential = $Credscredential } } } diff --git a/docs/docs/resources/exchange/EXOAvailabilityAddressSpace.md b/docs/docs/resources/exchange/EXOAvailabilityAddressSpace.md index 1fb3bfd413..f9230a9cd6 100644 --- a/docs/docs/resources/exchange/EXOAvailabilityAddressSpace.md +++ b/docs/docs/resources/exchange/EXOAvailabilityAddressSpace.md @@ -70,3 +70,64 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' + { + Identity = 'Contoso.com' + AccessMethod = 'OrgWideFBBasic' # Updated Property + ForestName = 'example.contoso.com' + TargetAutodiscoverEpr = 'https://contoso.com/autodiscover/autodiscover.xml' + Ensure = 'Present' + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' + { + Identity = 'Contoso.com' + Ensure = 'Absent' + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAvailabilityConfig.md b/docs/docs/resources/exchange/EXOAvailabilityConfig.md index cbe46c3d3c..ce63313322 100644 --- a/docs/docs/resources/exchange/EXOAvailabilityConfig.md +++ b/docs/docs/resources/exchange/EXOAvailabilityConfig.md @@ -50,11 +50,12 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAvailabilityConfig 'ConfigureAvailabilityConfig' { - OrgWideAccount = "admin@contoso.onmicrosoft.com" + OrgWideAccount = "adelev@$Domain" Ensure = "Present" Credential = $Credscredential } @@ -62,3 +63,61 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOAvailabilityConfig 'ConfigureAvailabilityConfig' + { + OrgWideAccount = "alexW@$Domain" # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOAvailabilityConfig 'ConfigureAvailabilityConfig' + { + OrgWideAccount = "alexW@$Domain" # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOCASMailboxPlan.md b/docs/docs/resources/exchange/EXOCASMailboxPlan.md index cf19d2a738..44b9628e75 100644 --- a/docs/docs/resources/exchange/EXOCASMailboxPlan.md +++ b/docs/docs/resources/exchange/EXOCASMailboxPlan.md @@ -60,8 +60,8 @@ Configuration Example { ActiveSyncEnabled = $True OwaMailboxPolicy = "OwaMailboxPolicy-Default" - PopEnabled = $True - Identity = $CASIdentity + PopEnabled = $False # Updated Property + Identity = 'ExchangeOnlineEnterprise' ImapEnabled = $True Ensure = "Present" Credential = $Credscredential diff --git a/docs/docs/resources/exchange/EXOCASMailboxSettings.md b/docs/docs/resources/exchange/EXOCASMailboxSettings.md index c0da9659ab..d4453b4317 100644 --- a/docs/docs/resources/exchange/EXOCASMailboxSettings.md +++ b/docs/docs/resources/exchange/EXOCASMailboxSettings.md @@ -97,7 +97,7 @@ Configuration Example ActiveSyncSuppressReadReceipt = $False EwsEnabled = $True Identity = 'AdeleV' - ImapEnabled = $False + ImapEnabled = $True # Updated Property ImapForceICalForCalendarRetrievalOption = $False ImapMessagesRetrievalMimeFormat = 'BestBodyFormat' ImapSuppressReadReceipt = $False diff --git a/docs/docs/resources/exchange/EXOCalendarProcessing.md b/docs/docs/resources/exchange/EXOCalendarProcessing.md index c4c102dcb4..39eb464dec 100644 --- a/docs/docs/resources/exchange/EXOCalendarProcessing.md +++ b/docs/docs/resources/exchange/EXOCalendarProcessing.md @@ -88,13 +88,14 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOCalendarProcessing "CalendarProcessing" { AddAdditionalResponse = $False; AddNewRequestsTentatively = $True; - AddOrganizerToSubject = $True; + AddOrganizerToSubject = $False; # Updated Property AllBookInPolicy = $True; AllowConflicts = $False; AllowRecurringMeetings = $True; @@ -116,7 +117,7 @@ Configuration Example EnforceSchedulingHorizon = $True; Ensure = "Present"; ForwardRequestsToDelegates = $True; - Identity = "John.Smith"; + Identity = "AdeleV"; MaximumConflictInstances = 0; MaximumDurationInMinutes = 1440; MinimumDurationInMinutes = 0; @@ -127,7 +128,7 @@ Configuration Example RemoveForwardedMeetingNotifications = $False; RemoveOldMeetingMessages = $False; RemovePrivateProperty = $True; - RequestInPolicy = @("Bob.Houle@$OrganizationName"); + RequestInPolicy = @("AlexW@$Domain"); ResourceDelegates = @(); ScheduleOnlyDuringWorkHours = $False; TentativePendingApproval = $True; diff --git a/docs/docs/resources/exchange/EXOClientAccessRule.md b/docs/docs/resources/exchange/EXOClientAccessRule.md index 7c0c19b62d..57cdcb8a6f 100644 --- a/docs/docs/resources/exchange/EXOClientAccessRule.md +++ b/docs/docs/resources/exchange/EXOClientAccessRule.md @@ -87,7 +87,74 @@ Configuration Example ExceptAnyOfClientIPAddressesOrRanges = @() AnyOfClientIPAddressesOrRanges = @() Ensure = "Present" - Credential = $GlobalAdmin + Credential = $Credscredential + } + } +} +``` + +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOClientAccessRule 'ConfigureClientAccessRule' + { + Action = "AllowAccess" + UserRecipientFilter = $null + ExceptAnyOfAuthenticationTypes = @() + ExceptUsernameMatchesAnyOfPatterns = @() + AnyOfAuthenticationTypes = @() + UsernameMatchesAnyOfPatterns = @() + Identity = "Always Allow Remote PowerShell" + Priority = 1 + AnyOfProtocols = @("RemotePowerShell") + Enabled = $False # Updated Property + ExceptAnyOfProtocols = @() + ExceptAnyOfClientIPAddressesOrRanges = @() + AnyOfClientIPAddressesOrRanges = @() + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOClientAccessRule 'ConfigureClientAccessRule' + { + Action = "AllowAccess" + Identity = "Always Allow Remote PowerShell" + Ensure = "Absent" + Credential = $Credscredential } } } diff --git a/docs/docs/resources/exchange/EXODataClassification.md b/docs/docs/resources/exchange/EXODataClassification.md index c91080f60c..b477a7473c 100644 --- a/docs/docs/resources/exchange/EXODataClassification.md +++ b/docs/docs/resources/exchange/EXODataClassification.md @@ -58,13 +58,13 @@ Configuration Example { EXODataClassification 'ConfigureDataClassification' { - Identity = 'Contoso Confidential' - Name = 'Contoso Confidentiel' - Description = 'Ce message contient des informations confidentielles.' - Locale = 'fr' - IsDefault = $true - Ensure = "Present" - Credential = $Credscredential + Description = "Detects formatted and unformatted Canadian social insurance number."; + Ensure = "Present"; + Identity = "a2f29c85-ecb8-4514-a610-364790c0773e"; + IsDefault = $True; + Locale = "en-US"; + Name = "Canada Social Insurance Number"; + Credential = $Credscredential } } } diff --git a/docs/docs/resources/exchange/EXODataEncryptionPolicy.md b/docs/docs/resources/exchange/EXODataEncryptionPolicy.md index d1e2cb3ac3..623f2893c4 100644 --- a/docs/docs/resources/exchange/EXODataEncryptionPolicy.md +++ b/docs/docs/resources/exchange/EXODataEncryptionPolicy.md @@ -70,3 +70,60 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODataEncryptionPolicy 'ConfigureDataEncryptionPolicy' + { + Identity = 'US Mailboxes' + Name = 'All US Mailboxes' + Description = 'All Mailboxes of users in the US. Updated' # Updated Property + Enabled = $true + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODataEncryptionPolicy 'ConfigureDataEncryptionPolicy' + { + Identity = 'US Mailboxes' + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXODistributionGroup.md b/docs/docs/resources/exchange/EXODistributionGroup.md index 5fde836832..d690f1b53f 100644 --- a/docs/docs/resources/exchange/EXODistributionGroup.md +++ b/docs/docs/resources/exchange/EXODistributionGroup.md @@ -88,10 +88,11 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credsAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXODistributionGroup 'DemoDG' @@ -102,18 +103,93 @@ Configuration Example DisplayName = "My Demo DG"; Ensure = "Present"; HiddenGroupMembershipEnabled = $True; - ManagedBy = @("john.smith@contoso.com"); + ManagedBy = @("adeleV@$Domain"); MemberDepartRestriction = "Open"; MemberJoinRestriction = "Closed"; - ModeratedBy = @("admin@contoso.com"); + ModeratedBy = @("alexW@$Domain"); ModerationEnabled = $False; Identity = "DemoDG"; Name = "DemoDG"; - OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/contoso.com"; - PrimarySmtpAddress = "demodg@contoso.com"; + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain"; + PrimarySmtpAddress = "demodg@$Domain"; RequireSenderAuthenticationEnabled = $True; SendModerationNotifications = "Always"; - Credential = $credsAdmin + Credential = $Credscredential + } + } +} +``` + +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXODistributionGroup 'DemoDG' + { + Alias = "demodg"; + BccBlocked = $True; # Updated Property + BypassNestedModerationEnabled = $False; + DisplayName = "My Demo DG"; + Ensure = "Present"; + HiddenGroupMembershipEnabled = $True; + ManagedBy = @("adeleV@$Domain"); + MemberDepartRestriction = "Open"; + MemberJoinRestriction = "Closed"; + ModeratedBy = @("alexW@$Domain"); + ModerationEnabled = $False; + Identity = "DemoDG"; + Name = "DemoDG"; + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain"; + PrimarySmtpAddress = "demodg@$Domain"; + RequireSenderAuthenticationEnabled = $True; + SendModerationNotifications = "Always"; + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + $Domain = $Credscredential.Username.Split('@')[1] + EXODistributionGroup 'DemoDG' + { + DisplayName = "My Demo DG"; + Ensure = "Absent"; + Identity = "DemoDG"; + Name = "DemoDG"; + Credential = $Credscredential } } } diff --git a/docs/docs/resources/exchange/EXODkimSigningConfig.md b/docs/docs/resources/exchange/EXODkimSigningConfig.md index 14020ab62d..c4811b04ff 100644 --- a/docs/docs/resources/exchange/EXODkimSigningConfig.md +++ b/docs/docs/resources/exchange/EXODkimSigningConfig.md @@ -72,3 +72,62 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODkimSigningConfig 'ConfigureDKIMSigning' + { + KeySize = 1024 + Identity = 'contoso.onmicrosoft.com' + HeaderCanonicalization = "Relaxed" + Enabled = $False # Updated Property + BodyCanonicalization = "Relaxed" + AdminDisplayName = "" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODkimSigningConfig 'ConfigureDKIMSigning' + { + Identity = 'contoso.onmicrosoft.com' + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOEmailAddressPolicy.md b/docs/docs/resources/exchange/EXOEmailAddressPolicy.md index b3330dccbf..5fe66dd421 100644 --- a/docs/docs/resources/exchange/EXOEmailAddressPolicy.md +++ b/docs/docs/resources/exchange/EXOEmailAddressPolicy.md @@ -53,15 +53,16 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { - Name = "Default Policy" - EnabledEmailAddressTemplates = @("SMTP:@contoso.onmicrosoft.com") - EnabledPrimarySMTPAddressTemplate = "@contoso.onmicrosoft.com" + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" ManagedByFilter = "" - Priority = "Lowest" + Priority = 1 Ensure = "Present" Credential = $Credscredential } @@ -69,3 +70,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" + ManagedByFilter = "" + Priority = 2 # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + $Domain = $Credscredential.Username.Split('@')[1] + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOGlobalAddressList.md b/docs/docs/resources/exchange/EXOGlobalAddressList.md index 2f1b602ce2..e414e0b0cb 100644 --- a/docs/docs/resources/exchange/EXOGlobalAddressList.md +++ b/docs/docs/resources/exchange/EXOGlobalAddressList.md @@ -85,3 +85,62 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOGlobalAddressList 'ConfigureGlobalAddressList' + { + Name = "Contoso Human Resources in Washington" + ConditionalCompany = "Contoso" + ConditionalDepartment = "Finances" # Updated Property + ConditionalStateOrProvince = "Washington" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOGlobalAddressList 'ConfigureGlobalAddressList' + { + Name = "Contoso Human Resources in Washington" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOGroupSettings.md b/docs/docs/resources/exchange/EXOGroupSettings.md index 0f5310378c..beb5db2d4f 100644 --- a/docs/docs/resources/exchange/EXOGroupSettings.md +++ b/docs/docs/resources/exchange/EXOGroupSettings.md @@ -96,11 +96,12 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credential + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOGroupSettings 'TestGroup' @@ -111,8 +112,8 @@ Configuration Example AuditLogAgeLimit = "90.00:00:00"; AutoSubscribeNewMembers = $False; CalendarMemberReadOnly = $False; - ConnectorsEnabled = $True; - Credential = $credential; + ConnectorsEnabled = $False; # Updated Property + Credential = $Credscredential; HiddenFromAddressListsEnabled = $True; HiddenFromExchangeClientsEnabled = $True; InformationBarrierMode = "Open"; @@ -121,7 +122,7 @@ Configuration Example MaxSendSize = "35 MB (36,700,160 bytes)"; ModerationEnabled = $False; Notes = "My Notes"; - PrimarySmtpAddress = "TestGroup@contoso.com"; + PrimarySmtpAddress = "TestGroup@$Domain"; RequireSenderAuthenticationEnabled = $True; SubscriptionEnabled = $False; } diff --git a/docs/docs/resources/exchange/EXOHostedConnectionFilterPolicy.md b/docs/docs/resources/exchange/EXOHostedConnectionFilterPolicy.md index a3e585de5f..448373b0b7 100644 --- a/docs/docs/resources/exchange/EXOHostedConnectionFilterPolicy.md +++ b/docs/docs/resources/exchange/EXOHostedConnectionFilterPolicy.md @@ -59,7 +59,7 @@ Configuration Example { EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' { - Identity = "Default" + Identity = "Integration Policy" AdminDisplayName = "" EnableSafeList = $False IPAllowList = @() @@ -72,3 +72,62 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' + { + Identity = "Integration Policy" + AdminDisplayName = "" + EnableSafeList = $True # Updated Property + IPAllowList = @() + IPBlockList = @() + MakeDefault = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' + { + Identity = "Integration Policy" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOHostedContentFilterPolicy.md b/docs/docs/resources/exchange/EXOHostedContentFilterPolicy.md index 6c88da850b..7bbe7e47f3 100644 --- a/docs/docs/resources/exchange/EXOHostedContentFilterPolicy.md +++ b/docs/docs/resources/exchange/EXOHostedContentFilterPolicy.md @@ -105,7 +105,7 @@ Configuration Example { EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' { - Identity = "Default" + Identity = "Integration CFP" AddXHeaderValue = "" AdminDisplayName = "" BulkSpamAction = "MoveToJmf" @@ -155,3 +155,99 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' + { + Identity = "Integration CFP" + AddXHeaderValue = "" + AdminDisplayName = "" + BulkSpamAction = "MoveToJmf" + BulkThreshold = 7 + DownloadLink = $True # Updated Property + EnableEndUserSpamNotifications = $False + EnableLanguageBlockList = $False + EnableRegionBlockList = $False + EndUserSpamNotificationCustomSubject = "" + EndUserSpamNotificationFrequency = 3 + EndUserSpamNotificationLanguage = "Default" + HighConfidencePhishAction = "Quarantine" + HighConfidenceSpamAction = "MoveToJmf" + IncreaseScoreWithBizOrInfoUrls = "Off" + IncreaseScoreWithImageLinks = "Off" + IncreaseScoreWithNumericIps = "Off" + IncreaseScoreWithRedirectToOtherPort = "Off" + InlineSafetyTipsEnabled = $True + LanguageBlockList = @() + MakeDefault = $True + MarkAsSpamBulkMail = "On" + MarkAsSpamEmbedTagsInHtml = "Off" + MarkAsSpamEmptyMessages = "Off" + MarkAsSpamFormTagsInHtml = "Off" + MarkAsSpamFramesInHtml = "Off" + MarkAsSpamFromAddressAuthFail = "Off" + MarkAsSpamJavaScriptInHtml = "Off" + MarkAsSpamNdrBackscatter = "Off" + MarkAsSpamObjectTagsInHtml = "Off" + MarkAsSpamSensitiveWordList = "Off" + MarkAsSpamSpfRecordHardFail = "Off" + MarkAsSpamWebBugsInHtml = "Off" + ModifySubjectValue = "" + PhishSpamAction = "MoveToJmf" + PhishZapEnabled = $True + QuarantineRetentionPeriod = 15 + RedirectToRecipients = @() + RegionBlockList = @() + SpamAction = "MoveToJmf" + SpamZapEnabled = $True + TestModeAction = "None" + TestModeBccToRecipients = @() + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' + { + Identity = "Integration CFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOHostedContentFilterRule.md b/docs/docs/resources/exchange/EXOHostedContentFilterRule.md index 97b8ccae2d..132f2f6de7 100644 --- a/docs/docs/resources/exchange/EXOHostedContentFilterRule.md +++ b/docs/docs/resources/exchange/EXOHostedContentFilterRule.md @@ -69,7 +69,7 @@ Configuration Example Comments = "Applies to all users, except when member of HR group" Enabled = $True ExceptIfSentToMemberOf = "Contoso Human Resources" - HostedContentFilterPolicy = "Default" + HostedContentFilterPolicy = "Integration CFP" Ensure = "Present" Credential = $Credscredential } @@ -77,3 +77,64 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' + { + Identity = "Contoso Recipients" + Comments = "Applies to all users, except when member of HR group" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Contoso Human Resources" + HostedContentFilterPolicy = "Integration CFP" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' + { + Identity = "Contoso Recipients" + HostedContentFilterPolicy = "Integration CFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterPolicy.md b/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterPolicy.md index e07ebec6d2..74a43374f0 100644 --- a/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterPolicy.md +++ b/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterPolicy.md @@ -64,7 +64,7 @@ Configuration Example { EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' { - Identity = "Default" + Identity = "Integration SFP" ActionWhenThresholdReached = "BlockUserForToday" AdminDisplayName = "" AutoForwardingMode = "Automatic" @@ -82,3 +82,67 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' + { + Identity = "Integration SFP" + ActionWhenThresholdReached = "BlockUserForToday" + AdminDisplayName = "" + AutoForwardingMode = "Automatic" + BccSuspiciousOutboundAdditionalRecipients = @() + BccSuspiciousOutboundMail = $False + NotifyOutboundSpam = $False + NotifyOutboundSpamRecipients = @() + RecipientLimitExternalPerHour = 0 + RecipientLimitInternalPerHour = 1 # Updated Property + RecipientLimitPerDay = 0 + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' + { + Identity = "Integration SFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterRule.md b/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterRule.md index 46287b09e6..1bd032a9a1 100644 --- a/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterRule.md +++ b/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterRule.md @@ -68,8 +68,8 @@ Configuration Example Identity = "Contoso Executives" Comments = "Does not apply to Executives" Enabled = $True - ExceptIfFrom = "Elizabeth Brunner" - HostedOutboundSpamFilterPolicy = "Default" + ExceptIfFrom = "John Smith" + HostedOutboundSpamFilterPolicy = "Integration SFP" Ensure = "Present" Credential = $Credscredential } @@ -77,3 +77,65 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' + { + Identity = "Contoso Executives" + Comments = "Does not apply to Executives" + Enabled = $False # Updated Property + ExceptIfFrom = "John Smith" + HostedOutboundSpamFilterPolicy = "Integration SFP" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' + { + Identity = "Contoso Executives" + Enabled = $False # Updated Property + HostedOutboundSpamFilterPolicy = "Integration SFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOInboundConnector.md b/docs/docs/resources/exchange/EXOInboundConnector.md index cd9a5b7152..1bc2741078 100644 --- a/docs/docs/resources/exchange/EXOInboundConnector.md +++ b/docs/docs/resources/exchange/EXOInboundConnector.md @@ -87,3 +87,68 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOInboundConnector 'ConfigureInboundConnector' + { + Identity = "Contoso Inbound Connector" + CloudServicesMailEnabled = $True + Comment = "Inbound connector for Contoso" + ConnectorSource = "Default" + ConnectorType = "OnPremises" + Enabled = $False # Updated Property + RequireTls = $True + SenderDomains = "*.contoso.com" + TlsSenderCertificateName = "contoso.com" + TreatMessagesAsInternal = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOInboundConnector 'ConfigureInboundConnector' + { + Identity = "Contoso Inbound Connector" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOIntraOrganizationConnector.md b/docs/docs/resources/exchange/EXOIntraOrganizationConnector.md index fd85c9dff3..6bcf11c824 100644 --- a/docs/docs/resources/exchange/EXOIntraOrganizationConnector.md +++ b/docs/docs/resources/exchange/EXOIntraOrganizationConnector.md @@ -69,3 +69,62 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOIntraOrganizationConnector 'ConfigureIntraOrganizationConnector' + { + Identity = "MainCloudConnector" + DiscoveryEndpoint = "https://ExternalDiscovery.Contoso.com" + TargetAddressDomains = "Cloud1.contoso.com","Cloud2.contoso.com" + Enabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOIntraOrganizationConnector 'ConfigureIntraOrganizationConnector' + { + Identity = "MainCloudConnector" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOJournalRule.md b/docs/docs/resources/exchange/EXOJournalRule.md index 3205a2a1a8..548c920cbf 100644 --- a/docs/docs/resources/exchange/EXOJournalRule.md +++ b/docs/docs/resources/exchange/EXOJournalRule.md @@ -53,13 +53,14 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOJournalRule 'CreateJournalRule' { Enabled = $True - JournalEmailAddress = "John.Smith@contoso.com" - Name = "Send to John" + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" RuleScope = "Global" Ensure = "Present" Credential = $Credscredential @@ -68,3 +69,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOJournalRule 'CreateJournalRule' + { + Enabled = $False # Updated Property + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" + RuleScope = "Global" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOJournalRule 'CreateJournalRule' + { + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOMailContact.md b/docs/docs/resources/exchange/EXOMailContact.md index e7cc1779c4..063608382f 100644 --- a/docs/docs/resources/exchange/EXOMailContact.md +++ b/docs/docs/resources/exchange/EXOMailContact.md @@ -85,6 +85,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailContact 'TestMailContact' @@ -100,7 +101,7 @@ Configuration Example ModeratedBy = @() ModerationEnabled = $false Name = 'My Test Contact' - OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$OrganizationName" + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" SendModerationNotifications = 'Always' UsePreferMessageFormat = $true CustomAttribute1 = 'Custom Value 1' @@ -110,3 +111,80 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailContact 'TestMailContact' + { + Alias = 'TestMailContact' + Credential = $Credscredential + DisplayName = 'My Test Contact' + Ensure = 'Present' + ExternalEmailAddress = 'SMTP:test@tailspintoys.com' + MacAttachmentFormat = 'BinHex' + MessageBodyFormat = 'TextAndHtml' + MessageFormat = 'Mime' + ModeratedBy = @() + ModerationEnabled = $false + Name = 'My Test Contact' + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" + SendModerationNotifications = 'Always' + UsePreferMessageFormat = $false # Updated Property + CustomAttribute1 = 'Custom Value 1' + ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailContact 'TestMailContact' + { + Alias = 'TestMailContact' + Credential = $Credscredential + DisplayName = 'My Test Contact' + Ensure = 'Absent' + ExternalEmailAddress = 'SMTP:test@tailspintoys.com' + Name = 'My Test Contact' + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" + SendModerationNotifications = 'Always' + UsePreferMessageFormat = $false # Updated Property + CustomAttribute1 = 'Custom Value 1' + ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOMailTips.md b/docs/docs/resources/exchange/EXOMailTips.md index c567d10c8e..7c46aa87cd 100644 --- a/docs/docs/resources/exchange/EXOMailTips.md +++ b/docs/docs/resources/exchange/EXOMailTips.md @@ -54,11 +54,12 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailTips 'OrgWideMailTips' { - Organization = "contoso.com" + Organization = $Domain MailTipsAllTipsEnabled = $True MailTipsGroupMetricsEnabled = $True MailTipsLargeAudienceThreshold = 100 @@ -71,3 +72,64 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailTips 'OrgWideMailTips' + { + Organization = $Domain + MailTipsAllTipsEnabled = $True + MailTipsGroupMetricsEnabled = $False # Updated Property + MailTipsLargeAudienceThreshold = 100 + MailTipsMailboxSourcedTipsEnabled = $True + MailTipsExternalRecipientsTipsEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailTips 'OrgWideMailTips' + { + Organization = $Domain + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md b/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md index cc7d993754..5357252f4a 100644 --- a/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md +++ b/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md @@ -62,17 +62,26 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { - EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + EXOMailboxAutoReplyConfiguration "EXOMailboxAutoReplyConfiguration" { - Name = "Default Policy" - EnabledEmailAddressTemplates = @("SMTP:@contoso.onmicrosoft.com") - EnabledPrimarySMTPAddressTemplate = "@contoso.onmicrosoft.com" - ManagedByFilter = "" - Priority = "Lowest" - Ensure = "Present" - Credential = $Credscredential + AutoDeclineFutureRequestsWhenOOF = $False; + AutoReplyState = "Disabled"; + CreateOOFEvent = $False; + Credential = $Credscredential; + DeclineAllEventsForScheduledOOF = $False; + DeclineEventsForScheduledOOF = $True; # Updated Property + DeclineMeetingMessage = ""; + EndTime = "1/23/2024 3:00:00 PM"; + Ensure = "Present"; + ExternalAudience = "All"; + ExternalMessage = ""; + Identity = "AdeleV@$Domain"; + InternalMessage = ""; + OOFEventSubject = ""; + StartTime = "1/22/2024 3:00:00 PM"; } } } diff --git a/docs/docs/resources/exchange/EXOMailboxCalendarFolder.md b/docs/docs/resources/exchange/EXOMailboxCalendarFolder.md index 43496b2f91..1f491c98a5 100644 --- a/docs/docs/resources/exchange/EXOMailboxCalendarFolder.md +++ b/docs/docs/resources/exchange/EXOMailboxCalendarFolder.md @@ -64,10 +64,10 @@ Configuration Example Credential = $credsCredential; DetailLevel = "AvailabilityOnly"; Ensure = "Present"; - Identity = "john.smith:\Calendar"; + Identity = "AdeleV:\Calendar"; PublishDateRangeFrom = "ThreeMonths"; PublishDateRangeTo = "ThreeMonths"; - PublishEnabled = $False; + PublishEnabled = $True; # Updated Property SearchableUrlEnabled = $False; } } diff --git a/docs/docs/resources/exchange/EXOMailboxPermission.md b/docs/docs/resources/exchange/EXOMailboxPermission.md index b9c8fb93f8..4fec5d4340 100644 --- a/docs/docs/resources/exchange/EXOMailboxPermission.md +++ b/docs/docs/resources/exchange/EXOMailboxPermission.md @@ -60,9 +60,9 @@ Configuration Example { AccessRights = @("FullAccess","ReadPermission"); Credential = $credsCredential; - Deny = $False; + Deny = $True; # Updated Property Ensure = "Present"; - Identity = "John.Smith"; + Identity = "AdeleV"; InheritanceType = "All"; User = "NT AUTHORITY\SELF"; } diff --git a/docs/docs/resources/exchange/EXOMailboxPlan.md b/docs/docs/resources/exchange/EXOMailboxPlan.md index 523998b6cf..a73658b8ad 100644 --- a/docs/docs/resources/exchange/EXOMailboxPlan.md +++ b/docs/docs/resources/exchange/EXOMailboxPlan.md @@ -62,12 +62,12 @@ Configuration Example EXOMailboxPlan 'ConfigureMailboxPlan' { Ensure = "Present"; - Identity = "ExchangeOnlineEnterprise"; + Identity = "Integration Plan"; IssueWarningQuota = "98 GB (105,226,698,752 bytes)"; MaxReceiveSize = "25 MB (26,214,400 bytes)"; MaxSendSize = "25 MB (26,214,400 bytes)"; ProhibitSendQuota = "99 GB (106,300,440,576 bytes)"; - ProhibitSendReceiveQuota = "100 GB (107,374,182,400 bytes)"; + ProhibitSendReceiveQuota = "15 GB (16,106,127,360 bytes)"; # Updated Property RetainDeletedItemsFor = "14.00:00:00"; RoleAssignmentPolicy = "Default Role Assignment Policy"; Credential = $Credscredential diff --git a/docs/docs/resources/exchange/EXOMailboxSettings.md b/docs/docs/resources/exchange/EXOMailboxSettings.md index 6ecc82e7e6..13089584c9 100644 --- a/docs/docs/resources/exchange/EXOMailboxSettings.md +++ b/docs/docs/resources/exchange/EXOMailboxSettings.md @@ -62,7 +62,7 @@ Configuration Example { DisplayName = 'Ottawa Employees' TimeZone = 'Eastern Standard Time' - Locale = 'fr-CA' + Locale = 'en-US' # Updated Property Ensure = 'Present' Credential = $Credscredential } diff --git a/docs/docs/resources/exchange/EXOMalwareFilterPolicy.md b/docs/docs/resources/exchange/EXOMalwareFilterPolicy.md index 52321a342f..cc1aba6b22 100644 --- a/docs/docs/resources/exchange/EXOMalwareFilterPolicy.md +++ b/docs/docs/resources/exchange/EXOMalwareFilterPolicy.md @@ -71,7 +71,7 @@ Configuration Example { EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' { - Identity = "Default" + Identity = "IntegrationMFP" CustomNotifications = $False EnableExternalSenderAdminNotifications = $False EnableFileFilter = $False @@ -87,3 +87,65 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' + { + Identity = "IntegrationMFP" + CustomNotifications = $False + EnableExternalSenderAdminNotifications = $False + EnableFileFilter = $False + EnableInternalSenderAdminNotifications = $False + FileTypeAction = "Quarantine" + FileTypes = @("ace", "ani", "app", "cab", "docm", "exe", "iso", "jar", "jnlp", "reg", "scr", "vbe", "vbs") + QuarantineTag = "AdminOnlyAccessPolicy" + ZapEnabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' + { + Identity = "IntegrationMFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOMalwareFilterRule.md b/docs/docs/resources/exchange/EXOMalwareFilterRule.md index 48bc0b4615..7b140c38ce 100644 --- a/docs/docs/resources/exchange/EXOMalwareFilterRule.md +++ b/docs/docs/resources/exchange/EXOMalwareFilterRule.md @@ -65,7 +65,7 @@ Configuration Example EXOMalwareFilterRule 'ConfigureMalwareFilterRule' { Identity = "Contoso Recipients" - MalwareFilterPolicy = "Contoso Malware Filter Policy" + MalwareFilterPolicy = "IntegrationMFP" Comments = "Apply the filter to all Contoso users" Enabled = $True RecipientDomainIs = "contoso.com" @@ -76,3 +76,64 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterRule 'ConfigureMalwareFilterRule' + { + Identity = "Contoso Recipients" + MalwareFilterPolicy = "IntegrationMFP" + Comments = "Apply the filter to all Contoso users" + Enabled = $False # Updated Property + RecipientDomainIs = "contoso.com" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterRule 'ConfigureMalwareFilterRule' + { + Identity = "Contoso Recipients" + MalwareFilterPolicy = "IntegrationMFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOManagementRole.md b/docs/docs/resources/exchange/EXOManagementRole.md index fb53b84086..410976566f 100644 --- a/docs/docs/resources/exchange/EXOManagementRole.md +++ b/docs/docs/resources/exchange/EXOManagementRole.md @@ -65,3 +65,61 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRole 'ConfigureManagementRole' + { + Name = "MyDisplayName" + Description = "Updated Description" # Updated Property + Parent = "contoso.onmicrosoft.com\MyProfileInformation" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRole 'ConfigureManagementRole' + { + Name = "MyDisplayName" + Description = "Updated Description" # Updated Property + Parent = "contoso.onmicrosoft.com\MyProfileInformation" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOManagementRoleAssignment.md b/docs/docs/resources/exchange/EXOManagementRoleAssignment.md index d868156094..d9ee8fa96c 100644 --- a/docs/docs/resources/exchange/EXOManagementRoleAssignment.md +++ b/docs/docs/resources/exchange/EXOManagementRoleAssignment.md @@ -68,7 +68,65 @@ Configuration Example Ensure = "Present"; Name = "MyManagementRoleAssignment"; Role = "UserApplication"; - User = "John.Smith"; + User = "AdeleV"; + } + } +} +``` + +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsCredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRoleAssignment 'AssignManagementRole' + { + Credential = $credsCredential; + Ensure = "Present"; + Name = "MyManagementRoleAssignment"; + Role = "UserApplication"; + User = "AlexW"; # Updated Property + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsCredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRoleAssignment 'AssignManagementRole' + { + Credential = $credsCredential; + Ensure = "Absent"; + Name = "MyManagementRoleAssignment"; + Role = "UserApplication"; + User = "AlexW"; # Updated Property } } } diff --git a/docs/docs/resources/exchange/EXOMessageClassification.md b/docs/docs/resources/exchange/EXOMessageClassification.md index c05dd8eba0..b2b5413847 100644 --- a/docs/docs/resources/exchange/EXOMessageClassification.md +++ b/docs/docs/resources/exchange/EXOMessageClassification.md @@ -77,3 +77,68 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMessageClassification 'ConfigureMessageClassification' + { + Identity = "Contoso Message Classification" + Name = "Contoso Message Classification" + DisplayName = "Contoso Message Classification" + DisplayPrecedence = "Highest" + PermissionMenuVisible = $True + RecipientDescription = "Shown to receipients" + SenderDescription = "Shown to senders" + RetainClassificationEnabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMessageClassification 'ConfigureMessageClassification' + { + Identity = "Contoso Message Classification" + Name = "Contoso Message Classification" + DisplayName = "Contoso Message Classification" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOMobileDeviceMailboxPolicy.md b/docs/docs/resources/exchange/EXOMobileDeviceMailboxPolicy.md index 045e5e9815..9f31767f95 100644 --- a/docs/docs/resources/exchange/EXOMobileDeviceMailboxPolicy.md +++ b/docs/docs/resources/exchange/EXOMobileDeviceMailboxPolicy.md @@ -168,3 +168,110 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMobileDeviceMailboxPolicy 'ConfigureMobileDeviceMailboxPolicy' + { + Name = "Default" + AllowApplePushNotifications = $True + AllowBluetooth = "Allow" + AllowBrowser = $False # Updated Property + AllowCamera = $True + AllowConsumerEmail = $True + AllowDesktopSync = $True + AllowExternalDeviceManagement = $False + AllowGooglePushNotifications = $True + AllowHTMLEmail = $True + AllowInternetSharing = $True + AllowIrDA = $True + AllowMicrosoftPushNotifications = $True + AllowMobileOTAUpdate = $True + AllowNonProvisionableDevices = $True + AllowPOPIMAPEmail = $True + AllowRemoteDesktop = $True + AllowSimplePassword = $True + AllowSMIMEEncryptionAlgorithmNegotiation = "AllowAnyAlgorithmNegotiation" + AllowSMIMESoftCerts = $True + AllowStorageCard = $True + AllowTextMessaging = $True + AllowUnsignedApplications = $True + AllowUnsignedInstallationPackages = $True + AllowWiFi = $True + AlphanumericPasswordRequired = $False + ApprovedApplicationList = @() + AttachmentsEnabled = $True + DeviceEncryptionEnabled = $False + DevicePolicyRefreshInterval = "Unlimited" + IrmEnabled = $True + IsDefault = $True + MaxAttachmentSize = "Unlimited" + MaxCalendarAgeFilter = "All" + MaxEmailAgeFilter = "All" + MaxEmailBodyTruncationSize = "Unlimited" + MaxEmailHTMLBodyTruncationSize = "Unlimited" + MaxInactivityTimeLock = "Unlimited" + MaxPasswordFailedAttempts = "Unlimited" + MinPasswordComplexCharacters = 1 + PasswordEnabled = $False + PasswordExpiration = "Unlimited" + PasswordHistory = 0 + PasswordRecoveryEnabled = $False + RequireDeviceEncryption = $False + RequireEncryptedSMIMEMessages = $False + RequireEncryptionSMIMEAlgorithm = "TripleDES" + RequireManualSyncWhenRoaming = $False + RequireSignedSMIMEAlgorithm = "SHA1" + RequireSignedSMIMEMessages = $False + RequireStorageCardEncryption = $False + UnapprovedInROMApplicationList = @() + UNCAccessEnabled = $True + WSSAccessEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMobileDeviceMailboxPolicy 'ConfigureMobileDeviceMailboxPolicy' + { + Name = "Default" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOOMEConfiguration.md b/docs/docs/resources/exchange/EXOOMEConfiguration.md index aec460aca0..b0511a06de 100644 --- a/docs/docs/resources/exchange/EXOOMEConfiguration.md +++ b/docs/docs/resources/exchange/EXOOMEConfiguration.md @@ -80,3 +80,67 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOMEConfiguration 'ConfigureOMEConfiguration' + { + Identity = "Contoso Marketing" + BackgroundColor = "0x00FFFF00" + DisclaimerText = "Encryption security disclaimer." + EmailText = "Encrypted message enclosed." + ExternalMailExpiryInDays = 1 # Updated Property + IntroductionText = "You have received an encypted message" + OTPEnabled = $True + PortalText = "This portal is encrypted." + SocialIdSignIn = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOMEConfiguration 'ConfigureOMEConfiguration' + { + Identity = "Contoso Marketing" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOOfflineAddressBook.md b/docs/docs/resources/exchange/EXOOfflineAddressBook.md index d8a60aff62..eb4f547b2a 100644 --- a/docs/docs/resources/exchange/EXOOfflineAddressBook.md +++ b/docs/docs/resources/exchange/EXOOfflineAddressBook.md @@ -59,7 +59,7 @@ Configuration Example { EXOOfflineAddressBook 'ConfigureOfflineAddressBook' { - Name = "Default Offline Address Book" + Name = "Integration Address Book" AddressLists = @('\Offline Global Address List') ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') DiffRetentionPeriod = "30" @@ -71,3 +71,69 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOfflineAddressBook 'ConfigureOfflineAddressBook' + { + Name = "Integration Address Book" + AddressLists = @('\Offline Global Address List') + ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') + DiffRetentionPeriod = "30" + IsDefault = $false # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOfflineAddressBook 'ConfigureOfflineAddressBook' + { + Name = "Integration Address Book" + AddressLists = @('\Offline Global Address List') + ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') + DiffRetentionPeriod = "30" + IsDefault = $true + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOOnPremisesOrganization.md b/docs/docs/resources/exchange/EXOOnPremisesOrganization.md index b44a50aabd..9ad83d1e9d 100644 --- a/docs/docs/resources/exchange/EXOOnPremisesOrganization.md +++ b/docs/docs/resources/exchange/EXOOnPremisesOrganization.md @@ -76,3 +76,66 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' + { + Identity = 'Contoso' + Comment = 'Mail for Contoso. Updated' # Updated Property + HybridDomains = 'contoso.com', 'sales.contoso.com' + InboundConnector = 'Inbound to Contoso' + OrganizationGuid = 'a1bc23cb-3456-bcde-abcd-feb363cacc88' + OrganizationName = 'Contoso' + OutboundConnector = 'Outbound to Contoso' + Ensure = 'Present' + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' + { + Identity = 'Contoso' + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOOrganizationRelationship.md b/docs/docs/resources/exchange/EXOOrganizationRelationship.md index 119bf16c32..d71c3a49e9 100644 --- a/docs/docs/resources/exchange/EXOOrganizationRelationship.md +++ b/docs/docs/resources/exchange/EXOOrganizationRelationship.md @@ -94,3 +94,72 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOrganizationRelationship 'ConfigureOrganizationRelationship' + { + Name = "Contoso" + ArchiveAccessEnabled = $False # Updated Property + DeliveryReportEnabled = $True + DomainNames = "mail.contoso.com" + Enabled = $True + FreeBusyAccessEnabled = $True + FreeBusyAccessLevel = "AvailabilityOnly" + MailboxMoveEnabled = $True + MailTipsAccessEnabled = $True + MailTipsAccessLevel = "None" + PhotosEnabled = $True + TargetApplicationUri = "mail.contoso.com" + TargetAutodiscoverEpr = "https://mail.contoso.com/autodiscover/autodiscover.svc/wssecurity" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOrganizationRelationship 'ConfigureOrganizationRelationship' + { + Name = "Contoso" + Enabled = $True + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOOutboundConnector.md b/docs/docs/resources/exchange/EXOOutboundConnector.md index 3848275f5d..6f0d1388fe 100644 --- a/docs/docs/resources/exchange/EXOOutboundConnector.md +++ b/docs/docs/resources/exchange/EXOOutboundConnector.md @@ -90,3 +90,71 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOutboundConnector 'ConfigureOutboundConnector' + { + Identity = "Contoso Outbound Connector" + AllAcceptedDomains = $True + CloudServicesMailEnabled = $True + Comment = "Outbound connector to Contoso" + ConnectorSource = "Default" + ConnectorType = "OnPremises" + Enabled = $False # Updated Property + IsTransportRuleScoped = $True + RecipientDomains = "*.contoso.com" + RouteAllMessagesViaOnPremises = $True + TlsDomain = "*.contoso.com" + TlsSettings = "DomainValidation" + UseMxRecord = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOutboundConnector 'ConfigureOutboundConnector' + { + Identity = "Contoso Outbound Connector" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOOwaMailboxPolicy.md b/docs/docs/resources/exchange/EXOOwaMailboxPolicy.md index 82e9c758ad..366476ff0b 100644 --- a/docs/docs/resources/exchange/EXOOwaMailboxPolicy.md +++ b/docs/docs/resources/exchange/EXOOwaMailboxPolicy.md @@ -138,7 +138,7 @@ Configuration Example { EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' { - Name = "OwaMailboxPolicy-Default" + Name = "OwaMailboxPolicy-Integration" ActionForUnknownFileAndMIMETypes = "ForceSave" ActiveSyncIntegrationEnabled = $True AdditionalStorageProvidersAvailable = $True @@ -218,3 +218,129 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' + { + Name = "OwaMailboxPolicy-Integration" + ActionForUnknownFileAndMIMETypes = "ForceSave" + ActiveSyncIntegrationEnabled = $True + AdditionalStorageProvidersAvailable = $True + AllAddressListsEnabled = $True + AllowCopyContactsToDeviceAddressBook = $True + AllowedFileTypes = @(".rpmsg",".xlsx",".xlsm",".xlsb",".tiff",".pptx",".pptm",".ppsx",".ppsm",".docx",".docm",".zip",".xls",".wmv",".wma",".wav",".vsd",".txt",".tif",".rtf",".pub",".ppt",".png",".pdf",".one",".mp3",".jpg",".gif",".doc",".bmp",".avi") + AllowedMimeTypes = @("image/jpeg","image/png","image/gif","image/bmp") + BlockedFileTypes = @(".settingcontent-ms",".printerexport",".appcontent-ms",".appref-ms",".vsmacros",".website",".msh2xml",".msh1xml",".diagcab",".webpnp",".ps2xml",".ps1xml",".mshxml",".gadget",".theme",".psdm1",".mhtml",".cdxml",".xbap",".vhdx",".pyzw",".pssc",".psd1",".psc2",".psc1",".msh2",".msh1",".jnlp",".aspx",".appx",".xnk",".xml",".xll",".wsh",".wsf",".wsc",".wsb",".vsw",".vst",".vss",".vhd",".vbs",".vbp",".vbe",".url",".udl",".tmp",".shs",".shb",".sct",".scr",".scf",".reg",".pyz",".pyw",".pyo",".pyc",".pst",".ps2",".ps1",".prg",".prf",".plg",".pif",".pcd",".ops",".msu",".mst",".msp",".msi",".msh",".msc",".mht",".mdz",".mdw",".mdt",".mde",".mdb",".mda",".mcf",".maw",".mav",".mau",".mat",".mas",".mar",".maq",".mam",".mag",".maf",".mad",".lnk",".ksh",".jse",".jar",".its",".isp",".ins",".inf",".htc",".hta",".hpj",".hlp",".grp",".fxp",".exe",".der",".csh",".crt",".cpl",".com",".cnt",".cmd",".chm",".cer",".bat",".bas",".asx",".asp",".app",".apk",".adp",".ade",".ws",".vb",".py",".pl",".js") + BlockedMimeTypes = @("application/x-javascript","application/javascript","application/msaccess","x-internet-signup","text/javascript","application/xml","application/prg","application/hta","text/scriplet","text/xml") + ClassicAttachmentsEnabled = $True + ConditionalAccessPolicy = "Off" + DefaultTheme = "" + DirectFileAccessOnPrivateComputersEnabled = $True + DirectFileAccessOnPublicComputersEnabled = $False # Updated Property + DisplayPhotosEnabled = $True + ExplicitLogonEnabled = $True + ExternalImageProxyEnabled = $True + ForceSaveAttachmentFilteringEnabled = $False + ForceSaveFileTypes = @(".vsmacros",".ps2xml",".ps1xml",".mshxml",".gadget",".psc2",".psc1",".aspx",".wsh",".wsf",".wsc",".vsw",".vst",".vss",".vbs",".vbe",".url",".tmp",".swf",".spl",".shs",".shb",".sct",".scr",".scf",".reg",".pst",".ps2",".ps1",".prg",".prf",".plg",".pif",".pcd",".ops",".mst",".msp",".msi",".msh",".msc",".mdz",".mdw",".mdt",".mde",".mdb",".mda",".maw",".mav",".mau",".mat",".mas",".mar",".maq",".mam",".mag",".maf",".mad",".lnk",".ksh",".jse",".its",".isp",".ins",".inf",".hta",".hlp",".fxp",".exe",".dir",".dcr",".csh",".crt",".cpl",".com",".cmd",".chm",".cer",".bat",".bas",".asx",".asp",".app",".adp",".ade",".ws",".vb",".js") + ForceSaveMimeTypes = @("Application/x-shockwave-flash","Application/octet-stream","Application/futuresplash","Application/x-director") + ForceWacViewingFirstOnPrivateComputers = $False + ForceWacViewingFirstOnPublicComputers = $False + FreCardsEnabled = $True + GlobalAddressListEnabled = $True + GroupCreationEnabled = $True + InstantMessagingEnabled = $True + InstantMessagingType = "Ocs" + InterestingCalendarsEnabled = $True + IRMEnabled = $True + IsDefault = $True + JournalEnabled = $True + LocalEventsEnabled = $False + LogonAndErrorLanguage = 0 + NotesEnabled = $True + NpsSurveysEnabled = $True + OnSendAddinsEnabled = $False + OrganizationEnabled = $True + OutboundCharset = "AutoDetect" + OutlookBetaToggleEnabled = $True + OWALightEnabled = $True + PersonalAccountCalendarsEnabled = $True + PhoneticSupportEnabled = $False + PlacesEnabled = $True + PremiumClientEnabled = $True + PrintWithoutDownloadEnabled = $True + PublicFoldersEnabled = $True + RecoverDeletedItemsEnabled = $True + ReferenceAttachmentsEnabled = $True + RemindersAndNotificationsEnabled = $True + ReportJunkEmailEnabled = $True + RulesEnabled = $True + SatisfactionEnabled = $True + SaveAttachmentsToCloudEnabled = $True + SearchFoldersEnabled = $True + SetPhotoEnabled = $True + SetPhotoURL = "" + SignaturesEnabled = $True + SkipCreateUnifiedGroupCustomSharepointClassification = $True + TeamSnapCalendarsEnabled = $True + TextMessagingEnabled = $True + ThemeSelectionEnabled = $True + UMIntegrationEnabled = $True + UseGB18030 = $False + UseISO885915 = $False + UserVoiceEnabled = $True + WacEditingEnabled = $True + WacExternalServicesEnabled = $True + WacOMEXEnabled = $False + WacViewingOnPrivateComputersEnabled = $True + WacViewingOnPublicComputersEnabled = $True + WeatherEnabled = $True + WebPartsFrameOptionsType = "SameOrigin" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' + { + Name = "OwaMailboxPolicy-Integration" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOPartnerApplication.md b/docs/docs/resources/exchange/EXOPartnerApplication.md index 9df7e5cb13..3370ee3f64 100644 --- a/docs/docs/resources/exchange/EXOPartnerApplication.md +++ b/docs/docs/resources/exchange/EXOPartnerApplication.md @@ -70,3 +70,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPartnerApplication 'ConfigurePartnerApplication' + { + Name = "HRApp" + ApplicationIdentifier = "00000006-0000-0dd1-ac00-000000000000" + AccountType = "OrganizationalAccount" + Enabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPartnerApplication 'ConfigurePartnerApplication' + { + Name = "HRApp" + ApplicationIdentifier = "00000006-0000-0dd1-ac00-000000000000" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOPlace.md b/docs/docs/resources/exchange/EXOPlace.md index 8adb95904f..13d3b4eba4 100644 --- a/docs/docs/resources/exchange/EXOPlace.md +++ b/docs/docs/resources/exchange/EXOPlace.md @@ -67,11 +67,12 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credential + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOPlace 'TestPlace' @@ -79,10 +80,10 @@ Configuration Example AudioDeviceName = "MyAudioDevice"; Capacity = 15; #Drift City = ""; - Credential = $credential + Credential = $Credscredential DisplayDeviceName = "DisplayDeviceName"; Ensure = 'Present' - Identity = "MyRoom@$contoso.com"; + Identity = "MyRoom@$Domain"; IsWheelChairAccessible = $True; MTREnabled = $False; ParentType = "None"; @@ -94,3 +95,75 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOPlace 'TestPlace' + { + AudioDeviceName = "MyAudioDevice"; + Capacity = 16; # Updated Property + City = ""; + Credential = $Credscredential + DisplayDeviceName = "DisplayDeviceName"; + Ensure = 'Present' + Identity = "MyRoom@$Domain"; + IsWheelChairAccessible = $True; + MTREnabled = $False; + ParentType = "None"; + Phone = "555-555-5555"; + Tags = @("Tag1", "Tag2"); + VideoDeviceName = "VideoDevice"; + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOPlace 'TestPlace' + { + AudioDeviceName = "MyAudioDevice"; + Credential = $Credscredential + DisplayDeviceName = "DisplayDeviceName"; + Ensure = 'Absent' + Identity = "MyRoom@$Domain"; + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOPolicyTipConfig.md b/docs/docs/resources/exchange/EXOPolicyTipConfig.md index 160459e6ed..ec09fb4a3a 100644 --- a/docs/docs/resources/exchange/EXOPolicyTipConfig.md +++ b/docs/docs/resources/exchange/EXOPolicyTipConfig.md @@ -64,3 +64,61 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPolicyTipConfig 'ConfigurePolicyTipConfig' + { + Name = "en\NotifyOnly" + Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPolicyTipConfig 'ConfigurePolicyTipConfig' + { + Name = "en\NotifyOnly" + Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOQuarantinePolicy.md b/docs/docs/resources/exchange/EXOQuarantinePolicy.md index 99fece786c..86ee5e75f5 100644 --- a/docs/docs/resources/exchange/EXOQuarantinePolicy.md +++ b/docs/docs/resources/exchange/EXOQuarantinePolicy.md @@ -62,13 +62,14 @@ Configuration Example $OrganizationName = $Credscredential.UserName.Split('@')[1] Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOQuarantinePolicy 'ConfigureQuarantinePolicy' { EndUserQuarantinePermissionsValue = 87; ESNEnabled = $False; - Identity = "$OrganizationName\DefaultFullAccessPolicy"; + Identity = "$Domain\DefaultFullAccessPolicy"; Ensure = "Present" Credential = $Credscredential } @@ -76,3 +77,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + $OrganizationName = $Credscredential.UserName.Split('@')[1] + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOQuarantinePolicy 'ConfigureQuarantinePolicy' + { + EndUserQuarantinePermissionsValue = 87; + ESNEnabled = $True; # Updated Property + Identity = "$Domain\DefaultFullAccessPolicy"; + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + $OrganizationName = $Credscredential.UserName.Split('@')[1] + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOQuarantinePolicy 'ConfigureQuarantinePolicy' + { + Identity = "$Domain\DefaultFullAccessPolicy"; + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXORemoteDomain.md b/docs/docs/resources/exchange/EXORemoteDomain.md index 755413c10d..d8f1373597 100644 --- a/docs/docs/resources/exchange/EXORemoteDomain.md +++ b/docs/docs/resources/exchange/EXORemoteDomain.md @@ -75,7 +75,7 @@ Configuration Example { EXORemoteDomain 583b0b70-b45d-401f-98a6-0e7fa8434946 { - Identity = "Default" + Identity = "Integration" AllowedOOFType = "External" AutoForwardEnabled = $True AutoReplyEnabled = $True @@ -102,3 +102,76 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORemoteDomain 583b0b70-b45d-401f-98a6-0e7fa8434946 + { + Identity = "Integration" + AllowedOOFType = "External" + AutoForwardEnabled = $True + AutoReplyEnabled = $False # Updated Property + ByteEncoderTypeFor7BitCharsets = "Undefined" + CharacterSet = "iso-8859-1" + ContentType = "MimeHtmlText" + DeliveryReportEnabled = $True + DisplaySenderName = $True + DomainName = "*" + IsInternal = $False + LineWrapSize = "Unlimited" + MeetingForwardNotificationEnabled = $False + Name = "Default" + NonMimeCharacterSet = "iso-8859-1" + PreferredInternetCodePageForShiftJis = "Undefined" + TargetDeliveryDomain = $False + TrustedMailInboundEnabled = $False + TrustedMailOutboundEnabled = $False + UseSimpleDisplayName = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORemoteDomain 583b0b70-b45d-401f-98a6-0e7fa8434946 + { + Identity = "Integration" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXORoleAssignmentPolicy.md b/docs/docs/resources/exchange/EXORoleAssignmentPolicy.md index 5b74d5ddd4..1b483a8b3b 100644 --- a/docs/docs/resources/exchange/EXORoleAssignmentPolicy.md +++ b/docs/docs/resources/exchange/EXORoleAssignmentPolicy.md @@ -56,7 +56,7 @@ Configuration Example { EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' { - Name = "Default Role Assignment Policy" + Name = "Integration Policy" Description = "This policy grants end users the permission to set their options in Outlook on the web and perform other self-administration tasks." IsDefault = $True Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") @@ -67,3 +67,62 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' + { + Name = "Integration Policy" + Description = "This policy grants end users the permission to set their options in Outlook on the web and perform other self-administration tasks." + IsDefault = $False # Updated Property + Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' + { + Name = "Integration Policy" + IsDefault = $False # Updated Property + Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXORoleGroup.md b/docs/docs/resources/exchange/EXORoleGroup.md index be6730c14f..ad98192862 100644 --- a/docs/docs/resources/exchange/EXORoleGroup.md +++ b/docs/docs/resources/exchange/EXORoleGroup.md @@ -68,3 +68,64 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleGroup 'ConfigureRoleGroup' + { + Name = "Contoso Role Group" + Description = "Address Lists Role for Exchange Administrators. Updated" # Updated Property + Members = @("Exchange Administrator") + Roles = @("Address Lists") + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleGroup 'ConfigureRoleGroup' + { + Name = "Contoso Role Group" + Members = @("Exchange Administrator") + Roles = @("Address Lists") + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOSafeAttachmentPolicy.md b/docs/docs/resources/exchange/EXOSafeAttachmentPolicy.md index 0de9f31932..1d70d28297 100644 --- a/docs/docs/resources/exchange/EXOSafeAttachmentPolicy.md +++ b/docs/docs/resources/exchange/EXOSafeAttachmentPolicy.md @@ -58,6 +58,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' @@ -65,7 +66,7 @@ Configuration Example Identity = "Marketing Block Attachments" Enable = $True Redirect = $True - RedirectAddress = "admin@contoso.com" + RedirectAddress = "admin@$Domain" Ensure = "Present" Credential = $Credscredential } @@ -73,3 +74,65 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' + { + Identity = "Marketing Block Attachments" + Enable = $False # Updated Property + Redirect = $True + RedirectAddress = "admin@$Domain" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' + { + Identity = "Marketing Block Attachments" + Enable = $False # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOSafeAttachmentRule.md b/docs/docs/resources/exchange/EXOSafeAttachmentRule.md index 7cfae505f8..9e4b1e9a27 100644 --- a/docs/docs/resources/exchange/EXOSafeAttachmentRule.md +++ b/docs/docs/resources/exchange/EXOSafeAttachmentRule.md @@ -68,7 +68,7 @@ Configuration Example Comments = "Applies to Research Department, except managers" Enabled = $True ExceptIfSentToMemberOf = "Research Department Managers" - SafeAttachmentPolicy = "Research Block Attachments" + SafeAttachmentPolicy = "Marketing Block Attachments" SentToMemberOf = "Research Department" Ensure = "Present" Credential = $Credscredential @@ -77,3 +77,68 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' + { + Identity = "Research Department Attachment Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Research Department Managers" + SafeAttachmentPolicy = "Marketing Block Attachments" + SentToMemberOf = "Research Department" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' + { + Identity = "Research Department Attachment Rule" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Research Department Managers" + SafeAttachmentPolicy = "Marketing Block Attachments" + SentToMemberOf = "Research Department" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOSafeLinksPolicy.md b/docs/docs/resources/exchange/EXOSafeLinksPolicy.md index 914ef01f5f..55102a0a47 100644 --- a/docs/docs/resources/exchange/EXOSafeLinksPolicy.md +++ b/docs/docs/resources/exchange/EXOSafeLinksPolicy.md @@ -84,3 +84,66 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksPolicy 'ConfigureSafeLinksPolicy' + { + Identity = 'Marketing Block URL' + AdminDisplayName = 'Marketing Block URL' + CustomNotificationText = 'Blocked URLs for Marketing' + DeliverMessageAfterScan = $True + EnableOrganizationBranding = $False # Updated Property + EnableSafeLinksForTeams = $True + ScanUrls = $True + UseTranslatedNotificationText = $True + Ensure = 'Present' + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksPolicy 'ConfigureSafeLinksPolicy' + { + Identity = 'Marketing Block URL' + Ensure = 'Absent' + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOSafeLinksRule.md b/docs/docs/resources/exchange/EXOSafeLinksRule.md index be69811e5d..7f6a684f88 100644 --- a/docs/docs/resources/exchange/EXOSafeLinksRule.md +++ b/docs/docs/resources/exchange/EXOSafeLinksRule.md @@ -68,7 +68,7 @@ Configuration Example Comments = "Applies to Research Department, except managers" Enabled = $True ExceptIfSentToMemberOf = "Research Department Managers" - SafeLinksPolicy = "Research Block URL" + SafeLinksPolicy = "Marketing Block URL" SentToMemberOf = "Research Department" Ensure = "Present" Credential = $Credscredential @@ -77,3 +77,67 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksRule 'ConfigureSafeLinksRule' + { + Identity = "Research Department URL Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Research Department Managers" + SafeLinksPolicy = "Marketing Block URL" + SentToMemberOf = "Research Department" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksRule 'ConfigureSafeLinksRule' + { + Identity = "Research Department URL Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $False # Updated Property + SafeLinksPolicy = "Marketing Block URL" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOSharedMailbox.md b/docs/docs/resources/exchange/EXOSharedMailbox.md index 45d3beccb1..75901ef81e 100644 --- a/docs/docs/resources/exchange/EXOSharedMailbox.md +++ b/docs/docs/resources/exchange/EXOSharedMailbox.md @@ -52,13 +52,14 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSharedMailbox 'SharedMailbox' { DisplayName = "Test" - PrimarySMTPAddress = "Test@O365DSC1.onmicrosoft.com" - EmailAddresses = @("Joufflu@o365dsc1.onmicrosoft.com", "Gilles@O365dsc1.onmicrosoft.com") + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } @@ -66,3 +67,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSharedMailbox 'SharedMailbox' + { + DisplayName = "Test" + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain", "AlexW@$Domain") # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSharedMailbox 'SharedMailbox' + { + DisplayName = "Test" + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain", "AlexW@$Domain") # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOSharingPolicy.md b/docs/docs/resources/exchange/EXOSharingPolicy.md index c5b35441ef..a3ec9a4b1f 100644 --- a/docs/docs/resources/exchange/EXOSharingPolicy.md +++ b/docs/docs/resources/exchange/EXOSharingPolicy.md @@ -56,7 +56,7 @@ Configuration Example { EXOSharingPolicy 'ConfigureSharingPolicy' { - Name = "Default Sharing Policy" + Name = "Integration Sharing Policy" Default = $True Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") Enabled = $True @@ -67,3 +67,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSharingPolicy 'ConfigureSharingPolicy' + { + Name = "Integration Sharing Policy" + Default = $False # Updated Property + Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSharingPolicy 'ConfigureSharingPolicy' + { + Name = "Integration Sharing Policy" + Default = $False # Updated Property + Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") + Enabled = $True + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOTransportRule.md b/docs/docs/resources/exchange/EXOTransportRule.md index 9d1aeb353d..ddba9efe92 100644 --- a/docs/docs/resources/exchange/EXOTransportRule.md +++ b/docs/docs/resources/exchange/EXOTransportRule.md @@ -235,3 +235,66 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOTransportRule 'ConfigureTransportRule' + { + Name = "Ethical Wall - Sales and Brokerage Departments" + BetweenMemberOf1 = "Sales Department" + BetweenMemberOf2 = "Brokerage Department" + ExceptIfFrom = "Tony Smith","Pilar Ackerman" + ExceptIfSubjectContainsWords = "Press Release","Corporate Communication" + RejectMessageReasonText = "Updated" # Updated Property + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOTransportRule 'ConfigureTransportRule' + { + Name = "Ethical Wall - Sales and Brokerage Departments" + Enabled = $True + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/teams/TeamsEventsPolicy.md b/docs/docs/resources/teams/TeamsEventsPolicy.md index a241b6c24f..d9b751fec2 100644 --- a/docs/docs/resources/teams/TeamsEventsPolicy.md +++ b/docs/docs/resources/teams/TeamsEventsPolicy.md @@ -6,9 +6,17 @@ | --- | --- | --- | --- | --- | | **Identity** | Key | String | Identity of the Teams Events Policy. | | | **Description** | Write | String | Description of the Teams Events Policy. | | +| **AllowEmailEditing** | Write | String | This setting governs if a user is allowed to edit the communication emails in Teams Town Hall or Teams Webinar events. | `Disabled`, `Enabled` | +| **AllowEventIntegrations** | Write | Boolean | This setting governs access to the integrations tab in the event creation workflow. | | | **AllowWebinars** | Write | String | Determines if webinars are allowed by the policy or not. | `Disabled`, `Enabled` | +| **AllowTownhalls** | Write | String | This setting governs if a user can create town halls using Teams Events. | `Disabled`, `Enabled` | +| **AllowedQuestionTypesInRegistrationForm** | Write | String | This setting governs which users in a tenant can add which registration form questions to an event registration page for attendees to answer when registering for the event. | `DefaultOnly`, `DefaultAndPredefinedOnly`, `AllQuestions` | +| **AllowedTownhallTypesForRecordingPublish** | Write | String | This setting describes how IT admins can control which types of Town Hall attendees can have their recordings published. | `None`, `InviteOnly`, `EveryoneInCompanyIncludingGuests`, `Everyone` | +| **AllowedWebinarTypesForRecordingPublish** | Write | String | This setting describes how IT admins can control which types of webinar attendees can have their recordings published. | `None`, `InviteOnly`, `EveryoneInCompanyIncludingGuests`, `Everyone` | | **EventAccessType** | Write | String | Defines who is allowed to join the event. | `Everyone`, `EveryoneInCompanyExcludingGuests` | | **Ensure** | Write | String | Present ensures the policy exists, absent ensures it is removed. | `Present`, `Absent` | +| **TownhallChatExperience** | Write | String | This setting governs whether the user can enable the Comment Stream chat experience for Town Halls. | `Optimized`, `None` | +| **UseMicrosoftECDN** | Write | Boolean | This setting governs whether the global admin disables this property and prevents the organizers from creating town halls that use Microsoft eCDN even though they have been assigned a Teams Premium license. | | | **Credential** | Write | PSCredential | Credentials of the Teams Global Admin. | | | **ApplicationId** | Write | String | Id of the Azure Active Directory application to authenticate with. | | | **TenantId** | Write | String | Name of the Azure Active Directory tenant used for authentication. Format contoso.onmicrosoft.com | | diff --git a/docs/docs/resources/teams/TeamsMobilityPolicy.md b/docs/docs/resources/teams/TeamsMobilityPolicy.md index ce0f1cfdbf..cf1b238da7 100644 --- a/docs/docs/resources/teams/TeamsMobilityPolicy.md +++ b/docs/docs/resources/teams/TeamsMobilityPolicy.md @@ -8,7 +8,7 @@ | **Description** | Write | String | Enables administrators to provide explanatory text about the policy. For example, the Description might indicate the users the policy should be assigned to. | | | **IPAudioMobileMode** | Write | String | When set to WifiOnly, prohibits the user from making and receiving calls or joining meetings using VoIP calls on the mobile device while on a cellular data connection. Possible values are: WifiOnly, AllNetworks. | `WifiOnly`, `AllNetworks` | | **IPVideoMobileMode** | Write | String | When set to WifiOnly, prohibits the user from making and receiving video calls or enabling video in meetings using VoIP calls on the mobile device while on a cellular data connection. Possible values are: WifiOnly, AllNetworks. | `WifiOnly`, `AllNetworks` | -| **MobileDialerPreference** | Write | String | N/A | | +| **MobileDialerPreference** | Write | String | Determines the mobile dialer preference, possible values are: Teams, Native, UserOverride. | `Teams`, `Native`, `UserOverride` | | **Ensure** | Write | String | Present ensures the instance exists, absent ensures it is removed. | `Present`, `Absent` | | **Credential** | Write | PSCredential | Credentials of the workload's Admin | | | **ApplicationId** | Write | String | Id of the Azure Active Directory application to authenticate with. | |