Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various Fixes #1621

Merged
merged 6 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1952,7 +1955,10 @@ function Export-TargetResource
#endregion

$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' `
-InboundParameters $PSBoundParameters
-InboundParameters $PSBoundParameters `
-ProfileName 'beta'

Select-MgProfile -Name 'beta'

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -727,7 +727,7 @@ function Export-TargetResource
{
$Params = @{
UserPrincipalName = $userUPN
Credential = $Credential
Credential = $Credential
Password = $Credential
ApplicationId = $ApplicationId
TenantId = $TenantId
Expand All @@ -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 `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
Expand Down Expand Up @@ -373,7 +373,7 @@ function Set-TargetResource

[Parameter()]
[System.String]
[ValidateSet('EveryoneInCompany', 'Everyone', 'EveryoneInSameAndFederatedCompany', 'OrganizerOnly')]
[ValidateSet('EveryoneInCompany', 'Everyone', 'EveryoneInSameAndFederatedCompany', 'OrganizerOnly', 'InvitedUsers', 'EveryoneInCompanyExcludingGuests')]
$AutoAdmittedUsers,

[Parameter()]
Expand Down Expand Up @@ -630,7 +630,7 @@ function Test-TargetResource

[Parameter()]
[System.String]
[ValidateSet('EveryoneInCompany', 'Everyone', 'EveryoneInSameAndFederatedCompany', 'OrganizerOnly')]
[ValidateSet('EveryoneInCompany', 'Everyone', 'EveryoneInSameAndFederatedCompany', 'OrganizerOnly', 'InvitedUsers', 'EveryoneInCompanyExcludingGuests')]
$AutoAdmittedUsers,

[Parameter()]
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion Modules/Microsoft365DSC/Dependencies/Manifest.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
},
@{
ModuleName = "MSCloudLoginAssistant"
RequiredVersion = "1.0.80"
RequiredVersion = "1.0.82"
},
@{
ModuleName = "PnP.PowerShell"
Expand Down
3 changes: 2 additions & 1 deletion Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2093,7 +2093,7 @@ function Set-M365DSCAgentCertificateConfiguration
}
}
M365AgentConfig | Out-Null
Set-DSCLocalConfigurationManager M365AgentConfig
Set-DSCLocalConfigurationManager M365AgentConfig -Force
"@
$LCMConfigContent | Out-File $configOutputFile
& $configOutputFile
Expand Down Expand Up @@ -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
}
Expand Down
12 changes: 8 additions & 4 deletions Tests/Unit/Stubs/Microsoft365.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -5068,6 +5068,10 @@ function Set-AntiPhishPolicy
{
[CmdletBinding()]
param(
[Parameter()]
[System.Object]
$EnableAntispoofEnforcement,

[Parameter()]
[System.Object]
$EnableFirstContactSafetyTips,
Expand Down