Major Refactor
This commit is contained in:
Родитель
6fa01a8b20
Коммит
22e362886c
|
@ -4,52 +4,52 @@
|
|||
# review when someone opens a pull request.
|
||||
* @nikcharlebois
|
||||
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOAcceptedDomain/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOAntiPhishPolicy/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_AntiPhishRule/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOAtpPolicyForO365/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOCASMailboxPlan/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOClientAccessRule/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_DkimSigningConfig/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOHostedConnectionFilterPolicy/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOHostedContentFilterPolicy/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOHostedCOntentFilterRule/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOMailboxSettings/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOMailTips/ @poiriersimon
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOSafeAttachmentPolicy/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOSafeAttachmentRule/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOSafeLinksPolicy/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOSafeLinksRule/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_EXOSharedMailbox/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAcceptedDomain/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAntiPhishPolicy/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_AntiPhishRule/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAtpPolicyForO365/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOCASMailboxPlan/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOClientAccessRule/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_DkimSigningConfig/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedConnectionFilterPolicy/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedContentFilterPolicy/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedCOntentFilterRule/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMailboxSettings/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMailTips/ @poiriersimon
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeAttachmentPolicy/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeAttachmentRule/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeLinksPolicy/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeLinksRule/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSharedMailbox/ @nikcharlebois
|
||||
|
||||
/Modules/Office365DSC/DSCResources/MSFT_O365AdminAuditLogConfig/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_O365Group/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_O365User/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_O365AdminAuditLogConfig/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_O365Group/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_O365User/ @nikcharlebois
|
||||
|
||||
/Modules/Office365DSC/DSCResources/MSFT_ODSettings/ @desmay
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_ODSettings/ @desmay
|
||||
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SCRetentionCompliancePolicy/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SCRetentionComplianceRule/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SCSupervisoryReviewPolicy/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SCSupervisoryReviewRule/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionCompliancePolicy/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionComplianceRule/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SCSupervisoryReviewPolicy/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SCSupervisoryReviewRule/ @nikcharlebois
|
||||
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SPOAccessControlSettings/ @thorstenloeschmann
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SPOApp/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SPOHubSite/ @ykuijs
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SPOSearchManagedProperty/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SPOSearchResultSource/ @nikcharlebois
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SPOSharingSettings/ @thorstenloeschmann
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SPOSite/ @thorstenloeschmann
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SPOSiteDesign/ @thorstenloeschmann
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SPOSiteDesignRights/ @thorstenloeschmann
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SPOStorageEntity/ @thorstenloeschmann
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SPOTenantSettings/ @thorstenloeschmann
|
||||
/Modules/Office365DSC/DSCResources/MSFT_SPOTheme/ @thorstenloeschmann
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SPOAccessControlSettings/ @thorstenloeschmann
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SPOApp/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SPOHubSite/ @ykuijs
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSearchManagedProperty/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSearchResultSource/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/ @thorstenloeschmann
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSite/ @thorstenloeschmann
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteDesign/ @thorstenloeschmann
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteDesignRights/ @thorstenloeschmann
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SPOStorageEntity/ @thorstenloeschmann
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantSettings/ @thorstenloeschmann
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTheme/ @thorstenloeschmann
|
||||
|
||||
|
||||
/Modules/Office365DSC/DSCResources/MSFT_TeamsTeam/ @desmay
|
||||
/Modules/Office365DSC/DSCResources/MSFT_TeamsChannel/ @desmay
|
||||
/Modules/Office365DSC/DSCResources/MSFT_TeamsUser/ @desmay
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTeam/ @desmay
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsChannel/ @desmay
|
||||
/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUser/ @desmay
|
||||
|
||||
/Modules/Office365DSC/Modules/ @nikcharlebois
|
||||
/Modules/Microsoft365DSC/Modules/ @nikcharlebois
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
.vs
|
||||
.psproj
|
||||
.sln
|
||||
Modules/Office365Dsc/DscResource.Tests
|
||||
Modules/Office365Dsc/DscResource.Tests/*
|
||||
Modules/Microsoft365DSC/DscResource.Tests
|
||||
Modules/Microsoft365DSC/DscResource.Tests/*
|
||||
node_modules
|
||||
node_modules/*
|
||||
markdownissues.txt
|
||||
start-unittests.ps1
|
||||
TestDSCresource.ps1
|
||||
Modules/Office365DSC/DSCResources/MSFT_EXOMalwareFilterPolicy/Set-MalwareFilterPolicy.txt
|
||||
Modules/Microsoft365DSC/DSCResources/MSFT_EXOMalwareFilterPolicy/Set-MalwareFilterPolicy.txt
|
||||
|
||||
Modules/start-extraction.ps1
|
||||
Modules/Office365DSC/DSCResources/MSFT_EXOAvailabilityAddressSpace/Add-AvailabilityAddressSpace-parameterset.txt
|
||||
Modules/Microsoft365DSC/DSCResources/MSFT_EXOAvailabilityAddressSpace/Add-AvailabilityAddressSpace-parameterset.txt
|
||||
*.log
|
||||
|
|
|
@ -7,7 +7,7 @@ param(
|
|||
[Parameter(Mandatory = $true)]
|
||||
[string]
|
||||
$CmdletModule = (Join-Path -Path $PSScriptRoot `
|
||||
-ChildPath "..\Stubs\Office365.psm1" `
|
||||
-ChildPath "..\Stubs\Microsoft365.psm1" `
|
||||
-Resolve)
|
||||
)
|
||||
|
||||
|
@ -25,7 +25,7 @@ if ($UnitTestFilePath.EndsWith("Tests.ps1"))
|
|||
$unitTestName = "$($unitTest.Name.Split('.')[1])"
|
||||
|
||||
$unitTestFilePath = (Join-Path -Path $PSScriptRoot `
|
||||
-ChildPath "..\Modules\Office365DSC\DSCResources\MSFT_$($unitTestName)\MSFT_$($unitTestName).psm1" `
|
||||
-ChildPath "..\Modules\Microsoft365DSC\DSCResources\MSFT_$($unitTestName)\MSFT_$($unitTestName).psm1" `
|
||||
-Resolve)
|
||||
|
||||
Invoke-Pester -Script $pesterParameters -CodeCoverage $UnitTestFilePath -Verbose
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Change log for Office365Dsc
|
||||
# Change log for Microsoft365DSC
|
||||
|
||||
## UNRELEASED
|
||||
|
||||
|
@ -21,8 +21,8 @@
|
|||
a drift;
|
||||
* TeamsUpgradePolicy
|
||||
* Initial Release;
|
||||
* Office365DSCUtil
|
||||
* Added the new Assert-O365DSCTemplate cmdlet to assess remote templates;
|
||||
* M365DSCUtil
|
||||
* Added the new Assert-M365DSCTemplate cmdlet to assess remote templates;
|
||||
* ReverseDSC
|
||||
* Change to allow ComponentsToExtract without the 'chck' prefix;
|
||||
* Introduction of Extraction Modes and Visual Indicators;
|
||||
|
|
|
@ -32,7 +32,7 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
|
@ -57,7 +57,7 @@ function Get-TargetResource
|
|||
GlobalAdminAccount = $GlobalAdminAccount
|
||||
}
|
||||
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
|
@ -165,13 +165,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -196,7 +196,7 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
$content = ''
|
|
@ -0,0 +1,295 @@
|
|||
function Get-TargetResource
|
||||
{
|
||||
[CmdletBinding()]
|
||||
[OutputType([System.Collections.Hashtable])]
|
||||
param
|
||||
(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[System.String]
|
||||
[ValidateSet('Yes')]
|
||||
$IsSingleInstance,
|
||||
|
||||
[Parameter()]
|
||||
[System.Boolean]
|
||||
$EnableGroupCreation,
|
||||
|
||||
[Parameter()]
|
||||
[System.Boolean]
|
||||
$AllowGuestsToBeGroupOwner,
|
||||
|
||||
[Parameter()]
|
||||
[System.Boolean]
|
||||
$AllowGuestsToAccessGroups,
|
||||
|
||||
[Parameter()]
|
||||
[System.String]
|
||||
$GuestUsageGuidelinesUrl,
|
||||
|
||||
[Parameter()]
|
||||
[System.String]
|
||||
$GroupCreationAllowedGroupName,
|
||||
|
||||
[Parameter()]
|
||||
[System.Boolean]
|
||||
$AllowToAddGuests,
|
||||
|
||||
[Parameter()]
|
||||
[System.String]
|
||||
$UsageGuidelinesUrl,
|
||||
|
||||
[Parameter()]
|
||||
[ValidateSet('Present', 'Absent')]
|
||||
[System.String]
|
||||
$Ensure = 'Present',
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[System.Management.Automation.PSCredential]
|
||||
$GlobalAdminAccount
|
||||
)
|
||||
|
||||
Write-Verbose -Message "Getting configuration of AzureAD Groups Naming Policy"
|
||||
#region Telemetry
|
||||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform AzureAD
|
||||
|
||||
$Policy = Get-AzureADDirectorySetting | Where-Object -FilterScript {$_.DisplayName -eq "Group.Unified"}
|
||||
|
||||
if ($null -eq $Policy)
|
||||
{
|
||||
$currentValues = $PSBoundParameters
|
||||
$currentValues.Ensure = "Absent"
|
||||
return $currentValues
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Verbose -Message "Found existing AzureAD Groups Settings"
|
||||
$AllowedGroupName = $null
|
||||
if (-not [System.String]::IsNullOrEmpty($Policy["GroupCreationAllowedGroupId"]))
|
||||
{
|
||||
$groupObject = Get-AzureADGroup -ObjectId $Policy["GroupCreationAllowedGroupId"]
|
||||
$AllowedGroupName = $groupObject.DisplayName
|
||||
}
|
||||
$result = @{
|
||||
IsSingleInstance = 'Yes'
|
||||
EnableGroupCreation = $Policy["EnableGroupCreation"]
|
||||
AllowGuestsToBeGroupOwner = $Policy["AllowGuestsToBeGroupOwner"]
|
||||
AllowGuestsToAccessGroups = $Policy["AllowGuestsToAccessGroups"]
|
||||
GuestUsageGuidelinesUrl = $Policy["GuestUsageGuidelinesUrl"]
|
||||
GroupCreationAllowedGroupName = $AllowedGroupName
|
||||
AllowToAddGuests = $Policy["AllowToAddGuests"]
|
||||
UsageGuidelinesUrl = $Policy["UsageGuidelinesUrl"]
|
||||
Ensure = "Present"
|
||||
GlobalAdminAccount = $GlobalAdminAccount
|
||||
}
|
||||
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
||||
function Set-TargetResource
|
||||
{
|
||||
[CmdletBinding()]
|
||||
param
|
||||
(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[System.String]
|
||||
[ValidateSet('Yes')]
|
||||
$IsSingleInstance,
|
||||
|
||||
[Parameter()]
|
||||
[System.Boolean]
|
||||
$EnableGroupCreation,
|
||||
|
||||
[Parameter()]
|
||||
[System.Boolean]
|
||||
$AllowGuestsToBeGroupOwner,
|
||||
|
||||
[Parameter()]
|
||||
[System.Boolean]
|
||||
$AllowGuestsToAccessGroups,
|
||||
|
||||
[Parameter()]
|
||||
[System.String]
|
||||
$GuestUsageGuidelinesUrl,
|
||||
|
||||
[Parameter()]
|
||||
[System.String]
|
||||
$GroupCreationAllowedGroupName,
|
||||
|
||||
[Parameter()]
|
||||
[System.Boolean]
|
||||
$AllowToAddGuests,
|
||||
|
||||
[Parameter()]
|
||||
[System.String]
|
||||
$UsageGuidelinesUrl,
|
||||
|
||||
[Parameter()]
|
||||
[ValidateSet('Present', 'Absent')]
|
||||
[System.String]
|
||||
$Ensure = 'Present',
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[System.Management.Automation.PSCredential]
|
||||
$GlobalAdminAccount
|
||||
)
|
||||
|
||||
Write-Verbose -Message "Setting configuration of Azure AD Groups Settings"
|
||||
#region Telemetry
|
||||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform AzureAD
|
||||
|
||||
$currentPolicy = Get-TargetResource @PSBoundParameters
|
||||
|
||||
# Policy should exist but it doesn't
|
||||
$needToUpdate = $false
|
||||
if ($Ensure -eq "Present" -and $currentPolicy.Ensure -eq "Absent")
|
||||
{
|
||||
$ds = (Get-AzureADDirectorySettingTemplate -id 62375ab9-6b52-47ed-826b-58e47e0e304b).CreateDirectorySetting()
|
||||
New-AzureADDirectorySetting -DirectorySetting $ds
|
||||
$needToUpdate = $true
|
||||
}
|
||||
|
||||
$Policy = Get-AzureADDirectorySetting | Where-Object -FilterScript {$_.DisplayName -eq "Group.Unified"}
|
||||
|
||||
if (($Ensure -eq 'Present' -and $currentPolicy.Ensure -eq 'Present') -or $needToUpdate)
|
||||
{
|
||||
$groupObject = Get-AzureADGroup -SearchString $GroupCreationAllowedGroupName
|
||||
$groupId = $null
|
||||
if ($null -ne $groupObject)
|
||||
{
|
||||
$groupId = $groupObject.ObjectId
|
||||
}
|
||||
$Policy["EnableGroupCreation"] = [System.Boolean]$EnableGroupCreation
|
||||
$Policy["AllowGuestsToBeGroupOwner"] = [System.Boolean]$AllowGuestsToBeGroupOwner
|
||||
$Policy["AllowGuestsToAccessGroups"] = [System.Boolean]$AllowGuestsToAccessGroups
|
||||
$Policy["GuestUsageGuidelinesUrl"] = $GuestUsageGuidelinesUrl
|
||||
$Policy["GroupCreationAllowedGroupId"] = $groupId
|
||||
$Policy["AllowToAddGuests"] = [System.Boolean]$AllowToAddGuests
|
||||
$Policy["UsageGuidelinesUrl"] = $UsageGuidelinesUrl
|
||||
|
||||
Set-AzureADDirectorySetting -Id $Policy.id -DirectorySetting $Policy
|
||||
}
|
||||
elseif ($Ensure -eq 'Absent' -and $currentPolicy.Ensure -eq 'Present')
|
||||
{
|
||||
Write-Verbose -Message "An existing Directory Setting entry exists, and we don't allow to have it removed."
|
||||
throw "The AADGroupsSettings resource cannot delete existing Directory Setting entries. Please specify Present."
|
||||
}
|
||||
}
|
||||
|
||||
function Test-TargetResource
|
||||
{
|
||||
[CmdletBinding()]
|
||||
[OutputType([System.Boolean])]
|
||||
param
|
||||
(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[System.String]
|
||||
[ValidateSet('Yes')]
|
||||
$IsSingleInstance,
|
||||
|
||||
[Parameter()]
|
||||
[System.Boolean]
|
||||
$EnableGroupCreation,
|
||||
|
||||
[Parameter()]
|
||||
[System.Boolean]
|
||||
$AllowGuestsToBeGroupOwner,
|
||||
|
||||
[Parameter()]
|
||||
[System.Boolean]
|
||||
$AllowGuestsToAccessGroups,
|
||||
|
||||
[Parameter()]
|
||||
[System.String]
|
||||
$GuestUsageGuidelinesUrl,
|
||||
|
||||
[Parameter()]
|
||||
[System.String]
|
||||
$GroupCreationAllowedGroupName,
|
||||
|
||||
[Parameter()]
|
||||
[System.Boolean]
|
||||
$AllowToAddGuests,
|
||||
|
||||
[Parameter()]
|
||||
[System.String]
|
||||
$UsageGuidelinesUrl,
|
||||
|
||||
[Parameter()]
|
||||
[ValidateSet('Present', 'Absent')]
|
||||
[System.String]
|
||||
$Ensure = 'Present',
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[System.Management.Automation.PSCredential]
|
||||
$GlobalAdminAccount
|
||||
)
|
||||
|
||||
Write-Verbose -Message "Testing configuration of AzureAD Groups Settings"
|
||||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
||||
Write-Verbose -Message "Test-TargetResource returned $TestResult"
|
||||
|
||||
return $TestResult
|
||||
}
|
||||
|
||||
function Export-TargetResource
|
||||
{
|
||||
[CmdletBinding()]
|
||||
[OutputType([System.String])]
|
||||
param
|
||||
(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[System.Management.Automation.PSCredential]
|
||||
$GlobalAdminAccount
|
||||
)
|
||||
$InformationPreference = 'Continue'
|
||||
#region Telemetry
|
||||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
$content = ''
|
||||
$params = @{
|
||||
GlobalAdminAccount = $GlobalAdminAccount
|
||||
IsSingleInstance = 'Yes'
|
||||
}
|
||||
$result = Get-TargetResource @params
|
||||
$result.GlobalAdminAccount = Resolve-Credentials -UserName "globaladmin"
|
||||
$content += " AADGroupsSettings " + (New-GUID).ToString() + "`r`n"
|
||||
$content += " {`r`n"
|
||||
$currentDSCBlock = Get-DSCBlock -Params $result -ModulePath $PSScriptRoot
|
||||
$content += Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName "GlobalAdminAccount"
|
||||
$content += " }`r`n"
|
||||
|
||||
return $content
|
||||
}
|
||||
|
||||
Export-ModuleMember -Function *-TargetResource
|
|
@ -37,7 +37,7 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
|
@ -70,7 +70,7 @@ function Get-TargetResource
|
|||
GlobalAdminAccount = $GlobalAdminAccount
|
||||
}
|
||||
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
|
@ -211,12 +211,12 @@ function Test-TargetResource
|
|||
Write-Verbose -Message "Testing configuration of AzureAD Groups Lifecycle Policy"
|
||||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -241,7 +241,7 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
try
|
||||
|
@ -254,7 +254,7 @@ function Export-TargetResource
|
|||
}
|
||||
$content = ''
|
||||
$organization = ""
|
||||
$principal = "" # Principal represents the "NetBios" name of the tenant (e.g. the O365DSC part of O365DSC.onmicrosoft.com)
|
||||
$principal = "" # Principal represents the "NetBios" name of the tenant (e.g. the M365DSC part of M365DSC.onmicrosoft.com)
|
||||
if ($GlobalAdminAccount.UserName.Contains("@"))
|
||||
{
|
||||
$organization = $GlobalAdminAccount.UserName.Split("@")[1]
|
|
@ -39,10 +39,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
Write-Verbose -Message 'Getting all Accepted Domain'
|
||||
|
@ -56,7 +56,7 @@ function Get-TargetResource
|
|||
Write-Verbose -Message "AcceptedDomain configuration for $($Identity) does not exist."
|
||||
|
||||
# Check to see if $Identity matches a verified domain in the O365 Tenant
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform AzureAD
|
||||
|
||||
$VerifiedDomains = Get-AzureADDomain | Where-Object -FilterScript { $_.IsVerified }
|
||||
|
@ -150,10 +150,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AcceptedDomainParams = @{
|
||||
|
@ -163,7 +163,7 @@ function Set-TargetResource
|
|||
OutboundOnly = $OutboundOnly
|
||||
}
|
||||
|
||||
Write-Verbose -Message "Setting AcceptedDomain for $($Identity) with values: $(Convert-O365DscHashtableToString -Hashtable $AcceptedDomainParams)"
|
||||
Write-Verbose -Message "Setting AcceptedDomain for $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $AcceptedDomainParams)"
|
||||
Set-AcceptedDomain @AcceptedDomainParams
|
||||
}
|
||||
|
||||
|
@ -207,13 +207,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -238,9 +238,9 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
[array]$AllAcceptedDomains = Get-AcceptedDomain
|
|
@ -37,10 +37,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AllActiveSyncDeviceAccessRules = Get-ActiveSyncDeviceAccessRule
|
||||
|
@ -119,10 +119,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$NewActiveSyncDeviceAccessRuleParams = @{
|
||||
|
@ -158,7 +158,7 @@ function Set-TargetResource
|
|||
elseif ($Ensure -eq "Present" -and $currentActiveSyncDeviceAccessRuleConfig.Ensure -eq "Present")
|
||||
{
|
||||
Write-Verbose -Message "Active Sync Device Access Rule '$($Identity)' already exists, but needs updating."
|
||||
Write-Verbose -Message "Setting Active Sync Device Access Rule $($Identity) with values: $(Convert-O365DscHashtableToString -Hashtable $SetActiveSyncDeviceAccessRuleParams)"
|
||||
Write-Verbose -Message "Setting Active Sync Device Access Rule $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $SetActiveSyncDeviceAccessRuleParams)"
|
||||
Set-ActiveSyncDeviceAccessRule @SetActiveSyncDeviceAccessRuleParams
|
||||
}
|
||||
}
|
||||
|
@ -201,13 +201,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -232,9 +232,9 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
[array]$AllActiveSyncDeviceAccessRules = Get-ActiveSyncDeviceAccessRule
|
|
@ -39,10 +39,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AllAddressBookPolicies = Get-AddressBookPolicy
|
||||
|
@ -125,10 +125,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$NewAddressBookPolicyParams = @{
|
||||
|
@ -167,7 +167,7 @@ function Set-TargetResource
|
|||
elseif ($Ensure -eq "Present" -and $currentAddressBookPolicyConfig.Ensure -eq "Present")
|
||||
{
|
||||
Write-Verbose -Message "Address Book Policy '$($Name)' already exists, but needs updating."
|
||||
Write-Verbose -Message "Setting Address Book Policy $($Name) with values: $(Convert-O365DscHashtableToString -Hashtable $SetAddressBookPolicyParams)"
|
||||
Write-Verbose -Message "Setting Address Book Policy $($Name) with values: $(Convert-M365DscHashtableToString -Hashtable $SetAddressBookPolicyParams)"
|
||||
Set-AddressBookPolicy @SetAddressBookPolicyParams
|
||||
}
|
||||
}
|
||||
|
@ -212,13 +212,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -243,9 +243,9 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
[array]$AllAddressBookPolicies = Get-AddressBookPolicy
|
|
@ -108,10 +108,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$nullReturn = @{
|
||||
|
@ -192,7 +192,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found AddressList $($Name)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -309,10 +309,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
if ($RecipientFilter)
|
||||
|
@ -393,7 +393,7 @@ function Set-TargetResource
|
|||
elseif ($Ensure -eq "Present" -and $currentAddressListConfig.Ensure -eq "Present")
|
||||
{
|
||||
Write-Verbose -Message "Address List '$($Name)' already exists. Updating settings"
|
||||
Write-Verbose -Message "Setting Address List '$($Name)' with values: $(Convert-O365DscHashtableToString -Hashtable $SetAddressListParams)"
|
||||
Write-Verbose -Message "Setting Address List '$($Name)' with values: $(Convert-M365DscHashtableToString -Hashtable $SetAddressListParams)"
|
||||
Set-AddressList @SetAddressListParams
|
||||
}
|
||||
}
|
||||
|
@ -507,13 +507,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -538,10 +538,10 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
if ($null -eq (Get-Command 'Get-AddressList' -ErrorAction SilentlyContinue))
|
||||
{
|
|
@ -123,10 +123,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AntiPhishPolicies = Get-AntiPhishPolicy
|
||||
|
@ -184,7 +184,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found AntiPhishPolicy $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -313,10 +313,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AntiPhishPolicies = Get-AntiPhishPolicy
|
||||
|
@ -469,13 +469,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -500,9 +500,9 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline `
|
||||
-ErrorAction SilentlyContinue
|
||||
|
|
@ -63,10 +63,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
Write-Verbose -Message "Global ExchangeOnlineSession status:"
|
||||
|
@ -78,7 +78,7 @@ function Get-TargetResource
|
|||
}
|
||||
catch
|
||||
{
|
||||
New-Office365DSCLogEntry -Error $_ -Message "Couldn't get AntiPhishRules" -Source $MyInvocation.MyCommand.ModuleName
|
||||
New-M365DSCLogEntry -Error $_ -Message "Couldn't get AntiPhishRules" -Source $MyInvocation.MyCommand.ModuleName
|
||||
}
|
||||
|
||||
if ($null -ne $AntiPhishRules)
|
||||
|
@ -115,7 +115,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found AntiPhishRule $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -192,10 +192,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AntiPhishRules = Get-AntiPhishRule
|
||||
|
@ -294,8 +294,8 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
@ -306,7 +306,7 @@ function Test-TargetResource
|
|||
$ValuesToCheck.Remove("Enabled") | Out-Null
|
||||
}
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -331,9 +331,9 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline `
|
||||
-ErrorAction SilentlyContinue
|
||||
|
|
@ -40,10 +40,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$nullReturn = @{
|
||||
|
@ -138,10 +138,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$NewApplicationAccessPolicyParams = @{
|
||||
|
@ -176,7 +176,7 @@ function Set-TargetResource
|
|||
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-O365DscHashtableToString -Hashtable $SetApplicationAccessPolicyParams)"
|
||||
Write-Verbose -Message "Setting Application Access Policy $($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
|
||||
|
@ -230,13 +230,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -261,9 +261,9 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
try
|
|
@ -49,9 +49,9 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
try
|
||||
|
@ -80,7 +80,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found AtpPolicyForO365 $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
if ('Default' -ne $Identity)
|
||||
|
@ -148,14 +148,14 @@ function Set-TargetResource
|
|||
throw "EXOAtpPolicyForO365 configurations MUST specify Identity value of 'Default'"
|
||||
}
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AtpPolicyParams = $PSBoundParameters
|
||||
$AtpPolicyParams.Remove('Ensure') | Out-Null
|
||||
$AtpPolicyParams.Remove('GlobalAdminAccount') | Out-Null
|
||||
$AtpPolicyParams.Remove('IsSingleInstance') | Out-Null
|
||||
Write-Verbose -Message "Setting AtpPolicyForO365 $Identity with values: $(Convert-O365DscHashtableToString -Hashtable $AtpPolicyParams)"
|
||||
Write-Verbose -Message "Setting AtpPolicyForO365 $Identity with values: $(Convert-M365DscHashtableToString -Hashtable $AtpPolicyParams)"
|
||||
Set-AtpPolicyForO365 @AtpPolicyParams
|
||||
}
|
||||
|
||||
|
@ -208,15 +208,15 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
$ValuesToCheck.Remove('IsSingleInstance') | Out-Null
|
||||
$ValuesToCheck.Remove('Verbose') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -240,13 +240,13 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$organization = ""
|
||||
$principal = "" # Principal represents the "NetBios" name of the tenant (e.g. the O365DSC part of O365DSC.onmicrosoft.com)
|
||||
$principal = "" # Principal represents the "NetBios" name of the tenant (e.g. the M365DSC part of M365DSC.onmicrosoft.com)
|
||||
if ($GlobalAdminAccount.UserName.Contains("@"))
|
||||
{
|
||||
$organization = $GlobalAdminAccount.UserName.Split("@")[1]
|
|
@ -38,7 +38,7 @@ function Get-TargetResource
|
|||
|
||||
Write-Verbose -Message "Getting configuration of AvailabilityAddressSpace for $($Identity)"
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
try
|
||||
|
@ -47,7 +47,7 @@ function Get-TargetResource
|
|||
}
|
||||
catch
|
||||
{
|
||||
New-Office365DSCLogEntry -Error $_ -Message "Couldn't get AvailabilityAddressSpaces" -Source $MyInvocation.MyCommand.ModuleName
|
||||
New-M365DSCLogEntry -Error $_ -Message "Couldn't get AvailabilityAddressSpaces" -Source $MyInvocation.MyCommand.ModuleName
|
||||
}
|
||||
|
||||
|
||||
|
@ -84,7 +84,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found AvailabilityAddressSpace $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ function Set-TargetResource
|
|||
|
||||
Write-Verbose -Message "Setting configuration of AvailabilityAddressSpace for $($Identity)"
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
try
|
||||
|
@ -137,7 +137,7 @@ function Set-TargetResource
|
|||
}
|
||||
catch
|
||||
{
|
||||
New-Office365DSCLogEntry -Error $_ -Message "Couldn't get AvailabilityAddressSpaces" -Source $MyInvocation.MyCommand.ModuleName
|
||||
New-M365DSCLogEntry -Error $_ -Message "Couldn't get AvailabilityAddressSpaces" -Source $MyInvocation.MyCommand.ModuleName
|
||||
}
|
||||
|
||||
$AvailabilityAddressSpace = $AvailabilityAddressSpaces | Where-Object -FilterScript { $_.Identity -eq $Identity }
|
||||
|
@ -155,12 +155,12 @@ function Set-TargetResource
|
|||
}
|
||||
catch
|
||||
{
|
||||
New-Office365DSCLogEntry -Error $_ -Message "Couldn't add new AvailabilityAddressSpace" -Source $MyInvocation.MyCommand.ModuleName
|
||||
New-M365DSCLogEntry -Error $_ -Message "Couldn't add new AvailabilityAddressSpace" -Source $MyInvocation.MyCommand.ModuleName
|
||||
}
|
||||
}
|
||||
elseif (('Present' -eq $Ensure ) -and ($Null -ne $AvailabilityAddressSpace))
|
||||
{
|
||||
Write-Verbose -Message "Setting AvailabilityAddressSpace $($Identity) with values: $(Convert-O365DscHashtableToString -Hashtable $AvailabilityAddressSpaceParams)"
|
||||
Write-Verbose -Message "Setting AvailabilityAddressSpace $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $AvailabilityAddressSpaceParams)"
|
||||
# AvailabilityAddressSpace is a special case in that it does not have a "set-AvailabilityAddressSpace" cmdlet. To change values of an existing AvailabilityAddressSpace it must be removed and then added again with add-AvailabilityAddressSpace
|
||||
try
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ function Set-TargetResource
|
|||
}
|
||||
catch
|
||||
{
|
||||
New-Office365DSCLogEntry -Error $_ -Message "Couldn't remove AvailabilityAddressSpace" -Source $MyInvocation.MyCommand.ModuleName
|
||||
New-M365DSCLogEntry -Error $_ -Message "Couldn't remove AvailabilityAddressSpace" -Source $MyInvocation.MyCommand.ModuleName
|
||||
}
|
||||
|
||||
try
|
||||
|
@ -177,7 +177,7 @@ function Set-TargetResource
|
|||
}
|
||||
catch
|
||||
{
|
||||
New-Office365DSCLogEntry -Error $_ -Message "Couldn't add new AvailabilityAddressSpace" -Source $MyInvocation.MyCommand.ModuleName
|
||||
New-M365DSCLogEntry -Error $_ -Message "Couldn't add new AvailabilityAddressSpace" -Source $MyInvocation.MyCommand.ModuleName
|
||||
}
|
||||
}
|
||||
elseif (('Absent' -eq $Ensure ) -and ($null -ne $AvailabilityAddressSpace))
|
||||
|
@ -189,7 +189,7 @@ function Set-TargetResource
|
|||
}
|
||||
catch
|
||||
{
|
||||
New-Office365DSCLogEntry -Error $_ -Message "Couldn't remove AvailabilityAddressSpace" -Source $MyInvocation.MyCommand.ModuleName
|
||||
New-M365DSCLogEntry -Error $_ -Message "Couldn't remove AvailabilityAddressSpace" -Source $MyInvocation.MyCommand.ModuleName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -235,13 +235,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
||||
|
@ -262,7 +262,7 @@ function Export-TargetResource
|
|||
)
|
||||
|
||||
$InformationPreference = "Continue"
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline `
|
||||
-ErrorAction SilentlyContinue
|
||||
|
||||
|
@ -272,7 +272,7 @@ function Export-TargetResource
|
|||
}
|
||||
catch
|
||||
{
|
||||
New-Office365DSCLogEntry -Error $_ -Message "Couldn't get AvailabilityAddressSpaces" -Source $MyInvocation.MyCommand.ModuleName
|
||||
New-M365DSCLogEntry -Error $_ -Message "Couldn't get AvailabilityAddressSpaces" -Source $MyInvocation.MyCommand.ModuleName
|
||||
}
|
||||
|
||||
$content = ""
|
|
@ -20,7 +20,7 @@ function Get-TargetResource
|
|||
|
||||
Write-Verbose -Message "Getting configuration of Availability Config for $OrgWideAccount"
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AvailabilityConfigs = Get-AvailabilityConfig
|
||||
|
@ -75,7 +75,7 @@ function Set-TargetResource
|
|||
|
||||
$currentAvailabilityConfig = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
# CASE: Availability Config doesn't exist but should;
|
||||
|
@ -123,13 +123,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
||||
|
@ -154,9 +154,9 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AvailabilityConfig = Get-AvailabilityConfig
|
|
@ -39,10 +39,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$CASMailboxPlans = Get-CASMailboxPlan
|
||||
|
@ -68,7 +68,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found CASMailboxPlan $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -113,10 +113,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$CASMailboxPlanParams = $PSBoundParameters
|
||||
|
@ -128,7 +128,7 @@ function Set-TargetResource
|
|||
|
||||
if ($null -ne $CASMailboxPlan)
|
||||
{
|
||||
Write-Verbose -Message "Setting CASMailboxPlan $Identity with values: $(Convert-O365DscHashtableToString -Hashtable $CASMailboxPlanParams)"
|
||||
Write-Verbose -Message "Setting CASMailboxPlan $Identity with values: $(Convert-M365DscHashtableToString -Hashtable $CASMailboxPlanParams)"
|
||||
Set-CASMailboxPlan @CASMailboxPlanParams
|
||||
}
|
||||
else
|
||||
|
@ -177,13 +177,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -207,7 +207,7 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
|
@ -81,10 +81,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
|
||||
|
@ -124,7 +124,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found ClientAccessRule $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -211,10 +211,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
|
||||
|
@ -241,7 +241,7 @@ function Set-TargetResource
|
|||
}
|
||||
elseif (('Present' -eq $Ensure ) -and ($Null -ne $ClientAccessRule))
|
||||
{
|
||||
Write-Verbose -Message "Setting ClientAccessRule $($Identity) with values: $(Convert-O365DscHashtableToString -Hashtable $ClientAccessRuleParams)"
|
||||
Write-Verbose -Message "Setting ClientAccessRule $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $ClientAccessRuleParams)"
|
||||
Set-ClientAccessRule @ClientAccessRuleParams -Confirm:$false
|
||||
}
|
||||
elseif (('Absent' -eq $Ensure ) -and ($null -ne $ClientAccessRule))
|
||||
|
@ -333,13 +333,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -363,7 +363,7 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
|
@ -46,10 +46,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
Write-Verbose -Message "Global ExchangeOnlineSession status:"
|
||||
|
@ -63,7 +63,7 @@ function Get-TargetResource
|
|||
{
|
||||
Close-SessionsAndReturnError -ExceptionMessage $_.Exception
|
||||
$Message = "Error calling {Get-DkimSigningConfig}"
|
||||
New-Office365DSCLogEntry -Error $_ -Message $Message -Source $MyInvocation.MyCommand.ModuleName
|
||||
New-M365DSCLogEntry -Error $_ -Message $Message -Source $MyInvocation.MyCommand.ModuleName
|
||||
}
|
||||
$DkimSigningConfig = $DkimSigningConfigs | Where-Object -FilterScript { $_.Identity -eq $Identity }
|
||||
if (-not $DkimSigningConfig)
|
||||
|
@ -87,7 +87,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found DkimSigningConfig $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -139,10 +139,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$DkimSigningConfigs = Get-DkimSigningConfig
|
||||
|
@ -167,7 +167,7 @@ function Set-TargetResource
|
|||
$DkimSigningConfigParams.Remove('Ensure') | Out-Null
|
||||
$DkimSigningConfigParams.Remove('GlobalAdminAccount') | Out-Null
|
||||
$DkimSigningConfigParams.Remove('KeySize') | Out-Null
|
||||
Write-Verbose -Message "Setting DkimSigningConfig $($Identity) with values: $(Convert-O365DscHashtableToString -Hashtable $DkimSigningConfigParams)"
|
||||
Write-Verbose -Message "Setting DkimSigningConfig $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $DkimSigningConfigParams)"
|
||||
Set-DkimSigningConfig @DkimSigningConfigParams -Confirm:$false
|
||||
}
|
||||
|
||||
|
@ -225,13 +225,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -255,7 +255,7 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
|
@ -268,7 +268,7 @@ function Export-TargetResource
|
|||
$i = 1
|
||||
$content = ""
|
||||
$organization = ""
|
||||
$principal = "" # Principal represents the "NetBios" name of the tenant (e.g. the O365DSC part of O365DSC.onmicrosoft.com)
|
||||
$principal = "" # Principal represents the "NetBios" name of the tenant (e.g. the M365DSC part of M365DSC.onmicrosoft.com)
|
||||
if ($GlobalAdminAccount.UserName.Contains("@"))
|
||||
{
|
||||
$organization = $GlobalAdminAccount.UserName.Split("@")[1]
|
|
@ -40,10 +40,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AllEmailAddressPolicies = Get-EmailAddressPolicy
|
||||
|
@ -127,10 +127,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$NewEmailAddressPolicyParams = @{
|
||||
|
@ -179,7 +179,7 @@ function Set-TargetResource
|
|||
elseif ($Ensure -eq "Present" -and $currentEmailAddressPolicyConfig.Ensure -eq "Present")
|
||||
{
|
||||
Write-Verbose -Message "Email Address Policy '$($Name)' already exists, but needs updating."
|
||||
Write-Verbose -Message "Setting Email Address Policy $($Name) with values: $(Convert-O365DscHashtableToString -Hashtable $SetEmailAddressPolicyParams)"
|
||||
Write-Verbose -Message "Setting Email Address Policy $($Name) with values: $(Convert-M365DscHashtableToString -Hashtable $SetEmailAddressPolicyParams)"
|
||||
Set-EmailAddressPolicy @SetEmailAddressPolicyParams
|
||||
}
|
||||
}
|
||||
|
@ -225,13 +225,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -256,9 +256,9 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
[array]$AllEmailAddressPolicies = Get-EmailAddressPolicy
|
|
@ -105,10 +105,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$nullReturn = @{
|
||||
|
@ -300,10 +300,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
# RecipientFilter parameter cannot be used in combination with the IncludedRecipients parameter or any Conditional parameters (which are used to create precanned filters).
|
||||
|
@ -386,7 +386,7 @@ function Set-TargetResource
|
|||
elseif ($Ensure -eq "Present" -and $currentGlobalAddressListConfig.Ensure -eq "Present")
|
||||
{
|
||||
Write-Verbose -Message "Global Address List '$($Name)' already exists, but needs updating."
|
||||
Write-Verbose -Message "Setting Global Address List $($Name) with values: $(Convert-O365DscHashtableToString -Hashtable $SetGlobalAddressListParams)"
|
||||
Write-Verbose -Message "Setting Global Address List $($Name) with values: $(Convert-M365DscHashtableToString -Hashtable $SetGlobalAddressListParams)"
|
||||
Set-GlobalAddressList @SetGlobalAddressListParams
|
||||
}
|
||||
}
|
||||
|
@ -497,13 +497,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -528,9 +528,9 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
if ($null -eq (Get-Command 'Get-GlobalAddressList' -ErrorAction SilentlyContinue))
|
|
@ -43,10 +43,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
Write-Verbose -Message "Global ExchangeOnlineSession status:"
|
||||
|
@ -60,7 +60,7 @@ function Get-TargetResource
|
|||
{
|
||||
Close-SessionsAndReturnError -ExceptionMessage $_.Exception
|
||||
$Message = "Error calling {Get-HostedConnectionFilterPolicy}"
|
||||
New-Office365DSCLogEntry -Error $_ -Message $Message -Source $MyInvocation.MyCommand.ModuleName
|
||||
New-M365DSCLogEntry -Error $_ -Message $Message -Source $MyInvocation.MyCommand.ModuleName
|
||||
}
|
||||
|
||||
$HostedConnectionFilterPolicy = $HostedConnectionFilterPolicys | Where-Object -FilterScript { $_. Identity -eq $Identity }
|
||||
|
@ -90,7 +90,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found HostedConnectionFilterPolicy $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -139,10 +139,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$HostedConnectionFilterPolicys = Get-HostedConnectionFilterPolicy
|
||||
|
@ -239,15 +239,15 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
$ValuesToCheck.Remove('IsSingleInstance') | Out-Null
|
||||
$ValuesToCheck.Remove('Verbose') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -271,7 +271,7 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
|
|
@ -233,10 +233,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$HostedContentFilterPolicies = Get-HostedContentFilterPolicy
|
||||
|
@ -309,7 +309,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found HostedContentFilterPolicy $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -548,10 +548,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$HostedContentFilterPolicies = Get-HostedContentFilterPolicy
|
||||
|
@ -573,7 +573,7 @@ function Set-TargetResource
|
|||
}
|
||||
elseif (('Present' -eq $Ensure ) -and ($null -ne $HostedContentFilterPolicy))
|
||||
{
|
||||
Write-Verbose -Message "Setting HostedContentFilterPolicy $($Identity) with values: $(Convert-O365DscHashtableToString -Hashtable $HostedContentFilterPolicyParams)."
|
||||
Write-Verbose -Message "Setting HostedContentFilterPolicy $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $HostedContentFilterPolicyParams)."
|
||||
if ($PSBoundParameters.MakeDefault)
|
||||
{
|
||||
Set-HostedContentFilterPolicy @HostedContentFilterPolicyParams -MakeDefault -Confirm:$false
|
||||
|
@ -825,18 +825,18 @@ function Test-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -861,10 +861,10 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$HostedContentFilterPolicies = Get-HostedContentFilterPolicy
|
|
@ -63,10 +63,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
Write-Verbose -Message "Global ExchangeOnlineSession status:"
|
||||
|
@ -80,7 +80,7 @@ function Get-TargetResource
|
|||
{
|
||||
Close-SessionsAndReturnError -ExceptionMessage $_.Exception
|
||||
$Message = "Error calling {Get-HostedContentFilterRule}"
|
||||
New-Office365DSCLogEntry -Error $_ -Message $Message -Source $MyInvocation.MyCommand.ModuleName
|
||||
New-M365DSCLogEntry -Error $_ -Message $Message -Source $MyInvocation.MyCommand.ModuleName
|
||||
}
|
||||
$HostedContentFilterRule = $HostedContentFilterRules | Where-Object -FilterScript { $_.Identity -eq $Identity }
|
||||
if (-not $HostedContentFilterRule)
|
||||
|
@ -119,7 +119,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found HostedContentFilterRule $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -188,10 +188,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
Write-Verbose -Message "Global ExchangeOnlineSession status:"
|
||||
|
@ -292,13 +292,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -322,7 +322,7 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
|
@ -43,10 +43,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$HostedOutboundSpamFilterPolicies = Get-HostedOutboundSpamFilterPolicy
|
||||
|
@ -73,7 +73,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found HostedOutboundSpamFilterPolicy $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -122,17 +122,17 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$HostedOutboundSpamFilterPolicyParams = $PSBoundParameters
|
||||
$HostedOutboundSpamFilterPolicyParams.Remove('Ensure') | Out-Null
|
||||
$HostedOutboundSpamFilterPolicyParams.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
Write-Verbose -Message "Setting HostedOutboundSpamFilterPolicy $Identity with values: $(Convert-O365DscHashtableToString -Hashtable $HostedOutboundSpamFilterPolicyParams)"
|
||||
Write-Verbose -Message "Setting HostedOutboundSpamFilterPolicy $Identity with values: $(Convert-M365DscHashtableToString -Hashtable $HostedOutboundSpamFilterPolicyParams)"
|
||||
Set-HostedOutboundSpamFilterPolicy @HostedOutboundSpamFilterPolicyParams
|
||||
}
|
||||
|
||||
|
@ -180,14 +180,14 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
$ValuesToCheck.Remove('Verbose') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -211,7 +211,7 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
|
@ -74,7 +74,7 @@ function Get-TargetResource
|
|||
|
||||
Write-Verbose -Message "Getting configuration of InboundConnector for $($Identity)"
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$InboundConnectors = Get-InboundConnector
|
||||
|
@ -109,7 +109,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found InboundConnector $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ function Set-TargetResource
|
|||
|
||||
Write-Verbose -Message "Setting configuration of InboundConnector for $($Identity)"
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$InboundConnectors = Get-InboundConnector
|
||||
|
@ -207,7 +207,7 @@ function Set-TargetResource
|
|||
}
|
||||
elseif (('Present' -eq $Ensure ) -and ($Null -ne $InboundConnector))
|
||||
{
|
||||
Write-Verbose -Message "Setting InboundConnector $($Identity) with values: $(Convert-O365DscHashtableToString -Hashtable $InboundConnectorParams)"
|
||||
Write-Verbose -Message "Setting InboundConnector $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $InboundConnectorParams)"
|
||||
Set-InboundConnector @InboundConnectorParams -Confirm:$false
|
||||
}
|
||||
elseif (('Absent' -eq $Ensure ) -and ($null -ne $InboundConnector))
|
||||
|
@ -295,13 +295,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
||||
|
@ -322,7 +322,7 @@ function Export-TargetResource
|
|||
)
|
||||
|
||||
$InformationPreference = "Continue"
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline `
|
||||
-ErrorAction SilentlyContinue
|
||||
|
|
@ -32,7 +32,7 @@ function Get-TargetResource
|
|||
|
||||
Write-Verbose -Message "Getting configuration of IntraOrganizationConnector for $($Identity)"
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$IntraOrganizationConnectors = Get-IntraOrganizationConnector
|
||||
|
@ -57,7 +57,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found IntraOrganizationConnector $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ function Set-TargetResource
|
|||
|
||||
Write-Verbose -Message "Setting configuration of IntraOrganizationConnector for $($Identity)"
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$IntraOrganizationConnectors = Get-IntraOrganizationConnector
|
||||
|
@ -113,7 +113,7 @@ function Set-TargetResource
|
|||
}
|
||||
elseif (('Present' -eq $Ensure ) -and ($Null -ne $IntraOrganizationConnector))
|
||||
{
|
||||
Write-Verbose -Message "Setting IntraOrganizationConnector $($Identity) with values: $(Convert-O365DscHashtableToString -Hashtable $IntraOrganizationConnectorParams)"
|
||||
Write-Verbose -Message "Setting IntraOrganizationConnector $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $IntraOrganizationConnectorParams)"
|
||||
Set-IntraOrganizationConnector @IntraOrganizationConnectorParams -Confirm:$false
|
||||
}
|
||||
elseif (('Absent' -eq $Ensure ) -and ($null -ne $IntraOrganizationConnector))
|
||||
|
@ -160,13 +160,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
||||
|
@ -187,7 +187,7 @@ function Export-TargetResource
|
|||
)
|
||||
|
||||
$InformationPreference = "Continue"
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline `
|
||||
-ErrorAction SilentlyContinue
|
||||
|
|
@ -43,7 +43,7 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
$nullReturn = @{
|
||||
|
@ -57,7 +57,7 @@ function Get-TargetResource
|
|||
GlobalAdminAccount = $null
|
||||
}
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$OrgConfig = Get-OrganizationConfig
|
||||
|
@ -128,12 +128,12 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
$OrgConfig = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
# CASE : MailTipsAllTipsEnabled is used
|
||||
|
@ -214,10 +214,10 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck @("MailTipsAllTipsEnabled",
|
||||
|
@ -248,7 +248,7 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
|
@ -256,7 +256,7 @@ function Export-TargetResource
|
|||
-ErrorAction SilentlyContinue
|
||||
|
||||
$organization = ""
|
||||
$principal = "" # Principal represents the "NetBios" name of the tenant (e.g. the O365DSC part of O365DSC.onmicrosoft.com)
|
||||
$principal = "" # Principal represents the "NetBios" name of the tenant (e.g. the M365DSC part of M365DSC.onmicrosoft.com)
|
||||
if ($GlobalAdminAccount.UserName.Contains("@"))
|
||||
{
|
||||
$organization = $GlobalAdminAccount.UserName.Split("@")[1]
|
|
@ -31,7 +31,7 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
$nullReturn = @{
|
||||
|
@ -41,7 +41,7 @@ function Get-TargetResource
|
|||
Ensure = "Absent"
|
||||
}
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
try
|
||||
|
@ -102,9 +102,9 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$currentMailbox = Get-TargetResource @PSBoundParameters
|
||||
|
@ -161,10 +161,10 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck @("Ensure", `
|
||||
|
@ -193,7 +193,7 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
|
@ -104,10 +104,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$MalwareFilterPolicys = Get-MalwareFilterPolicy
|
||||
|
@ -149,7 +149,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found MalwareFilterPolicy $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ function Set-TargetResource
|
|||
|
||||
Write-Verbose -Message "Setting configuration of MalwareFilterPolicy for $($Identity)"
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$MalwareFilterPolicys = Get-MalwareFilterPolicy
|
||||
|
@ -275,7 +275,7 @@ function Set-TargetResource
|
|||
}
|
||||
elseif (('Present' -eq $Ensure ) -and ($Null -ne $MalwareFilterPolicy))
|
||||
{
|
||||
Write-Verbose -Message "Setting MalwareFilterPolicy $($Identity) with values: $(Convert-O365DscHashtableToString -Hashtable $MalwareFilterPolicyParams)"
|
||||
Write-Verbose -Message "Setting MalwareFilterPolicy $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $MalwareFilterPolicyParams)"
|
||||
Set-MalwareFilterPolicy @MalwareFilterPolicyParams -Confirm:$false
|
||||
}
|
||||
elseif (('Absent' -eq $Ensure ) -and ($null -ne $MalwareFilterPolicy))
|
||||
|
@ -391,13 +391,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
||||
|
@ -418,7 +418,7 @@ function Export-TargetResource
|
|||
)
|
||||
|
||||
$InformationPreference = "Continue"
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline `
|
||||
-ErrorAction SilentlyContinue
|
||||
|
|
@ -64,10 +64,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$MalwareFilterRules = Get-MalwareFilterRule
|
||||
|
@ -99,7 +99,7 @@ function Get-TargetResource
|
|||
}
|
||||
|
||||
Write-Verbose -Message "Found MalwareFilterRule $($Identity)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
|
||||
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)"
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ function Set-TargetResource
|
|||
|
||||
Write-Verbose -Message "Setting configuration of MalwareFilterRule for $($Identity)"
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$MalwareFilterRules = Get-MalwareFilterRule
|
||||
|
@ -186,7 +186,7 @@ function Set-TargetResource
|
|||
elseif (('Present' -eq $Ensure ) -and ($Null -ne $MalwareFilterRule))
|
||||
{
|
||||
$MalwareFilterRuleParams.Remove('Enabled') | Out-Null
|
||||
Write-Verbose -Message "Setting MalwareFilterRule $($Identity) with values: $(Convert-O365DscHashtableToString -Hashtable $MalwareFilterRuleParams)"
|
||||
Write-Verbose -Message "Setting MalwareFilterRule $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $MalwareFilterRuleParams)"
|
||||
Set-MalwareFilterRule @MalwareFilterRuleParams -Confirm:$false
|
||||
}
|
||||
elseif (('Absent' -eq $Ensure ) -and ($null -ne $MalwareFilterRule))
|
||||
|
@ -261,13 +261,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
||||
|
@ -288,7 +288,7 @@ function Export-TargetResource
|
|||
)
|
||||
|
||||
$InformationPreference = "Continue"
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline `
|
||||
-ErrorAction SilentlyContinue
|
||||
|
|
@ -32,10 +32,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AllManagementRoles = Get-ManagementRole
|
||||
|
@ -107,10 +107,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$NewManagementRoleParams = @{
|
||||
|
@ -138,7 +138,7 @@ function Set-TargetResource
|
|||
elseif ($Ensure -eq "Present" -and $currentManagementRoleConfig.Ensure -eq "Present")
|
||||
{
|
||||
Write-Verbose -Message "Management Role '$($Name)' already exists, but needs updating. Re-create management role."
|
||||
Write-Verbose -Message "Setting Management Role $($Name) with values: $(Convert-O365DscHashtableToString -Hashtable $NewManagementRoleParams)"
|
||||
Write-Verbose -Message "Setting Management Role $($Name) with values: $(Convert-M365DscHashtableToString -Hashtable $NewManagementRoleParams)"
|
||||
# Since there is no Set-ManagementRole cmdlet available, remove management role and re-create it
|
||||
Remove-ManagementRole -Identity $Name -Confirm:$false -Force
|
||||
New-ManagementRole @NewManagementRoleParams
|
||||
|
@ -178,13 +178,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -209,9 +209,9 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
[array]$AllManagementRoles = Get-ManagementRole
|
|
@ -246,10 +246,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AllMobileDeviceMailboxPolicies = Get-MobileDeviceMailboxPolicy
|
||||
|
@ -639,10 +639,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$NewMobileDeviceMailboxPolicyParams = @{
|
||||
|
@ -725,7 +725,7 @@ function Set-TargetResource
|
|||
elseif ($Ensure -eq "Present" -and $currentMobileDeviceMailboxPolicyConfig.Ensure -eq "Present")
|
||||
{
|
||||
Write-Verbose -Message "Mobile Device Mailbox Policy '$($Name)' already exists, but needs updating."
|
||||
Write-Verbose -Message "Setting Mobile Device Mailbox Policy $($Name) with values: $(Convert-O365DscHashtableToString -Hashtable $SetMobileDeviceMailboxPolicyParams)"
|
||||
Write-Verbose -Message "Setting Mobile Device Mailbox Policy $($Name) with values: $(Convert-M365DscHashtableToString -Hashtable $SetMobileDeviceMailboxPolicyParams)"
|
||||
Set-MobileDeviceMailboxPolicy @SetMobileDeviceMailboxPolicyParams
|
||||
}
|
||||
}
|
||||
|
@ -977,13 +977,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -1008,9 +1008,9 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
[array]$AllMobileDeviceMailboxPolicies = Get-MobileDeviceMailboxPolicy
|
|
@ -40,7 +40,7 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
$nullReturn = @{
|
||||
|
@ -57,7 +57,7 @@ function Get-TargetResource
|
|||
{
|
||||
return $nullReturn
|
||||
}
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AllOfflineAddressBooks = Get-OfflineAddressBook
|
||||
|
@ -130,10 +130,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$NewOfflineAddressBookParams = @{
|
||||
|
@ -173,7 +173,7 @@ function Set-TargetResource
|
|||
elseif ($Ensure -eq "Present" -and $currentOfflineAddressBookConfig.Ensure -eq "Present")
|
||||
{
|
||||
Write-Verbose -Message "Offline Address Book '$($Name)' already exists, but needs updating."
|
||||
Write-Verbose -Message "Setting Offline Address Book $($Name) with values: $(Convert-O365DscHashtableToString -Hashtable $SetOfflineAddressBookParams)"
|
||||
Write-Verbose -Message "Setting Offline Address Book $($Name) with values: $(Convert-M365DscHashtableToString -Hashtable $SetOfflineAddressBookParams)"
|
||||
Set-OfflineAddressBook @SetOfflineAddressBookParams
|
||||
}
|
||||
}
|
||||
|
@ -219,13 +219,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -250,9 +250,9 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
if ($null -eq (Get-Command 'Get-OfflineAddressBook' -ErrorAction SilentlyContinue))
|
|
@ -51,10 +51,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$AllOnPremisesOrganizations = Get-OnPremisesOrganization
|
||||
|
@ -155,10 +155,10 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$NewOnPremisesOrganizationParams = @{
|
||||
|
@ -202,7 +202,7 @@ function Set-TargetResource
|
|||
elseif ($Ensure -eq "Present" -and $currentOnPremisesOrganizationConfig.Ensure -eq "Present")
|
||||
{
|
||||
Write-Verbose -Message "On-premises Organization '$($Identity)' already exists, but needs updating."
|
||||
Write-Verbose -Message "Setting On-premises Organization $($Identity) with values: $(Convert-O365DscHashtableToString -Hashtable $SetOnPremisesOrganizationParams)"
|
||||
Write-Verbose -Message "Setting On-premises Organization $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $SetOnPremisesOrganizationParams)"
|
||||
Set-OnPremisesOrganization @SetOnPremisesOrganizationParams
|
||||
}
|
||||
}
|
||||
|
@ -259,13 +259,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -290,9 +290,9 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
[array]$AllOnPremisesOrganizations = Get-OnPremisesOrganization
|
|
@ -278,10 +278,10 @@ function Get-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
$ConfigSettings = Get-OrganizationConfig
|
||||
|
@ -658,7 +658,7 @@ function Set-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
if ($null -ne $EwsAllowList -and $null -ne $EwsBlockList)
|
||||
|
@ -668,11 +668,11 @@ function Set-TargetResource
|
|||
|
||||
Write-Verbose -Message "Setting EXOOrganizationConfig"
|
||||
|
||||
Test-MSCloudLogin -O365Credential $GlobalAdminAccount `
|
||||
Test-MSCloudLogin -CloudCredential $GlobalAdminAccount `
|
||||
-Platform ExchangeOnline
|
||||
|
||||
|
||||
Write-Verbose -Message "Setting EXOOrganizationConfig with values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Setting EXOOrganizationConfig with values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
$SetValues = $PSBoundParameters
|
||||
$SetValues.Remove('IsSingleInstance')
|
||||
$SetValues.Remove('GlobalAdminAccount')
|
||||
|
@ -958,13 +958,13 @@ function Test-TargetResource
|
|||
|
||||
$CurrentValues = Get-TargetResource @PSBoundParameters
|
||||
|
||||
Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)"
|
||||
Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)"
|
||||
|
||||
$ValuesToCheck = $PSBoundParameters
|
||||
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null
|
||||
|
||||
$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
|
||||
$TestResult = Test-Microsoft365DSCParameterState -CurrentValues $CurrentValues `
|
||||
-Source $($MyInvocation.MyCommand.Source) `
|
||||
-DesiredValues $PSBoundParameters `
|
||||
-ValuesToCheck $ValuesToCheck.Keys
|
||||
|
@ -989,7 +989,7 @@ function Export-TargetResource
|
|||
$data = [System.Collections.Generic.Dictionary[[String], [String]]]::new()
|
||||
$data.Add("Resource", $MyInvocation.MyCommand.ModuleName)
|
||||
$data.Add("Method", $MyInvocation.MyCommand)
|
||||
Add-O365DSCTelemetryEvent -Data $data
|
||||
Add-M365DSCTelemetryEvent -Data $data
|
||||
#endregion
|
||||
|
||||
$Params = @{
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче