diff --git a/CHANGELOG.md b/CHANGELOG.md index 417b6a8774..42a3dd9749 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,24 @@ # 1.21.1215.1 +* AADConditionalAccessPolicy + * Switched to the beta endpoint to allow the export to capture policies + with device compliance conditions configured; * EXOAntiphishPolicy + * Fixed an issue where trying to create a new policy would result in its + Identity being set to System.Collections.Hashtable; + FIXES #1620 * Fix for the MakeDefault property where it wasn't properly setting existing policies to default. FIXES #1582 +* O365User + * Fixed issue where the extraction wasn't properly formatting the temporary + password for a user; +* TeamsMeetingPolicy + * Added support for value 'EveryoneInCompanyExcludingGuests' for the + AutoAdmittedUsers property; +* DEPENDENCIES + * Updated MSCloudLoginAssistant to 1.0.82; # 1.21.1208.1 diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 index d328f30f39..6227697f4e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 @@ -173,7 +173,10 @@ function Get-TargetResource Write-Verbose -Message "Getting configuration of AzureAD Conditional Access Policy" $ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' ` - -InboundParameters $PSBoundParameters + -InboundParameters $PSBoundParameters ` + -ProfileName 'beta' + + Select-MgProfile -Name 'beta' #Ensure the proper dependencies are installed in the current environment. Confirm-M365DSCDependencies @@ -1952,7 +1955,10 @@ function Export-TargetResource #endregion $ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' ` - -InboundParameters $PSBoundParameters + -InboundParameters $PSBoundParameters ` + -ProfileName 'beta' + + Select-MgProfile -Name 'beta' try { diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupsSettings/MSFT_AADGroupsSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupsSettings/MSFT_AADGroupsSettings.psm1 index 07b8c5a9bc..12de9b4685 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupsSettings/MSFT_AADGroupsSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupsSettings/MSFT_AADGroupsSettings.psm1 @@ -68,7 +68,6 @@ function Get-TargetResource -InboundParameters $PSBoundParameters ` -ProfileName 'beta' - $MaximumFunctionCount = 32000 Select-MgProfile -Name 'beta' #Ensure the proper dependencies are installed in the current environment. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAntiPhishPolicy/MSFT_EXOAntiPhishPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAntiPhishPolicy/MSFT_EXOAntiPhishPolicy.psm1 index 75bb49b748..b686556238 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAntiPhishPolicy/MSFT_EXOAntiPhishPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAntiPhishPolicy/MSFT_EXOAntiPhishPolicy.psm1 @@ -477,13 +477,14 @@ function Set-TargetResource $CreateParams.Remove("Ensure") | Out-Null $createParams.Add("Name", $Identity) $createParams.Remove("Identity") | Out-Null - New-AntiPhishPolicy $PSBoundParameters + New-AntiPhishPolicy @PSBoundParameters } elseif (('Present' -eq $Ensure ) -and $currentInstance.Ensure -eq 'Present') { Write-Verbose -Message "Updating existing AntiPhishPolicy {$Identity}" $UpdateParams = $PSBoundParameters $UpdateParams.Remove("Ensure") | Out-Null + Set-AntiphishPolicy @UpdateParams } elseif (('Absent' -eq $Ensure ) -and $currentInstance.Ensure -eq 'Present') { diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_O365User/MSFT_O365User.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_O365User/MSFT_O365User.psm1 index b368352f2f..db4892bb22 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_O365User/MSFT_O365User.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_O365User/MSFT_O365User.psm1 @@ -196,7 +196,7 @@ function Get-TargetResource StreetAddress = $user.StreetAddress Title = $user.JobTitle UserType = $user.UserType - Credential = $Credential + Credential = $Credential Ensure = "Present" } return [System.Collections.Hashtable] $results @@ -727,7 +727,7 @@ function Export-TargetResource { $Params = @{ UserPrincipalName = $userUPN - Credential = $Credential + Credential = $Credential Password = $Credential ApplicationId = $ApplicationId TenantId = $TenantId @@ -737,6 +737,7 @@ function Export-TargetResource } $Results = Get-TargetResource @Params + $Results.Password = "New-Object System.Management.Automation.PSCredential('Password', (ConvertTo-SecureString 'Pass@word!11' -AsPlainText -Force));" if ($null -ne $Results.UserPrincipalName) { $Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingPolicy/MSFT_TeamsMeetingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingPolicy/MSFT_TeamsMeetingPolicy.psm1 index b0975f0adf..a2d35ce4a7 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingPolicy/MSFT_TeamsMeetingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingPolicy/MSFT_TeamsMeetingPolicy.psm1 @@ -76,7 +76,7 @@ function Get-TargetResource [Parameter()] [System.String] - [ValidateSet('EveryoneInCompany', 'Everyone', 'EveryoneInSameAndFederatedCompany', 'OrganizerOnly', 'InvitedUsers')] + [ValidateSet('EveryoneInCompany', 'Everyone', 'EveryoneInSameAndFederatedCompany', 'OrganizerOnly', 'InvitedUsers', 'EveryoneInCompanyExcludingGuests')] $AutoAdmittedUsers, [Parameter()] @@ -373,7 +373,7 @@ function Set-TargetResource [Parameter()] [System.String] - [ValidateSet('EveryoneInCompany', 'Everyone', 'EveryoneInSameAndFederatedCompany', 'OrganizerOnly')] + [ValidateSet('EveryoneInCompany', 'Everyone', 'EveryoneInSameAndFederatedCompany', 'OrganizerOnly', 'InvitedUsers', 'EveryoneInCompanyExcludingGuests')] $AutoAdmittedUsers, [Parameter()] @@ -630,7 +630,7 @@ function Test-TargetResource [Parameter()] [System.String] - [ValidateSet('EveryoneInCompany', 'Everyone', 'EveryoneInSameAndFederatedCompany', 'OrganizerOnly')] + [ValidateSet('EveryoneInCompany', 'Everyone', 'EveryoneInSameAndFederatedCompany', 'OrganizerOnly', 'InvitedUsers', 'EveryoneInCompanyExcludingGuests')] $AutoAdmittedUsers, [Parameter()] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingPolicy/MSFT_TeamsMeetingPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingPolicy/MSFT_TeamsMeetingPolicy.schema.mof index d68e1ca402..23f1bd3b23 100644 Binary files a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingPolicy/MSFT_TeamsMeetingPolicy.schema.mof and b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingPolicy/MSFT_TeamsMeetingPolicy.schema.mof differ diff --git a/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 b/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 index a9c0dd45f2..08359d60ad 100644 --- a/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 +++ b/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 @@ -70,7 +70,7 @@ }, @{ ModuleName = "MSCloudLoginAssistant" - RequiredVersion = "1.0.80" + RequiredVersion = "1.0.82" }, @{ ModuleName = "PnP.PowerShell" diff --git a/Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1 index c4e7a3b4f3..ac7befea82 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1 @@ -2093,7 +2093,7 @@ function Set-M365DSCAgentCertificateConfiguration } } M365AgentConfig | Out-Null - Set-DSCLocalConfigurationManager M365AgentConfig + Set-DSCLocalConfigurationManager M365AgentConfig -Force "@ $LCMConfigContent | Out-File $configOutputFile & $configOutputFile @@ -2124,6 +2124,7 @@ function Set-M365DSCAgentCertificateConfiguration Export-PfxCertificate -Cert $existingCertificate.PSPath ` -FilePath $certificateFilePath.Replace('.cer','.pfx') ` -Password $securePassword | Out-Null + Write-Host "Private Key stored at {$($certificateFilePath.Replace('.cer','.pfx'))}" } return $thumbprint } diff --git a/Tests/Unit/Stubs/Microsoft365.psm1 b/Tests/Unit/Stubs/Microsoft365.psm1 index ff3decafa4..c13112d136 100644 --- a/Tests/Unit/Stubs/Microsoft365.psm1 +++ b/Tests/Unit/Stubs/Microsoft365.psm1 @@ -1206,14 +1206,14 @@ function New-AntiPhishPolicy [System.Object] $EnableFirstContactSafetyTips, - [Parameter()] - [System.Object[]] - $EnableAntispoofEnforcement, - [Parameter()] [System.Management.Automation.SwitchParameter] $MakeDefault, + [Parameter()] + [System.Object] + $EnableAntispoofEnforcement, + [Parameter()] [System.Object] $PhishThresholdLevel, @@ -5068,6 +5068,10 @@ function Set-AntiPhishPolicy { [CmdletBinding()] param( + [Parameter()] + [System.Object] + $EnableAntispoofEnforcement, + [Parameter()] [System.Object] $EnableFirstContactSafetyTips,