From 6eeda43739bcb164a4411fce2e7a60f78ea55168 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 21 Oct 2020 09:37:37 -0400 Subject: [PATCH 01/10] Update CHANGELOG.md --- .../MSFT_AADPolicy/MSFT_AADPolicy.psm1 | 363 ++++++++++++++++++ .../MSFT_AADPolicy/MSFT_AADPolicy.schema.mof | 17 + .../DSCResources/MSFT_AADPolicy/readme.md | 16 + .../AADPolicy/1-ConfigureAADPolicy.ps1 | 29 ++ .../Microsoft365DSC.AADPolicy.Tests.ps1 | 253 ++++++++++++ 5 files changed, 678 insertions(+) create mode 100644 Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 create mode 100644 Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.schema.mof create mode 100644 Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/readme.md create mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 create mode 100644 Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 new file mode 100644 index 0000000000..039ff64607 --- /dev/null +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 @@ -0,0 +1,363 @@ +function Get-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [Parameter(Mandatory = $true)] + [System.String] + $DisplayName, + + [Parameter()] + [System.String] + $Id, + + [Parameter()] + [ValidateSet('Present', 'Absent')] + [System.String] + $Ensure = 'Present', + + [Parameter()] + [System.Management.Automation.PSCredential] + $GlobalAdminAccount, + + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + + Write-Verbose -Message "Getting configuration of AzureAD Policy" + #region Telemetry + $ResourceName = $MyInvocation.MyCommand.ModuleName.Replace("MSFT_", "") + $data = [System.Collections.Generic.Dictionary[[String], [String]]]::new() + $data.Add("Resource", $ResourceName) + $data.Add("Method", $MyInvocation.MyCommand) + $data.Add("Principal", $GlobalAdminAccount.UserName) + $data.Add("TenantId", $TenantId) + Add-M365DSCTelemetryEvent -Data $data + #endregion + + $ConnectionMode = New-M365DSCConnection -Platform 'AzureAD' -InboundParameters $PSBoundParameters + + try + { + $nullReturn = $PSBoundParameters + $nullReturn.Ensure = "Absent" + try + { + if ($null -ne $Id) + { + $Policy = Get-AzureADPolicy -ID $Id + } + } + catch + { + Write-Verbose -Message "Could not retrieve AzureAD Policy by ID {$Id}" + } + if ($null -eq $Policy) + { + try + { + $Policy = Get-AzureADPolicy -All $True -ErrorAction SilentlyContinue | Where-Object {$_.DisplayName -like $DisplayName} + } + catch + { + Write-Verbose -Message $_ + ADD-M365DSCEvent -Message $_ -EntryType 'Error' ` + -EventID 1 -Source $($MyInvocation.MyCommand.Source) + } + } + if ($null -eq $Policy) + { + return $nullReturn + } + else + { + Write-Verbose "Found existing AzureAD Policys" + $Result = @{ + Id = $Policy.Id + OdataType = $Policy.OdataType + AlternativeIdentifier = $Policy.AlternativeIdentifier + Definition = $Policy.Definition + DisplayName = $Policy.DisplayName + IsOrganizationDefault = $Policy.IsOrganizationDefault + KeyCredentials = $Policy.KeyCredentials + Type = $policy.Type + Ensure = "Present" + GlobalAdminAccount = $GlobalAdminAccount + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + + Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)" + return $result + } + } + catch + { + Write-Verbose -Message $_ + Add-M365DSCEvent -Message $_ -EntryType 'Error' ` + -EventID 1 -Source $($MyInvocation.MyCommand.Source) + return $nullReturn + } +} + +function Set-TargetResource +{ + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [System.String] + $DisplayName, + + [Parameter()] + [System.String] + $Id, + + [Parameter()] + [System.String] + $AlternativeIdentifier, + + [Parameter()] + [System.Collections.Generic.List`1[System.String]] + $Definition, + + [Parameter()] + [Boolean] + $isOrganizationDefault, + + [Parameter()] + [System.Collections.Generic.List`1[System.String]] + $KeyCredentials, + + [Parameter()] + [System.String] + $Type, + + [Parameter()] + [ValidateSet('Present', 'Absent')] + [System.String] + $Ensure = 'Present', + + [Parameter()] + [System.Management.Automation.PSCredential] + $GlobalAdminAccount, + + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + + Write-Verbose -Message "Setting configuration of Azure AD Policy" + #region Telemetry + $ResourceName = $MyInvocation.MyCommand.ModuleName.Replace("MSFT_", "") + $data = [System.Collections.Generic.Dictionary[[String], [String]]]::new() + $data.Add("Resource", $ResourceName) + $data.Add("Method", $MyInvocation.MyCommand) + $data.Add("Principal", $GlobalAdminAccount.UserName) + $data.Add("TenantId", $TenantId) + Add-M365DSCTelemetryEvent -Data $data + #endregion + + $currentAADPolicy = Get-TargetResource @PSBoundParameters + $currentParameters = $PSBoundParameters + $currentParameters.Remove("OdataType") | Out-Null + $currentParameters.Remove("ApplicationId") | Out-Null + $currentParameters.Remove("TenantId") | Out-Null + $currentParameters.Remove("CertificateThumbprint") | Out-Null + $currentParameters.Remove("GlobalAdminAccount") | Out-Null + $currentParameters.Remove("Ensure") | Out-Null + + # Policy should exist but it doesn't + if($Ensure -eq 'Present' -and $currentAADPolicy.Ensure -eq "Absent") + { + Write-Verbose -Message "Creating New AzureAD Policy {$Displayname}" + $currentParameters.Remove("Id") | Out-Null + New-AzureADPolicy @currentParameters + } + # Policy should exist and will be configured to desire state + elseif ($Ensure -eq 'Present' -and $CurrentAADPolicy.Ensure -eq 'Present') + { + Write-Verbose -Message "Updating exisitng AzureAD Policy {$DisplayName}" + $currentParameters.Id = $currentAADPolicy.ID + Set-AzureADPolicy @currentParameters + } + # Policy exist but should not + elseif ($Ensure -eq 'Absent' -and $CurrentAADPolicy.Ensure -eq 'Present') + { + Write-Verbose -Message "Removing AzureAD Policy {$DisplayName}" + Remove-AzureADPolicy -ID $currentAADPolicy.ID + } +} + +function Test-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [Parameter(Mandatory = $true)] + [System.String] + $DisplayName, + + [Parameter()] + [System.String] + $Id, + + [Parameter()] + [System.String] + $AlternativeIdentifier, + + [Parameter()] + [System.Collections.Generic.List`1[System.String]] + $Definition, + + [Parameter()] + [Boolean] + $isOrganizationDefault, + + [Parameter()] + [System.Collections.Generic.List`1[System.String]] + $KeyCredentials, + + [Parameter()] + [System.String] + $Type, + + [Parameter()] + [ValidateSet('Present', 'Absent')] + [System.String] + $Ensure = 'Present', + + [Parameter()] + [System.Management.Automation.PSCredential] + $GlobalAdminAccount, + + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + + Write-Verbose -Message "Testing configuration of AzureAD Policy" + + $CurrentValues = Get-TargetResource @PSBoundParameters + + Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $PSBoundParameters)" + + $ValuesToCheck = $PSBoundParameters + $ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null + $ValuesToCheck.Remove("Id") | Out-Null + + $TestResult = Test-M365DSCParameterState -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()] + [System.Management.Automation.PSCredential] + $GlobalAdminAccount, + + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + #region Telemetry + $ResourceName = $MyInvocation.MyCommand.ModuleName.Replace("MSFT_", "") + $data = [System.Collections.Generic.Dictionary[[String], [String]]]::new() + $data.Add("Resource", $ResourceName) + $data.Add("Method", $MyInvocation.MyCommand) + $data.Add("Principal", $GlobalAdminAccount.UserName) + $data.Add("TenantId", $TenantId) + Add-M365DSCTelemetryEvent -Data $data + #endregion + + $dscContent = '' + $ConnectionMode = New-M365DSCConnection -Platform 'AzureAD' -InboundParameters $PSBoundParameters + $i = 1 + Write-Host "`r`n" -NoNewLine + try + { + $AADPolicy = Get-AzureADPolicy -ErrorAction Stop + foreach($AADPolicy in $AADPolicys) + { + Write-Host " |---[$i/$($AADPolicys.Count)] $($AADPolicy.DisplayName)" -NoNewLine + $Params = @{ + GlobalAdminAccount = $GlobalAdminAccount + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + DisplayName = $AADPolicy.DisplayName + ID = $AADPolicy.ID + } + $Results = Get-TargetResource @Params + + if ($Results.Ensure -eq 'Present') + { + $Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode ` + -Results $Results + $dscContent += Get-M365DSCExportContentForResource -ResourceName $ResourceName ` + -ConnectionMode $ConnectionMode ` + -ModulePath $PSScriptRoot ` + -Results $Results ` + -GlobalAdminAccount $GlobalAdminAccount + Write-Host $Global:M365DSCEmojiGreenCheckMark + $i++ + } + } + return $dscContent + } + catch + { + Write-Verbose -Message $_ + Add-M365DSCEvent -Message $_ -EntryType 'Error' ` + -EventID 1 -Source $($MyInvocation.MyCommand.Source) + return "" + } +} + +Export-ModuleMember -Function *-TargetResource diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.schema.mof new file mode 100644 index 0000000000..09e7511320 --- /dev/null +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.schema.mof @@ -0,0 +1,17 @@ +[ClassVersion("1.0.0.0"), FriendlyName("AADPolicy")] +class MSFT_AADPolicy : OMI_BaseResource +{ + [Key, Description("DisplayName of the Policy")] string DisplayName; + [Write, Description("ObjectID of the Policy.")] String ObjectId; + [Write, Description("AlternativeIdentifier Policy.")] string AlternativeIdentifier + [Write, Description("Definition of the Policy.")] System.Collections.Generic.List`1[System.String] Definition; + [Write, Description("IsOrganizationDefault of the Policy.")] Boolean IsOrganizationDefault; + [Write, Description("KeyCredentials of the Policy.")] System.Collections.Generic.List`1[System.String] KeyCredentials; + [Write, Description("Type of the Policy.")] string Type; + [Write, Description("Specify if the Azure AD Policy should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; + [Write, Description("Credentials of the Azure AD Admin"), EmbeddedInstance("MSFT_Credential")] string GlobalAdminAccount; + [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; + [Write, Description("Id of the Azure Active Directory tenant used for authentication.")] String TenantId; + [Write, Description("Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication.")] String CertificateThumbprint; + +}; diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/readme.md b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/readme.md new file mode 100644 index 0000000000..cab71596b0 --- /dev/null +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/readme.md @@ -0,0 +1,16 @@ +# AAD Policy + +## Description + +This resource configures the Azure AD Policys + +## Azure AD Permissions + +To authenticate via Azure Active Directory, this resource required the following Application permissions: + +* **Automate** + * Policy.Read.All,Policy.ReadWrite.ApplicationConfiguration +* **Export** + * None + +NOTE: All permisions listed above require admin consent. diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 new file mode 100644 index 0000000000..36a82a1b1c --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsGlobalAdmin + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + AADPolicy DSCPolicy1 + { + DisplayName = "PolicyDisplayName" + AlternativeIdentifier = "" + Definition = "{{"B2BManagementPolicy":{"InvitationsAllowedAndBlockedDomainsPolicy":{"BlockedDomains":[]},"PreviewPolicy":{"Features":["OneTimePasscode"]},"AutoRedeemPolicy":{"AdminConsentedForUsersIntoTenantIds":[],"NoAADConsentForUsersFromTenantsIds":[]}}}}" + IsOrganizationDefault = $false + KeyCredentials = {} + Type = "TokenIssuancePolicy" + Ensure = "Present" + GlobalAdminAccount = $credsGlobalAdmin + } + } +} diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 new file mode 100644 index 0000000000..b3db26b85e --- /dev/null +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 @@ -0,0 +1,253 @@ +[CmdletBinding()] +param( +) +$M365DSCTestFolder = Join-Path -Path $PSScriptRoot ` + -ChildPath "..\..\Unit" ` + -Resolve +$CmdletModule = (Join-Path -Path $M365DSCTestFolder ` + -ChildPath "\Stubs\Microsoft365.psm1" ` + -Resolve) +$GenericStubPath = (Join-Path -Path $M365DSCTestFolder ` + -ChildPath "\Stubs\Generic.psm1" ` + -Resolve) +Import-Module -Name (Join-Path -Path $M365DSCTestFolder ` + -ChildPath "\UnitTestHelper.psm1" ` + -Resolve) + +$Global:DscHelper = New-M365DscUnitTestHelper -StubModule $CmdletModule ` + -DscResource "AADPolicy" -GenericStubModule $GenericStubPath +Describe -Name $Global:DscHelper.DescribeHeader -Fixture { + InModuleScope -ModuleName $Global:DscHelper.ModuleName -ScriptBlock { + Invoke-Command -ScriptBlock $Global:DscHelper.InitializeScript -NoNewScope + BeforeAll { + $secpasswd = ConvertTo-SecureString "test@password1" -AsPlainText -Force + $GlobalAdminAccount = New-Object System.Management.Automation.PSCredential ("tenantadmin", $secpasswd) + + Mock -CommandName Update-M365DSCExportAuthenticationResults -MockWith { + return @{} + } + + Mock -CommandName Get-M365DSCExportContentForResource -MockWith { + + } + + Mock -CommandName Get-PSSession -MockWith { + + } + + Mock -CommandName Remove-PSSession -MockWith { + + } + + Mock -CommandName Set-AzureADPolicy -MockWith { + + } + + Mock -CommandName Remove-AzureADPolicy -MockWith { + + } + + Mock -CommandName New-AzureADPolicy -MockWith { + + } + + Mock -CommandName New-M365DSCConnection -MockWith { + return "Credential" + } + } + + # Test contexts + Context -Name "The Policy should exist but it does not" -Fixture { + BeforeAll { + $testParams = @{ + DisplayName = "PolicyDisplayName" + AlternativeIdentifier = "" + Definition = {{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}} + IsOrganizationDefault = $false + KeyCredentials = {} + Type = "TokenIssuancePolicy" + Ensure = "Present" + GlobalAdminAccount = $credsGlobalAdmin + } + + Mock -CommandName Get-AzureADPolicy -MockWith { + return $null + } + } + + It "Should return values from the get method" { + (Get-TargetResource @testParams).Ensure | Should -Be 'Absent' + Should -Invoke -CommandName "Get-AzureADPolicy" -Exactly 2 + } + It 'Should return false from the test method' { + Test-TargetResource @testParams | Should -Be $false + } + It 'Should create the Policy from the set method' { + Set-TargetResource @testParams + Should -Invoke -CommandName "New-AzureADPolicy" -Exactly 1 + } + } + Context -Name "The Policy exists but it should not" -Fixture { + BeforeAll { + $testParams = @{ + DisplayName = "PolicyDisplayName" + AlternativeIdentifier = "" + Definition = {{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}} + IsOrganizationDefault = $false + KeyCredentials = {} + Type = "TokenIssuancePolicy" + Ensure = "Absent" + GlobalAdminAccount = $credsGlobalAdmin + } + + Mock -CommandName New-M365DSCConnection -MockWith { + return "Credential" + } + + Mock -CommandName Get-AzureADPolicy -MockWith { + $AADPolicy = New-Object PSCustomObject + $AADPolicy | Add-Member -MemberType NoteProperty -Name DisplayName -Value "PolicyDisplayName" + $AADPolicy | Add-Member -MemberType NoteProperty -Name ID -Value "78a80fa1-8ced-4019-94d8-2e0130644496" + $AADPolicy | Add-Member -MemberType NoteProperty -Name AlternativeIdentifier -Value "" + $AADPolicy | Add-Member -MemberType NoteProperty -Name Definition -Value '{{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}}' + $AADPolicy | Add-Member -MemberType NoteProperty -Name isOrganizationDefault -Value "false" + $AADPolicy | Add-Member -MemberType NoteProperty -Name KeyCredentials -Value "" + $AADPolicy | Add-Member -MemberType NoteProperty -Name Type -Value "TokenIssuancePolicy" + + return $AADPolicy + } + } + + It "Should return values from the get method" { + (Get-TargetResource @testParams).Ensure | Should -Be 'Present' + Should -Invoke -CommandName "Get-AzureADPolicy" -Exactly 1 + } + + It 'Should return false from the test method' { + Test-TargetResource @testParams | Should -Be $false + } + + It 'Should remove the app from the set method' { + Set-TargetResource @testParams + Should -Invoke -CommandName "Remove-AzureADAzureADPolicy" -Exactly 1 + } + } + Context -Name "The Policy exists and values are already in the desired state" -Fixture { + BeforeAll { + $testParams = @{ + DisplayName = "PolicyDisplayName" + AlternativeIdentifier = "" + Definition = {{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}} + IsOrganizationDefault = $false + KeyCredentials = {} + Type = "TokenIssuancePolicy" + Ensure = "Present" + GlobalAdminAccount = $credsGlobalAdmin + } + + Mock -CommandName New-M365DSCConnection -MockWith { + return "Credential" + } + + Mock -CommandName Get-AzureADPolicy -MockWith { + $AADPolicy = New-Object PSCustomObject + $AADPolicy | Add-Member -MemberType NoteProperty -Name DisplayName -Value "PolicyDisplayName" + $AADPolicy | Add-Member -MemberType NoteProperty -Name ID -Value "78a80fa1-8ced-4019-94d8-2e0130644496" + $AADPolicy | Add-Member -MemberType NoteProperty -Name AlternativeIdentifier -Value "" + $AADPolicy | Add-Member -MemberType NoteProperty -Name Definition -Value '{{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}}' + $AADPolicy | Add-Member -MemberType NoteProperty -Name isOrganizationDefault -Value "false" + $AADPolicy | Add-Member -MemberType NoteProperty -Name KeyCredentials -Value "" + $AADPolicy | Add-Member -MemberType NoteProperty -Name Type -Value "TokenIssuancePolicy" + + return $AADPolicy + } + } + + It "Should return Values from the get method" { + Get-TargetResource @testParams + Should -Invoke -CommandName "Get-AzureADPolicy" -Exactly 1 + } + + It 'Should return true from the test method' { + Test-TargetResource @testParams | Should -Be $true + } + } + + Context -Name "Values are not in the desired state" -Fixture { + BeforeAll { + $testParams = @{ + DisplayName = "PolicyDisplayName" + AlternativeIdentifier = "" + Definition = {{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}} + IsOrganizationDefault = $true + KeyCredentials = {} + Type = "TokenIssuancePolicy" + Ensure = "Present" + GlobalAdminAccount = $credsGlobalAdmin + } + + Mock -CommandName New-M365DSCConnection -MockWith { + return "Credential" + } + + Mock -CommandName Get-AzureADPolicy -MockWith { + $AADPolicy = New-Object PSCustomObject + $AADPolicy | Add-Member -MemberType NoteProperty -Name DisplayName -Value "PolicyDisplayName" + $AADPolicy | Add-Member -MemberType NoteProperty -Name ID -Value "78a80fa1-8ced-4019-94d8-2e0130644496" + $AADPolicy | Add-Member -MemberType NoteProperty -Name AlternativeIdentifier -Value "" + $AADPolicy | Add-Member -MemberType NoteProperty -Name Definition -Value '{{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}}' + $AADPolicy | Add-Member -MemberType NoteProperty -Name isOrganizationDefault -Value "false" + $AADPolicy | Add-Member -MemberType NoteProperty -Name KeyCredentials -Value "" + $AADPolicy | Add-Member -MemberType NoteProperty -Name Type -Value "TokenIssuancePolicy" + + return $AADPolicy + } + } + + It "Should return values from the get method" { + Get-TargetResource @testParams + Should -Invoke -CommandName "Get-AzureADPolicy" -Exactly 1 + } + + It 'Should return false from the test method' { + Test-TargetResource @testParams | Should -Be $false + } + + It "Should call the set method" { + Set-TargetResource @testParams + Should -Invoke -CommandName 'Set-AzureADPolicy' -Exactly 1 + } + } + + Context -Name "ReverseDSC tests" -Fixture { + BeforeAll { + $testParams = @{ + GlobalAdminAccount = $GlobalAdminAccount + } + + Mock -CommandName New-M365DSCConnection -MockWith { + return "Credential" + } + + Mock -CommandName Get-AzureADPolicy -MockWith { + $AADPolicy = New-Object PSCustomObject + $AADPolicy | Add-Member -MemberType NoteProperty -Name DisplayName -Value "PolicyDisplayName" + $AADPolicy | Add-Member -MemberType NoteProperty -Name ID -Value "78a80fa1-8ced-4019-94d8-2e0130644496" + $AADPolicy | Add-Member -MemberType NoteProperty -Name AlternativeIdentifier -Value "" + $AADPolicy | Add-Member -MemberType NoteProperty -Name Definition -Value '{{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}}' + $AADPolicy | Add-Member -MemberType NoteProperty -Name isOrganizationDefault -Value "false" + $AADPolicy | Add-Member -MemberType NoteProperty -Name KeyCredentials -Value "" + $AADPolicy | Add-Member -MemberType NoteProperty -Name Type -Value "TokenIssuancePolicy" + + return $AADPolicy + } + } + + It "Should reverse engineer resource from the export method" { + Export-TargetResource @testParams + } + } + } +} + +Invoke-Command -ScriptBlock $Global:DscHelper.CleanupScript -NoNewScope From 2f0eefa6f74fb8e28385eba0f40b33fd12ad4c55 Mon Sep 17 00:00:00 2001 From: timsto <34174209+Timsto@users.noreply.github.com> Date: Mon, 2 Nov 2020 19:45:03 +0100 Subject: [PATCH 02/10] initial MSFT_AADPolicy --- .../MSFT_AADPolicy/MSFT_AADPolicy.psm1 | 26 ++++++++-- .../MSFT_AADPolicy/MSFT_AADPolicy.schema.mof | 8 +-- .../AADPolicy/1-ConfigureAADPolicy.ps1 | 4 +- .../Microsoft365DSC.AADPolicy.Tests.ps1 | 50 ++++--------------- 4 files changed, 37 insertions(+), 51 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 index 039ff64607..18480ad5e4 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 @@ -12,6 +12,26 @@ function Get-TargetResource [System.String] $Id, + [Parameter()] + [System.String] + $AlternativeIdentifier, + + [Parameter()] + [System.Collections.Generic.List`1[System.String]] + $Definition, + + [Parameter()] + [Boolean] + $isOrganizationDefault, + + [Parameter()] + [System.Collections.Generic.List`1[System.String]] + $KeyCredentials, + + [Parameter()] + [System.String] + $Type, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] @@ -189,21 +209,21 @@ function Set-TargetResource # Policy should exist but it doesn't if($Ensure -eq 'Present' -and $currentAADPolicy.Ensure -eq "Absent") { - Write-Verbose -Message "Creating New AzureAD Policy {$Displayname}" + Write-Verbose -Message "Creating New AzureAD Policy {$($Displayname)}" $currentParameters.Remove("Id") | Out-Null New-AzureADPolicy @currentParameters } # Policy should exist and will be configured to desire state elseif ($Ensure -eq 'Present' -and $CurrentAADPolicy.Ensure -eq 'Present') { - Write-Verbose -Message "Updating exisitng AzureAD Policy {$DisplayName}" + Write-Verbose -Message "Updating exisitng AzureAD Policy {$($Displayname)}" $currentParameters.Id = $currentAADPolicy.ID Set-AzureADPolicy @currentParameters } # Policy exist but should not elseif ($Ensure -eq 'Absent' -and $CurrentAADPolicy.Ensure -eq 'Present') { - Write-Verbose -Message "Removing AzureAD Policy {$DisplayName}" + Write-Verbose -Message "Removing AzureAD Policy {$($Displayname)}" Remove-AzureADPolicy -ID $currentAADPolicy.ID } } diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.schema.mof index 09e7511320..648ca609cd 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.schema.mof @@ -2,11 +2,11 @@ class MSFT_AADPolicy : OMI_BaseResource { [Key, Description("DisplayName of the Policy")] string DisplayName; - [Write, Description("ObjectID of the Policy.")] String ObjectId; - [Write, Description("AlternativeIdentifier Policy.")] string AlternativeIdentifier - [Write, Description("Definition of the Policy.")] System.Collections.Generic.List`1[System.String] Definition; + [Write, Description("ObjectID of the Policy.")] String Id; + [Write, Description("AlternativeIdentifier Policy.")] string AlternativeIdentifier; + [Write, Description("Definition of the Policy.")] String Definition[]; [Write, Description("IsOrganizationDefault of the Policy.")] Boolean IsOrganizationDefault; - [Write, Description("KeyCredentials of the Policy.")] System.Collections.Generic.List`1[System.String] KeyCredentials; + [Write, Description("KeyCredentials of the Policy.")] String KeyCredentials[]; [Write, Description("Type of the Policy.")] string Type; [Write, Description("Specify if the Azure AD Policy should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; [Write, Description("Credentials of the Azure AD Admin"), EmbeddedInstance("MSFT_Credential")] string GlobalAdminAccount; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 index 36a82a1b1c..0bb47ea85a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 @@ -17,10 +17,8 @@ Configuration Example AADPolicy DSCPolicy1 { DisplayName = "PolicyDisplayName" - AlternativeIdentifier = "" - Definition = "{{"B2BManagementPolicy":{"InvitationsAllowedAndBlockedDomainsPolicy":{"BlockedDomains":[]},"PreviewPolicy":{"Features":["OneTimePasscode"]},"AutoRedeemPolicy":{"AdminConsentedForUsersIntoTenantIds":[],"NoAADConsentForUsersFromTenantsIds":[]}}}}" + Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') IsOrganizationDefault = $false - KeyCredentials = {} Type = "TokenIssuancePolicy" Ensure = "Present" GlobalAdminAccount = $credsGlobalAdmin diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 index b3db26b85e..4f4ce0a564 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 @@ -61,10 +61,8 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { BeforeAll { $testParams = @{ DisplayName = "PolicyDisplayName" - AlternativeIdentifier = "" - Definition = {{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}} + Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') IsOrganizationDefault = $false - KeyCredentials = {} Type = "TokenIssuancePolicy" Ensure = "Present" GlobalAdminAccount = $credsGlobalAdmin @@ -91,27 +89,19 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { BeforeAll { $testParams = @{ DisplayName = "PolicyDisplayName" - AlternativeIdentifier = "" - Definition = {{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}} + Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') IsOrganizationDefault = $false - KeyCredentials = {} Type = "TokenIssuancePolicy" Ensure = "Absent" GlobalAdminAccount = $credsGlobalAdmin } - Mock -CommandName New-M365DSCConnection -MockWith { - return "Credential" - } - Mock -CommandName Get-AzureADPolicy -MockWith { $AADPolicy = New-Object PSCustomObject $AADPolicy | Add-Member -MemberType NoteProperty -Name DisplayName -Value "PolicyDisplayName" $AADPolicy | Add-Member -MemberType NoteProperty -Name ID -Value "78a80fa1-8ced-4019-94d8-2e0130644496" - $AADPolicy | Add-Member -MemberType NoteProperty -Name AlternativeIdentifier -Value "" - $AADPolicy | Add-Member -MemberType NoteProperty -Name Definition -Value '{{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}}' + $AADPolicy | Add-Member -MemberType NoteProperty -Name Definition -Value @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') $AADPolicy | Add-Member -MemberType NoteProperty -Name isOrganizationDefault -Value "false" - $AADPolicy | Add-Member -MemberType NoteProperty -Name KeyCredentials -Value "" $AADPolicy | Add-Member -MemberType NoteProperty -Name Type -Value "TokenIssuancePolicy" return $AADPolicy @@ -136,27 +126,19 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { BeforeAll { $testParams = @{ DisplayName = "PolicyDisplayName" - AlternativeIdentifier = "" - Definition = {{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}} + Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') IsOrganizationDefault = $false - KeyCredentials = {} Type = "TokenIssuancePolicy" Ensure = "Present" GlobalAdminAccount = $credsGlobalAdmin } - Mock -CommandName New-M365DSCConnection -MockWith { - return "Credential" - } - Mock -CommandName Get-AzureADPolicy -MockWith { $AADPolicy = New-Object PSCustomObject $AADPolicy | Add-Member -MemberType NoteProperty -Name DisplayName -Value "PolicyDisplayName" $AADPolicy | Add-Member -MemberType NoteProperty -Name ID -Value "78a80fa1-8ced-4019-94d8-2e0130644496" - $AADPolicy | Add-Member -MemberType NoteProperty -Name AlternativeIdentifier -Value "" - $AADPolicy | Add-Member -MemberType NoteProperty -Name Definition -Value '{{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}}' + $AADPolicy | Add-Member -MemberType NoteProperty -Name Definition -Value @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') $AADPolicy | Add-Member -MemberType NoteProperty -Name isOrganizationDefault -Value "false" - $AADPolicy | Add-Member -MemberType NoteProperty -Name KeyCredentials -Value "" $AADPolicy | Add-Member -MemberType NoteProperty -Name Type -Value "TokenIssuancePolicy" return $AADPolicy @@ -177,27 +159,19 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { BeforeAll { $testParams = @{ DisplayName = "PolicyDisplayName" - AlternativeIdentifier = "" - Definition = {{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}} + Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') IsOrganizationDefault = $true - KeyCredentials = {} Type = "TokenIssuancePolicy" Ensure = "Present" GlobalAdminAccount = $credsGlobalAdmin } - Mock -CommandName New-M365DSCConnection -MockWith { - return "Credential" - } - Mock -CommandName Get-AzureADPolicy -MockWith { $AADPolicy = New-Object PSCustomObject $AADPolicy | Add-Member -MemberType NoteProperty -Name DisplayName -Value "PolicyDisplayName" $AADPolicy | Add-Member -MemberType NoteProperty -Name ID -Value "78a80fa1-8ced-4019-94d8-2e0130644496" - $AADPolicy | Add-Member -MemberType NoteProperty -Name AlternativeIdentifier -Value "" - $AADPolicy | Add-Member -MemberType NoteProperty -Name Definition -Value '{{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}}' + $AADPolicy | Add-Member -MemberType NoteProperty -Name Definition -Value @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') $AADPolicy | Add-Member -MemberType NoteProperty -Name isOrganizationDefault -Value "false" - $AADPolicy | Add-Member -MemberType NoteProperty -Name KeyCredentials -Value "" $AADPolicy | Add-Member -MemberType NoteProperty -Name Type -Value "TokenIssuancePolicy" return $AADPolicy @@ -206,7 +180,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It "Should return values from the get method" { Get-TargetResource @testParams - Should -Invoke -CommandName "Get-AzureADPolicy" -Exactly 1 + Should -Invoke -CommandName "Get-AzureADPolicy" } It 'Should return false from the test method' { @@ -215,7 +189,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It "Should call the set method" { Set-TargetResource @testParams - Should -Invoke -CommandName 'Set-AzureADPolicy' -Exactly 1 + Should -Invoke -CommandName 'Set-AzureADPolicy' } } @@ -225,18 +199,12 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { GlobalAdminAccount = $GlobalAdminAccount } - Mock -CommandName New-M365DSCConnection -MockWith { - return "Credential" - } - Mock -CommandName Get-AzureADPolicy -MockWith { $AADPolicy = New-Object PSCustomObject $AADPolicy | Add-Member -MemberType NoteProperty -Name DisplayName -Value "PolicyDisplayName" $AADPolicy | Add-Member -MemberType NoteProperty -Name ID -Value "78a80fa1-8ced-4019-94d8-2e0130644496" - $AADPolicy | Add-Member -MemberType NoteProperty -Name AlternativeIdentifier -Value "" $AADPolicy | Add-Member -MemberType NoteProperty -Name Definition -Value '{{"TokenIssuancePolicy": {"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}}' $AADPolicy | Add-Member -MemberType NoteProperty -Name isOrganizationDefault -Value "false" - $AADPolicy | Add-Member -MemberType NoteProperty -Name KeyCredentials -Value "" $AADPolicy | Add-Member -MemberType NoteProperty -Name Type -Value "TokenIssuancePolicy" return $AADPolicy From 3324f0a3d4df4b59e15b281a20c8720a247f2618 Mon Sep 17 00:00:00 2001 From: timsto <34174209+Timsto@users.noreply.github.com> Date: Mon, 2 Nov 2020 19:47:36 +0100 Subject: [PATCH 03/10] minor change --- .../DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 index 18480ad5e4..6061d9c90e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 @@ -209,21 +209,21 @@ function Set-TargetResource # Policy should exist but it doesn't if($Ensure -eq 'Present' -and $currentAADPolicy.Ensure -eq "Absent") { - Write-Verbose -Message "Creating New AzureAD Policy {$($Displayname)}" + Write-Verbose -Message "Creating New AzureAD Policy {$Displayname)}" $currentParameters.Remove("Id") | Out-Null New-AzureADPolicy @currentParameters } # Policy should exist and will be configured to desire state elseif ($Ensure -eq 'Present' -and $CurrentAADPolicy.Ensure -eq 'Present') { - Write-Verbose -Message "Updating exisitng AzureAD Policy {$($Displayname)}" + Write-Verbose -Message "Updating exisitng AzureAD Policy {$Displayname)}" $currentParameters.Id = $currentAADPolicy.ID Set-AzureADPolicy @currentParameters } # Policy exist but should not elseif ($Ensure -eq 'Absent' -and $CurrentAADPolicy.Ensure -eq 'Present') { - Write-Verbose -Message "Removing AzureAD Policy {$($Displayname)}" + Write-Verbose -Message "Removing AzureAD Policy {$Displayname)}" Remove-AzureADPolicy -ID $currentAADPolicy.ID } } From 4b36a1a14fd253b8e96c6ffd3b9e4b8edf70b59b Mon Sep 17 00:00:00 2001 From: timsto <34174209+Timsto@users.noreply.github.com> Date: Wed, 4 Nov 2020 10:27:59 +0100 Subject: [PATCH 04/10] MSFT_AADPolicy : #491 minor fixes --- .../Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 index 4f4ce0a564..a5ca8a56f0 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 @@ -119,9 +119,10 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It 'Should remove the app from the set method' { Set-TargetResource @testParams - Should -Invoke -CommandName "Remove-AzureADAzureADPolicy" -Exactly 1 + Should -Invoke -CommandName "Remove-AzureADPolicy" -Exactly 1 } } + Context -Name "The Policy exists and values are already in the desired state" -Fixture { BeforeAll { $testParams = @{ @@ -158,7 +159,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name "Values are not in the desired state" -Fixture { BeforeAll { $testParams = @{ - DisplayName = "PolicyDisplayName" + DisplayName = "PolicyDisplayName1" Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') IsOrganizationDefault = $true Type = "TokenIssuancePolicy" @@ -180,7 +181,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It "Should return values from the get method" { Get-TargetResource @testParams - Should -Invoke -CommandName "Get-AzureADPolicy" + Should -Invoke -CommandName "Get-AzureADPolicy" -Exactly 1 } It 'Should return false from the test method' { @@ -189,7 +190,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It "Should call the set method" { Set-TargetResource @testParams - Should -Invoke -CommandName 'Set-AzureADPolicy' + Should -Invoke -CommandName "Set-AzureADPolicy" -Exactly 1 } } From 13e44980c1e0aad3d8c7dff3b1e9b1ea5d5250ae Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 10 Nov 2020 09:43:26 -0500 Subject: [PATCH 05/10] Fixes Telemetry --- .../MSFT_AADApplication/MSFT_AADApplication.psm1 | 4 ++-- .../MSFT_AADGroupsNamingPolicy.psm1 | 4 ++-- .../MSFT_AADGroupsSettings/MSFT_AADGroupsSettings.psm1 | 4 ++-- .../DSCResources/MSFT_AADMSGroup/MSFT_AADMSGroup.psm1 | 4 ++-- .../MSFT_AADMSGroupLifecyclePolicy.psm1 | 6 +++--- .../MSFT_AADServicePrincipal.psm1 | 4 ++-- .../MSFT_AADTenantDetails/MSFT_AADTenantDetails.psm1 | 4 ++-- .../MSFT_EXOAcceptedDomain/MSFT_EXOAcceptedDomain.psm1 | 4 ++-- .../MSFT_EXOActiveSyncDeviceAccessRule.psm1 | 4 ++-- .../MSFT_EXOAddressBookPolicy.psm1 | 4 ++-- .../MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 | 4 ++-- .../MSFT_EXOAntiPhishPolicy/MSFT_EXOAntiPhishPolicy.psm1 | 4 ++-- .../MSFT_EXOAntiPhishRule/MSFT_EXOAntiPhishRule.psm1 | 4 ++-- .../MSFT_EXOApplicationAccessPolicy.psm1 | 4 ++-- .../MSFT_EXOAtpPolicyForO365.psm1 | 4 ++-- .../MSFT_EXOAvailabilityAddressSpace.psm1 | 4 ++-- .../MSFT_EXOAvailabilityConfig.psm1 | 4 ++-- .../MSFT_EXOCASMailboxPlan/MSFT_EXOCASMailboxPlan.psm1 | 4 ++-- .../MSFT_EXOClientAccessRule.psm1 | 4 ++-- .../MSFT_EXOEmailAddressPolicy.psm1 | 4 ++-- .../MSFT_EXOGlobalAddressList.psm1 | 4 ++-- .../MSFT_EXOHostedConnectionFilterPolicy.psm1 | 4 ++-- .../MSFT_EXOHostedContentFilterPolicy.psm1 | 4 ++-- .../MSFT_EXOHostedContentFilterRule.psm1 | 4 ++-- .../MSFT_EXOHostedOutboundSpamFilterPolicy.psm1 | 4 ++-- .../MSFT_EXOInboundConnector.psm1 | 4 ++-- .../MSFT_EXOIntraOrganizationConnector.psm1 | 4 ++-- .../DSCResources/MSFT_EXOMailTips/MSFT_EXOMailTips.psm1 | 4 ++-- .../MSFT_EXOMalwareFilterPolicy.psm1 | 4 ++-- .../MSFT_EXOMalwareFilterRule.psm1 | 4 ++-- .../MSFT_EXOManagementRole/MSFT_EXOManagementRole.psm1 | 4 ++-- .../MSFT_EXOMobileDeviceMailboxPolicy.psm1 | 4 ++-- .../MSFT_EXOOfflineAddressBook.psm1 | 4 ++-- .../MSFT_EXOOnPremisesOrganization.psm1 | 4 ++-- .../MSFT_EXOOrganizationConfig.psm1 | 4 ++-- .../MSFT_EXOOrganizationRelationship.psm1 | 4 ++-- .../MSFT_EXOOutboundConnector.psm1 | 4 ++-- .../MSFT_EXOOwaMailboxPolicy.psm1 | 4 ++-- .../MSFT_EXOPartnerApplication.psm1 | 4 ++-- .../MSFT_EXOPolicyTipConfig/MSFT_EXOPolicyTipConfig.psm1 | 4 ++-- .../MSFT_EXORemoteDomain/MSFT_EXORemoteDomain.psm1 | 4 ++-- .../MSFT_EXORoleAssignmentPolicy.psm1 | 4 ++-- .../MSFT_EXOSafeAttachmentPolicy.psm1 | 4 ++-- .../MSFT_EXOSafeAttachmentRule.psm1 | 4 ++-- .../MSFT_EXOSafeLinksPolicy/MSFT_EXOSafeLinksPolicy.psm1 | 4 ++-- .../MSFT_EXOSafeLinksRule/MSFT_EXOSafeLinksRule.psm1 | 4 ++-- .../MSFT_EXOSharedMailbox/MSFT_EXOSharedMailbox.psm1 | 4 ++-- .../MSFT_EXOSharingPolicy/MSFT_EXOSharingPolicy.psm1 | 4 ++-- .../MSFT_IntuneAppConfigurationPolicy.psm1 | 4 ++-- .../MSFT_IntuneDeviceCategory.psm1 | 4 ++-- .../MSFT_O365AdminAuditLogConfig.psm1 | 4 ++-- .../DSCResources/MSFT_O365Group/MSFT_O365Group.psm1 | 4 ++-- .../MSFT_O365OrgCustomizationSetting.psm1 | 4 ++-- .../DSCResources/MSFT_O365User/MSFT_O365User.psm1 | 4 ++-- .../DSCResources/MSFT_ODSettings/MSFT_ODSettings.psm1 | 4 ++-- .../MSFT_PPPowerAppsEnvironment.psm1 | 4 ++-- .../MSFT_PlannerBucket/MSFT_PlannerBucket.psm1 | 6 +++--- .../DSCResources/MSFT_PlannerPlan/MSFT_PlannerPlan.psm1 | 8 ++++---- .../DSCResources/MSFT_PlannerTask/MSFT_PlannerTask.psm1 | 6 +++--- .../MSFT_SCAuditConfigurationPolicy.psm1 | 4 ++-- .../MSFT_SCCaseHoldPolicy/MSFT_SCCaseHoldPolicy.psm1 | 4 ++-- .../MSFT_SCCaseHoldRule/MSFT_SCCaseHoldRule.psm1 | 4 ++-- .../MSFT_SCComplianceCase/MSFT_SCComplianceCase.psm1 | 4 ++-- .../MSFT_SCComplianceSearch/MSFT_SCComplianceSearch.psm1 | 4 ++-- .../MSFT_SCComplianceSearchAction.psm1 | 4 ++-- .../MSFT_SCComplianceTag/MSFT_SCComplianceTag.psm1 | 4 ++-- .../MSFT_SCDLPCompliancePolicy.psm1 | 4 ++-- .../MSFT_SCDLPComplianceRule.psm1 | 4 ++-- .../MSFT_SCDeviceConditionalAccessPolicy.psm1 | 4 ++-- .../MSFT_SCDeviceConfigurationPolicy.psm1 | 4 ++-- .../MSFT_SCFilePlanPropertyAuthority.psm1 | 4 ++-- .../MSFT_SCFilePlanPropertyCategory.psm1 | 4 ++-- .../MSFT_SCFilePlanPropertyCitation.psm1 | 4 ++-- .../MSFT_SCFilePlanPropertyDepartment.psm1 | 4 ++-- .../MSFT_SCFilePlanPropertyReferenceId.psm1 | 4 ++-- .../MSFT_SCFilePlanPropertySubCategory.psm1 | 4 ++-- .../MSFT_SCLabelPolicy/MSFT_SCLabelPolicy.psm1 | 4 ++-- .../MSFT_SCRetentionCompliancePolicy.psm1 | 4 ++-- .../MSFT_SCRetentionComplianceRule.psm1 | 4 ++-- .../MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1 | 4 ++-- .../MSFT_SCSupervisoryReviewPolicy.psm1 | 4 ++-- .../MSFT_SCSupervisoryReviewRule.psm1 | 4 ++-- .../MSFT_SPOAccessControlSettings.psm1 | 4 ++-- .../DSCResources/MSFT_SPOApp/MSFT_SPOApp.psm1 | 4 ++-- .../DSCResources/MSFT_SPOHomeSite/MSFT_SPOHomeSite.psm1 | 4 ++-- .../DSCResources/MSFT_SPOHubSite/MSFT_SPOHubSite.psm1 | 4 ++-- .../MSFT_SPOOrgAssetsLibrary.psm1 | 6 +++--- .../MSFT_SPOPropertyBag/MSFT_SPOPropertyBag.psm1 | 4 ++-- .../MSFT_SPOSearchManagedProperty.psm1 | 4 ++-- .../MSFT_SPOSearchResultSource.psm1 | 4 ++-- .../MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 | 4 ++-- .../DSCResources/MSFT_SPOSite/MSFT_SPOSite.psm1 | 4 ++-- .../MSFT_SPOSiteAuditSettings.psm1 | 4 ++-- .../MSFT_SPOSiteDesign/MSFT_SPOSiteDesign.psm1 | 4 ++-- .../MSFT_SPOSiteDesignRights.psm1 | 4 ++-- .../DSCResources/MSFT_SPOSiteGroup/MSFT_SPOSiteGroup.psm1 | 4 ++-- .../MSFT_SPOSiteScript/MSFT_SPOSiteScript.psm1 | 4 ++-- .../MSFT_SPOStorageEntity/MSFT_SPOStorageEntity.psm1 | 4 ++-- .../MSFT_SPOTenantCdnEnabled.psm1 | 6 +++--- .../MSFT_SPOTenantCdnPolicy/MSFT_SPOTenantCdnPolicy.psm1 | 4 ++-- .../MSFT_SPOTenantSettings/MSFT_SPOTenantSettings.psm1 | 4 ++-- .../DSCResources/MSFT_SPOTheme/MSFT_SPOTheme.psm1 | 4 ++-- .../MSFT_SPOUserProfileProperty.psm1 | 4 ++-- .../MSFT_TeamsCallingPolicy/MSFT_TeamsCallingPolicy.psm1 | 4 ++-- .../DSCResources/MSFT_TeamsChannel/MSFT_TeamsChannel.psm1 | 4 ++-- .../MSFT_TeamsChannelsPolicy.psm1 | 4 ++-- .../MSFT_TeamsClientConfiguration.psm1 | 4 ++-- .../MSFT_TeamsEmergencyCallRoutingPolicy.psm1 | 4 ++-- .../MSFT_TeamsEmergencyCallingPolicy.psm1 | 4 ++-- .../MSFT_TeamsGuestCallingConfiguration.psm1 | 4 ++-- .../MSFT_TeamsGuestMeetingConfiguration.psm1 | 4 ++-- .../MSFT_TeamsGuestMessagingConfiguration.psm1 | 4 ++-- .../MSFT_TeamsMeetingBroadcastConfiguration.psm1 | 4 ++-- .../MSFT_TeamsMeetingBroadcastPolicy.psm1 | 4 ++-- .../MSFT_TeamsMeetingConfiguration.psm1 | 4 ++-- .../MSFT_TeamsMeetingPolicy/MSFT_TeamsMeetingPolicy.psm1 | 4 ++-- .../MSFT_TeamsMessagingPolicy.psm1 | 4 ++-- .../MSFT_TeamsPstnUsage/MSFT_TeamsPstnUsage.psm1 | 4 ++-- .../DSCResources/MSFT_TeamsTeam/MSFT_TeamsTeam.psm1 | 4 ++-- .../MSFT_TeamsTenantDialPlan.psm1 | 4 ++-- .../MSFT_TeamsUpgradeConfiguration.psm1 | 4 ++-- .../MSFT_TeamsUpgradePolicy/MSFT_TeamsUpgradePolicy.psm1 | 4 ++-- .../DSCResources/MSFT_TeamsUser/MSFT_TeamsUser.psm1 | 4 ++-- .../MSFT_TeamsVoiceRoute/MSFT_TeamsVoiceRoute.psm1 | 4 ++-- .../MSFT_TeamsVoiceRoutingPolicy.psm1 | 4 ++-- 125 files changed, 257 insertions(+), 257 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 index fad2023a3c..204e517cc4 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.psm1 @@ -163,7 +163,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -515,7 +515,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupsNamingPolicy/MSFT_AADGroupsNamingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupsNamingPolicy/MSFT_AADGroupsNamingPolicy.psm1 index 5d177c68a7..1ade9bade9 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupsNamingPolicy/MSFT_AADGroupsNamingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupsNamingPolicy/MSFT_AADGroupsNamingPolicy.psm1 @@ -92,7 +92,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -328,7 +328,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupsSettings/MSFT_AADGroupsSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupsSettings/MSFT_AADGroupsSettings.psm1 index d45380ed23..87aef9da2b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupsSettings/MSFT_AADGroupsSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroupsSettings/MSFT_AADGroupsSettings.psm1 @@ -122,7 +122,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -400,7 +400,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADMSGroup/MSFT_AADMSGroup.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADMSGroup/MSFT_AADMSGroup.psm1 index 1e0686b38c..a710a333aa 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADMSGroup/MSFT_AADMSGroup.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADMSGroup/MSFT_AADMSGroup.psm1 @@ -157,7 +157,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -495,7 +495,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADMSGroupLifecyclePolicy/MSFT_AADMSGroupLifecyclePolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADMSGroupLifecyclePolicy/MSFT_AADMSGroupLifecyclePolicy.psm1 index 6411524de3..e67776aec3 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADMSGroupLifecyclePolicy/MSFT_AADMSGroupLifecyclePolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADMSGroupLifecyclePolicy/MSFT_AADMSGroupLifecyclePolicy.psm1 @@ -77,7 +77,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -124,7 +124,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -433,7 +433,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADServicePrincipal/MSFT_AADServicePrincipal.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADServicePrincipal/MSFT_AADServicePrincipal.psm1 index 624987d822..da14e25afa 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADServicePrincipal/MSFT_AADServicePrincipal.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADServicePrincipal/MSFT_AADServicePrincipal.psm1 @@ -164,7 +164,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -504,7 +504,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADTenantDetails/MSFT_AADTenantDetails.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADTenantDetails/MSFT_AADTenantDetails.psm1 index 56a7cb3f6e..013dbf8472 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADTenantDetails/MSFT_AADTenantDetails.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADTenantDetails/MSFT_AADTenantDetails.psm1 @@ -98,7 +98,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -322,7 +322,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAcceptedDomain/MSFT_EXOAcceptedDomain.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAcceptedDomain/MSFT_EXOAcceptedDomain.psm1 index 1ee8fb97e1..9ac1cfd7b3 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAcceptedDomain/MSFT_EXOAcceptedDomain.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAcceptedDomain/MSFT_EXOAcceptedDomain.psm1 @@ -153,7 +153,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -428,7 +428,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOActiveSyncDeviceAccessRule/MSFT_EXOActiveSyncDeviceAccessRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOActiveSyncDeviceAccessRule/MSFT_EXOActiveSyncDeviceAccessRule.psm1 index 857b3bc83c..3f4edce982 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOActiveSyncDeviceAccessRule/MSFT_EXOActiveSyncDeviceAccessRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOActiveSyncDeviceAccessRule/MSFT_EXOActiveSyncDeviceAccessRule.psm1 @@ -119,7 +119,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -417,7 +417,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressBookPolicy/MSFT_EXOAddressBookPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressBookPolicy/MSFT_EXOAddressBookPolicy.psm1 index 2ecf83b622..960ef48285 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressBookPolicy/MSFT_EXOAddressBookPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressBookPolicy/MSFT_EXOAddressBookPolicy.psm1 @@ -118,7 +118,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -426,7 +426,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 index 21e551b1a1..d776d9748b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 @@ -209,7 +209,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -708,7 +708,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAntiPhishPolicy/MSFT_EXOAntiPhishPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAntiPhishPolicy/MSFT_EXOAntiPhishPolicy.psm1 index 3772c08164..d748eae862 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAntiPhishPolicy/MSFT_EXOAntiPhishPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAntiPhishPolicy/MSFT_EXOAntiPhishPolicy.psm1 @@ -218,7 +218,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -651,7 +651,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAntiPhishRule/MSFT_EXOAntiPhishRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAntiPhishRule/MSFT_EXOAntiPhishRule.psm1 index 26fd2113d8..a266aa9c15 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAntiPhishRule/MSFT_EXOAntiPhishRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAntiPhishRule/MSFT_EXOAntiPhishRule.psm1 @@ -171,7 +171,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -543,7 +543,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 index d5b9c21dcf..51790cfda9 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 @@ -132,7 +132,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -457,7 +457,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAtpPolicyForO365/MSFT_EXOAtpPolicyForO365.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAtpPolicyForO365/MSFT_EXOAtpPolicyForO365.psm1 index c390204fca..ed0233836c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAtpPolicyForO365/MSFT_EXOAtpPolicyForO365.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAtpPolicyForO365/MSFT_EXOAtpPolicyForO365.psm1 @@ -128,7 +128,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -434,7 +434,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAvailabilityAddressSpace/MSFT_EXOAvailabilityAddressSpace.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAvailabilityAddressSpace/MSFT_EXOAvailabilityAddressSpace.psm1 index 9b92539859..9b087ec14e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAvailabilityAddressSpace/MSFT_EXOAvailabilityAddressSpace.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAvailabilityAddressSpace/MSFT_EXOAvailabilityAddressSpace.psm1 @@ -138,7 +138,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -480,7 +480,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAvailabilityConfig/MSFT_EXOAvailabilityConfig.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAvailabilityConfig/MSFT_EXOAvailabilityConfig.psm1 index d2fdf58961..9c41b3487e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAvailabilityConfig/MSFT_EXOAvailabilityConfig.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAvailabilityConfig/MSFT_EXOAvailabilityConfig.psm1 @@ -105,7 +105,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -361,7 +361,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOCASMailboxPlan/MSFT_EXOCASMailboxPlan.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOCASMailboxPlan/MSFT_EXOCASMailboxPlan.psm1 index 9f812857b2..3e367ae2ef 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOCASMailboxPlan/MSFT_EXOCASMailboxPlan.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOCASMailboxPlan/MSFT_EXOCASMailboxPlan.psm1 @@ -125,7 +125,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -406,7 +406,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOClientAccessRule/MSFT_EXOClientAccessRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOClientAccessRule/MSFT_EXOClientAccessRule.psm1 index acceddead0..eda9caf5d3 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOClientAccessRule/MSFT_EXOClientAccessRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOClientAccessRule/MSFT_EXOClientAccessRule.psm1 @@ -164,7 +164,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -560,7 +560,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOEmailAddressPolicy/MSFT_EXOEmailAddressPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOEmailAddressPolicy/MSFT_EXOEmailAddressPolicy.psm1 index 6f82ce9dd1..5f790c5602 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOEmailAddressPolicy/MSFT_EXOEmailAddressPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOEmailAddressPolicy/MSFT_EXOEmailAddressPolicy.psm1 @@ -127,7 +127,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -457,7 +457,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOGlobalAddressList/MSFT_EXOGlobalAddressList.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOGlobalAddressList/MSFT_EXOGlobalAddressList.psm1 index 74305011be..d94f14c3cd 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOGlobalAddressList/MSFT_EXOGlobalAddressList.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOGlobalAddressList/MSFT_EXOGlobalAddressList.psm1 @@ -228,7 +228,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -726,7 +726,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedConnectionFilterPolicy/MSFT_EXOHostedConnectionFilterPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedConnectionFilterPolicy/MSFT_EXOHostedConnectionFilterPolicy.psm1 index a764db996d..b94755517d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedConnectionFilterPolicy/MSFT_EXOHostedConnectionFilterPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedConnectionFilterPolicy/MSFT_EXOHostedConnectionFilterPolicy.psm1 @@ -140,7 +140,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -461,7 +461,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedContentFilterPolicy/MSFT_EXOHostedContentFilterPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedContentFilterPolicy/MSFT_EXOHostedContentFilterPolicy.psm1 index 86e7337065..074091ad69 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedContentFilterPolicy/MSFT_EXOHostedContentFilterPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedContentFilterPolicy/MSFT_EXOHostedContentFilterPolicy.psm1 @@ -364,7 +364,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -1060,7 +1060,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedContentFilterRule/MSFT_EXOHostedContentFilterRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedContentFilterRule/MSFT_EXOHostedContentFilterRule.psm1 index 261f8ab6b4..dfe71edc7d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedContentFilterRule/MSFT_EXOHostedContentFilterRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedContentFilterRule/MSFT_EXOHostedContentFilterRule.psm1 @@ -166,7 +166,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -520,7 +520,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/MSFT_EXOHostedOutboundSpamFilterPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/MSFT_EXOHostedOutboundSpamFilterPolicy.psm1 index 73e1711252..faa620bfe8 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/MSFT_EXOHostedOutboundSpamFilterPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/MSFT_EXOHostedOutboundSpamFilterPolicy.psm1 @@ -122,7 +122,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -402,7 +402,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOInboundConnector/MSFT_EXOInboundConnector.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOInboundConnector/MSFT_EXOInboundConnector.psm1 index 6f46c7e1dc..d3001e141c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOInboundConnector/MSFT_EXOInboundConnector.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOInboundConnector/MSFT_EXOInboundConnector.psm1 @@ -170,7 +170,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -534,7 +534,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOIntraOrganizationConnector/MSFT_EXOIntraOrganizationConnector.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOIntraOrganizationConnector/MSFT_EXOIntraOrganizationConnector.psm1 index e1fbbbe7d9..e65f79ba48 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOIntraOrganizationConnector/MSFT_EXOIntraOrganizationConnector.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOIntraOrganizationConnector/MSFT_EXOIntraOrganizationConnector.psm1 @@ -112,7 +112,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -393,7 +393,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMailTips/MSFT_EXOMailTips.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMailTips/MSFT_EXOMailTips.psm1 index ca9424c095..84a64e35c3 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMailTips/MSFT_EXOMailTips.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMailTips/MSFT_EXOMailTips.psm1 @@ -128,7 +128,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -431,7 +431,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMalwareFilterPolicy/MSFT_EXOMalwareFilterPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMalwareFilterPolicy/MSFT_EXOMalwareFilterPolicy.psm1 index bc95494805..12731c403d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMalwareFilterPolicy/MSFT_EXOMalwareFilterPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMalwareFilterPolicy/MSFT_EXOMalwareFilterPolicy.psm1 @@ -208,7 +208,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -626,7 +626,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMalwareFilterRule/MSFT_EXOMalwareFilterRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMalwareFilterRule/MSFT_EXOMalwareFilterRule.psm1 index 79a8a88844..a82168480c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMalwareFilterRule/MSFT_EXOMalwareFilterRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMalwareFilterRule/MSFT_EXOMalwareFilterRule.psm1 @@ -148,7 +148,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -486,7 +486,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOManagementRole/MSFT_EXOManagementRole.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOManagementRole/MSFT_EXOManagementRole.psm1 index dbaaab4f9e..19d869270e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOManagementRole/MSFT_EXOManagementRole.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOManagementRole/MSFT_EXOManagementRole.psm1 @@ -116,7 +116,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -401,7 +401,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMobileDeviceMailboxPolicy/MSFT_EXOMobileDeviceMailboxPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMobileDeviceMailboxPolicy/MSFT_EXOMobileDeviceMailboxPolicy.psm1 index ce412b0ffe..feb8110f61 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMobileDeviceMailboxPolicy/MSFT_EXOMobileDeviceMailboxPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMobileDeviceMailboxPolicy/MSFT_EXOMobileDeviceMailboxPolicy.psm1 @@ -375,7 +375,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -1147,7 +1147,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOfflineAddressBook/MSFT_EXOOfflineAddressBook.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOfflineAddressBook/MSFT_EXOOfflineAddressBook.psm1 index 82509babcb..1cac7d18d8 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOfflineAddressBook/MSFT_EXOOfflineAddressBook.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOfflineAddressBook/MSFT_EXOOfflineAddressBook.psm1 @@ -124,7 +124,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -441,7 +441,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOnPremisesOrganization/MSFT_EXOOnPremisesOrganization.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOnPremisesOrganization/MSFT_EXOOnPremisesOrganization.psm1 index bc13f0ef0e..bf62cbc12b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOnPremisesOrganization/MSFT_EXOOnPremisesOrganization.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOnPremisesOrganization/MSFT_EXOOnPremisesOrganization.psm1 @@ -143,7 +143,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -480,7 +480,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOrganizationConfig/MSFT_EXOOrganizationConfig.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOrganizationConfig/MSFT_EXOOrganizationConfig.psm1 index 417f4b5e03..72155f5b65 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOrganizationConfig/MSFT_EXOOrganizationConfig.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOrganizationConfig/MSFT_EXOOrganizationConfig.psm1 @@ -428,7 +428,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -1164,7 +1164,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOrganizationRelationship/MSFT_EXOOrganizationRelationship.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOrganizationRelationship/MSFT_EXOOrganizationRelationship.psm1 index 3a5cdaf1e4..38b3fb46d4 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOrganizationRelationship/MSFT_EXOOrganizationRelationship.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOrganizationRelationship/MSFT_EXOOrganizationRelationship.psm1 @@ -237,7 +237,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -684,7 +684,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOutboundConnector/MSFT_EXOOutboundConnector.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOutboundConnector/MSFT_EXOOutboundConnector.psm1 index 73a6725fa2..511b83ffe0 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOutboundConnector/MSFT_EXOOutboundConnector.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOutboundConnector/MSFT_EXOOutboundConnector.psm1 @@ -182,7 +182,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -567,7 +567,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOwaMailboxPolicy/MSFT_EXOOwaMailboxPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOwaMailboxPolicy/MSFT_EXOOwaMailboxPolicy.psm1 index edb314e372..07f055db7d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOwaMailboxPolicy/MSFT_EXOOwaMailboxPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOOwaMailboxPolicy/MSFT_EXOOwaMailboxPolicy.psm1 @@ -478,7 +478,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -1439,7 +1439,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOPartnerApplication/MSFT_EXOPartnerApplication.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOPartnerApplication/MSFT_EXOPartnerApplication.psm1 index 2e56eec0f7..1f19726e71 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOPartnerApplication/MSFT_EXOPartnerApplication.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOPartnerApplication/MSFT_EXOPartnerApplication.psm1 @@ -124,7 +124,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -444,7 +444,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOPolicyTipConfig/MSFT_EXOPolicyTipConfig.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOPolicyTipConfig/MSFT_EXOPolicyTipConfig.psm1 index f8a20651b0..8fcc6b377d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOPolicyTipConfig/MSFT_EXOPolicyTipConfig.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOPolicyTipConfig/MSFT_EXOPolicyTipConfig.psm1 @@ -111,7 +111,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -391,7 +391,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXORemoteDomain/MSFT_EXORemoteDomain.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXORemoteDomain/MSFT_EXORemoteDomain.psm1 index dc31b2eb8d..4cf082d24d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXORemoteDomain/MSFT_EXORemoteDomain.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXORemoteDomain/MSFT_EXORemoteDomain.psm1 @@ -207,7 +207,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -669,7 +669,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXORoleAssignmentPolicy/MSFT_EXORoleAssignmentPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXORoleAssignmentPolicy/MSFT_EXORoleAssignmentPolicy.psm1 index c4a6ab7007..33afbdf857 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXORoleAssignmentPolicy/MSFT_EXORoleAssignmentPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXORoleAssignmentPolicy/MSFT_EXORoleAssignmentPolicy.psm1 @@ -115,7 +115,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -425,7 +425,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeAttachmentPolicy/MSFT_EXOSafeAttachmentPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeAttachmentPolicy/MSFT_EXOSafeAttachmentPolicy.psm1 index 62d533cc3b..abd6bfb540 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeAttachmentPolicy/MSFT_EXOSafeAttachmentPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeAttachmentPolicy/MSFT_EXOSafeAttachmentPolicy.psm1 @@ -129,7 +129,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -444,7 +444,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeAttachmentRule/MSFT_EXOSafeAttachmentRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeAttachmentRule/MSFT_EXOSafeAttachmentRule.psm1 index 2dede5594d..9847d99201 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeAttachmentRule/MSFT_EXOSafeAttachmentRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeAttachmentRule/MSFT_EXOSafeAttachmentRule.psm1 @@ -169,7 +169,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -516,7 +516,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeLinksPolicy/MSFT_EXOSafeLinksPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeLinksPolicy/MSFT_EXOSafeLinksPolicy.psm1 index 0a1d38b76f..42a658ff9f 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeLinksPolicy/MSFT_EXOSafeLinksPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeLinksPolicy/MSFT_EXOSafeLinksPolicy.psm1 @@ -145,7 +145,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -466,7 +466,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeLinksRule/MSFT_EXOSafeLinksRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeLinksRule/MSFT_EXOSafeLinksRule.psm1 index 4c76ebcf2e..a17c2e0eb1 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeLinksRule/MSFT_EXOSafeLinksRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSafeLinksRule/MSFT_EXOSafeLinksRule.psm1 @@ -157,7 +157,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -509,7 +509,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSharedMailbox/MSFT_EXOSharedMailbox.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSharedMailbox/MSFT_EXOSharedMailbox.psm1 index ed49ea9f5f..0bb2fd39ad 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSharedMailbox/MSFT_EXOSharedMailbox.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSharedMailbox/MSFT_EXOSharedMailbox.psm1 @@ -126,7 +126,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -457,7 +457,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSharingPolicy/MSFT_EXOSharingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSharingPolicy/MSFT_EXOSharingPolicy.psm1 index 8406ed4c2c..6e8ebc757b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSharingPolicy/MSFT_EXOSharingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOSharingPolicy/MSFT_EXOSharingPolicy.psm1 @@ -114,7 +114,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -415,7 +415,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneAppConfigurationPolicy/MSFT_IntuneAppConfigurationPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneAppConfigurationPolicy/MSFT_IntuneAppConfigurationPolicy.psm1 index 0db6ed2ad3..fc121653c7 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneAppConfigurationPolicy/MSFT_IntuneAppConfigurationPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneAppConfigurationPolicy/MSFT_IntuneAppConfigurationPolicy.psm1 @@ -68,7 +68,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -254,7 +254,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceCategory/MSFT_IntuneDeviceCategory.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceCategory/MSFT_IntuneDeviceCategory.psm1 index bb5beabb31..842fb0dd1d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceCategory/MSFT_IntuneDeviceCategory.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceCategory/MSFT_IntuneDeviceCategory.psm1 @@ -68,7 +68,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -257,7 +257,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_O365AdminAuditLogConfig/MSFT_O365AdminAuditLogConfig.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_O365AdminAuditLogConfig/MSFT_O365AdminAuditLogConfig.psm1 index 90f20d2fe5..3aca0f95e4 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_O365AdminAuditLogConfig/MSFT_O365AdminAuditLogConfig.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_O365AdminAuditLogConfig/MSFT_O365AdminAuditLogConfig.psm1 @@ -102,7 +102,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -362,7 +362,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_O365Group/MSFT_O365Group.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_O365Group/MSFT_O365Group.psm1 index 3a7e066ed5..e6b3e6cde3 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_O365Group/MSFT_O365Group.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_O365Group/MSFT_O365Group.psm1 @@ -159,7 +159,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -548,7 +548,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgCustomizationSetting/MSFT_O365OrgCustomizationSetting.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgCustomizationSetting/MSFT_O365OrgCustomizationSetting.psm1 index f555ce5826..a89458918f 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgCustomizationSetting/MSFT_O365OrgCustomizationSetting.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgCustomizationSetting/MSFT_O365OrgCustomizationSetting.psm1 @@ -90,7 +90,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -307,7 +307,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_O365User/MSFT_O365User.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_O365User/MSFT_O365User.psm1 index 1fd11db116..fa8976f930 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_O365User/MSFT_O365User.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_O365User/MSFT_O365User.psm1 @@ -211,7 +211,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -761,7 +761,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_ODSettings/MSFT_ODSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_ODSettings/MSFT_ODSettings.psm1 index 5b7a6b6c57..000e027be6 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_ODSettings/MSFT_ODSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_ODSettings/MSFT_ODSettings.psm1 @@ -199,7 +199,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -610,7 +610,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_PPPowerAppsEnvironment/MSFT_PPPowerAppsEnvironment.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_PPPowerAppsEnvironment/MSFT_PPPowerAppsEnvironment.psm1 index b21bdf2bc7..0ce76a930c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_PPPowerAppsEnvironment/MSFT_PPPowerAppsEnvironment.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_PPPowerAppsEnvironment/MSFT_PPPowerAppsEnvironment.psm1 @@ -87,7 +87,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -332,7 +332,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_PlannerBucket/MSFT_PlannerBucket.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_PlannerBucket/MSFT_PlannerBucket.psm1 index 724a342b87..4d7e4f6aaa 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_PlannerBucket/MSFT_PlannerBucket.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_PlannerBucket/MSFT_PlannerBucket.psm1 @@ -95,7 +95,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -334,7 +334,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -360,7 +360,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_PlannerPlan/MSFT_PlannerPlan.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_PlannerPlan/MSFT_PlannerPlan.psm1 index 9943f7ad5c..bfd99bef84 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_PlannerPlan/MSFT_PlannerPlan.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_PlannerPlan/MSFT_PlannerPlan.psm1 @@ -106,7 +106,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -151,7 +151,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -381,7 +381,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -407,7 +407,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_PlannerTask/MSFT_PlannerTask.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_PlannerTask/MSFT_PlannerTask.psm1 index 4a633a5a1f..56d2a06e4c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_PlannerTask/MSFT_PlannerTask.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_PlannerTask/MSFT_PlannerTask.psm1 @@ -190,7 +190,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -667,7 +667,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -694,7 +694,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCAuditConfigurationPolicy/MSFT_SCAuditConfigurationPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCAuditConfigurationPolicy/MSFT_SCAuditConfigurationPolicy.psm1 index 181decba2f..a8e173a4a8 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCAuditConfigurationPolicy/MSFT_SCAuditConfigurationPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCAuditConfigurationPolicy/MSFT_SCAuditConfigurationPolicy.psm1 @@ -90,7 +90,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -283,7 +283,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCCaseHoldPolicy/MSFT_SCCaseHoldPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCCaseHoldPolicy/MSFT_SCCaseHoldPolicy.psm1 index 4e0b69aacc..8ff2219501 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCCaseHoldPolicy/MSFT_SCCaseHoldPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCCaseHoldPolicy/MSFT_SCCaseHoldPolicy.psm1 @@ -105,7 +105,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -415,7 +415,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCCaseHoldRule/MSFT_SCCaseHoldRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCCaseHoldRule/MSFT_SCCaseHoldRule.psm1 index b750917e76..a2bdb8a8fe 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCCaseHoldRule/MSFT_SCCaseHoldRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCCaseHoldRule/MSFT_SCCaseHoldRule.psm1 @@ -97,7 +97,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -323,7 +323,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceCase/MSFT_SCComplianceCase.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceCase/MSFT_SCComplianceCase.psm1 index 7a72dc9e0e..fd98190069 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceCase/MSFT_SCComplianceCase.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceCase/MSFT_SCComplianceCase.psm1 @@ -91,7 +91,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -333,7 +333,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceSearch/MSFT_SCComplianceSearch.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceSearch/MSFT_SCComplianceSearch.psm1 index 52724fcaf2..ab198bf62a 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceSearch/MSFT_SCComplianceSearch.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceSearch/MSFT_SCComplianceSearch.psm1 @@ -157,7 +157,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -471,7 +471,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceSearchAction/MSFT_SCComplianceSearchAction.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceSearchAction/MSFT_SCComplianceSearchAction.psm1 index db346b3c9c..9822c35403 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceSearchAction/MSFT_SCComplianceSearchAction.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceSearchAction/MSFT_SCComplianceSearchAction.psm1 @@ -155,7 +155,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -514,7 +514,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceTag/MSFT_SCComplianceTag.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceTag/MSFT_SCComplianceTag.psm1 index 8ded6932ea..b35de00ea5 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceTag/MSFT_SCComplianceTag.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCComplianceTag/MSFT_SCComplianceTag.psm1 @@ -133,7 +133,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -468,7 +468,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCDLPCompliancePolicy/MSFT_SCDLPCompliancePolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCDLPCompliancePolicy/MSFT_SCDLPCompliancePolicy.psm1 index af2e182d6c..0538fe457a 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCDLPCompliancePolicy/MSFT_SCDLPCompliancePolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCDLPCompliancePolicy/MSFT_SCDLPCompliancePolicy.psm1 @@ -136,7 +136,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -582,7 +582,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCDLPComplianceRule/MSFT_SCDLPComplianceRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCDLPComplianceRule/MSFT_SCDLPComplianceRule.psm1 index bb88375b0a..f26a14209a 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCDLPComplianceRule/MSFT_SCDLPComplianceRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCDLPComplianceRule/MSFT_SCDLPComplianceRule.psm1 @@ -209,7 +209,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -593,7 +593,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCDeviceConditionalAccessPolicy/MSFT_SCDeviceConditionalAccessPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCDeviceConditionalAccessPolicy/MSFT_SCDeviceConditionalAccessPolicy.psm1 index de011b8103..306983f898 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCDeviceConditionalAccessPolicy/MSFT_SCDeviceConditionalAccessPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCDeviceConditionalAccessPolicy/MSFT_SCDeviceConditionalAccessPolicy.psm1 @@ -88,7 +88,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -289,7 +289,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCDeviceConfigurationPolicy/MSFT_SCDeviceConfigurationPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCDeviceConfigurationPolicy/MSFT_SCDeviceConfigurationPolicy.psm1 index 80e3060ceb..14bd1116d0 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCDeviceConfigurationPolicy/MSFT_SCDeviceConfigurationPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCDeviceConfigurationPolicy/MSFT_SCDeviceConfigurationPolicy.psm1 @@ -88,7 +88,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -289,7 +289,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyAuthority/MSFT_SCFilePlanPropertyAuthority.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyAuthority/MSFT_SCFilePlanPropertyAuthority.psm1 index f8f8d8050d..3b91680149 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyAuthority/MSFT_SCFilePlanPropertyAuthority.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyAuthority/MSFT_SCFilePlanPropertyAuthority.psm1 @@ -77,7 +77,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -266,7 +266,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyCategory/MSFT_SCFilePlanPropertyCategory.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyCategory/MSFT_SCFilePlanPropertyCategory.psm1 index 8ed53bc6d3..1b1af3c28a 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyCategory/MSFT_SCFilePlanPropertyCategory.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyCategory/MSFT_SCFilePlanPropertyCategory.psm1 @@ -76,7 +76,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -266,7 +266,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyCitation/MSFT_SCFilePlanPropertyCitation.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyCitation/MSFT_SCFilePlanPropertyCitation.psm1 index 7e5ef58b30..f17ab2ec6a 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyCitation/MSFT_SCFilePlanPropertyCitation.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyCitation/MSFT_SCFilePlanPropertyCitation.psm1 @@ -88,7 +88,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -294,7 +294,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyDepartment/MSFT_SCFilePlanPropertyDepartment.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyDepartment/MSFT_SCFilePlanPropertyDepartment.psm1 index 82b6446b5e..9d0f7f7206 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyDepartment/MSFT_SCFilePlanPropertyDepartment.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyDepartment/MSFT_SCFilePlanPropertyDepartment.psm1 @@ -77,7 +77,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -267,7 +267,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyReferenceId/MSFT_SCFilePlanPropertyReferenceId.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyReferenceId/MSFT_SCFilePlanPropertyReferenceId.psm1 index 3ef535c242..1b8aabb6cb 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyReferenceId/MSFT_SCFilePlanPropertyReferenceId.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertyReferenceId/MSFT_SCFilePlanPropertyReferenceId.psm1 @@ -77,7 +77,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -268,7 +268,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertySubCategory/MSFT_SCFilePlanPropertySubCategory.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertySubCategory/MSFT_SCFilePlanPropertySubCategory.psm1 index 8c1144f3dc..c9e5a6a10c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertySubCategory/MSFT_SCFilePlanPropertySubCategory.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCFilePlanPropertySubCategory/MSFT_SCFilePlanPropertySubCategory.psm1 @@ -92,7 +92,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -294,7 +294,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCLabelPolicy/MSFT_SCLabelPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCLabelPolicy/MSFT_SCLabelPolicy.psm1 index 48ac322bfa..b8daf466d2 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCLabelPolicy/MSFT_SCLabelPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCLabelPolicy/MSFT_SCLabelPolicy.psm1 @@ -163,7 +163,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -675,7 +675,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionCompliancePolicy/MSFT_SCRetentionCompliancePolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionCompliancePolicy/MSFT_SCRetentionCompliancePolicy.psm1 index be87416e08..e80cbe1c91 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionCompliancePolicy/MSFT_SCRetentionCompliancePolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionCompliancePolicy/MSFT_SCRetentionCompliancePolicy.psm1 @@ -186,7 +186,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -784,7 +784,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionComplianceRule/MSFT_SCRetentionComplianceRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionComplianceRule/MSFT_SCRetentionComplianceRule.psm1 index 6bb378a4e4..fabba9a285 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionComplianceRule/MSFT_SCRetentionComplianceRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionComplianceRule/MSFT_SCRetentionComplianceRule.psm1 @@ -122,7 +122,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -390,7 +390,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1 index f27b5548c7..a3d94a861c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCSensitivityLabel/MSFT_SCSensitivityLabel.psm1 @@ -326,7 +326,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -977,7 +977,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCSupervisoryReviewPolicy/MSFT_SCSupervisoryReviewPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCSupervisoryReviewPolicy/MSFT_SCSupervisoryReviewPolicy.psm1 index 2e8318fb95..58cad1cce0 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCSupervisoryReviewPolicy/MSFT_SCSupervisoryReviewPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCSupervisoryReviewPolicy/MSFT_SCSupervisoryReviewPolicy.psm1 @@ -87,7 +87,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -286,7 +286,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCSupervisoryReviewRule/MSFT_SCSupervisoryReviewRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCSupervisoryReviewRule/MSFT_SCSupervisoryReviewRule.psm1 index 6f3513a66d..25fa1ef024 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCSupervisoryReviewRule/MSFT_SCSupervisoryReviewRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCSupervisoryReviewRule/MSFT_SCSupervisoryReviewRule.psm1 @@ -96,7 +96,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -301,7 +301,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOAccessControlSettings/MSFT_SPOAccessControlSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOAccessControlSettings/MSFT_SPOAccessControlSettings.psm1 index 78bfd127a3..aa62e17f31 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOAccessControlSettings/MSFT_SPOAccessControlSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOAccessControlSettings/MSFT_SPOAccessControlSettings.psm1 @@ -141,7 +141,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -475,7 +475,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOApp/MSFT_SPOApp.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOApp/MSFT_SPOApp.psm1 index 03ffb80194..dbdcdac5dc 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOApp/MSFT_SPOApp.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOApp/MSFT_SPOApp.psm1 @@ -103,7 +103,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -415,7 +415,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOHomeSite/MSFT_SPOHomeSite.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOHomeSite/MSFT_SPOHomeSite.psm1 index b76eee97cd..40dcb2aff0 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOHomeSite/MSFT_SPOHomeSite.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOHomeSite/MSFT_SPOHomeSite.psm1 @@ -98,7 +98,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -350,7 +350,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOHubSite/MSFT_SPOHubSite.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOHubSite/MSFT_SPOHubSite.psm1 index 93c01ed849..98fe75e593 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOHubSite/MSFT_SPOHubSite.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOHubSite/MSFT_SPOHubSite.psm1 @@ -163,7 +163,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -620,7 +620,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOOrgAssetsLibrary/MSFT_SPOOrgAssetsLibrary.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOOrgAssetsLibrary/MSFT_SPOOrgAssetsLibrary.psm1 index 3f6f0d6811..ad852d427c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOOrgAssetsLibrary/MSFT_SPOOrgAssetsLibrary.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOOrgAssetsLibrary/MSFT_SPOOrgAssetsLibrary.psm1 @@ -82,7 +82,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -171,7 +171,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -470,7 +470,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOPropertyBag/MSFT_SPOPropertyBag.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOPropertyBag/MSFT_SPOPropertyBag.psm1 index 6b86ca159a..dc0768ea79 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOPropertyBag/MSFT_SPOPropertyBag.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOPropertyBag/MSFT_SPOPropertyBag.psm1 @@ -137,7 +137,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -549,7 +549,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSearchManagedProperty/MSFT_SPOSearchManagedProperty.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSearchManagedProperty/MSFT_SPOSearchManagedProperty.psm1 index e1123e74ec..e95b193c83 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSearchManagedProperty/MSFT_SPOSearchManagedProperty.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSearchManagedProperty/MSFT_SPOSearchManagedProperty.psm1 @@ -214,7 +214,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -898,7 +898,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSearchResultSource/MSFT_SPOSearchResultSource.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSearchResultSource/MSFT_SPOSearchResultSource.psm1 index 55bf015070..b670cc014c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSearchResultSource/MSFT_SPOSearchResultSource.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSearchResultSource/MSFT_SPOSearchResultSource.psm1 @@ -175,7 +175,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -596,7 +596,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 index 5280a89891..9d0d2aa623 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 @@ -202,7 +202,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -697,7 +697,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSite/MSFT_SPOSite.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSite/MSFT_SPOSite.psm1 index ec6d71fbab..923547876e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSite/MSFT_SPOSite.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSite/MSFT_SPOSite.psm1 @@ -280,7 +280,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -961,7 +961,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteAuditSettings/MSFT_SPOSiteAuditSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteAuditSettings/MSFT_SPOSiteAuditSettings.psm1 index 854cf687d3..e55570ccf9 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteAuditSettings/MSFT_SPOSiteAuditSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteAuditSettings/MSFT_SPOSiteAuditSettings.psm1 @@ -90,7 +90,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -334,7 +334,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteDesign/MSFT_SPOSiteDesign.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteDesign/MSFT_SPOSiteDesign.psm1 index 55a2e0430d..cfd939c8ea 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteDesign/MSFT_SPOSiteDesign.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteDesign/MSFT_SPOSiteDesign.psm1 @@ -146,7 +146,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -479,7 +479,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteDesignRights/MSFT_SPOSiteDesignRights.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteDesignRights/MSFT_SPOSiteDesignRights.psm1 index 8ff1a4cf95..eb15fb7a81 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteDesignRights/MSFT_SPOSiteDesignRights.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteDesignRights/MSFT_SPOSiteDesignRights.psm1 @@ -118,7 +118,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -444,7 +444,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteGroup/MSFT_SPOSiteGroup.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteGroup/MSFT_SPOSiteGroup.psm1 index 4a834ee059..a75c7d1628 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteGroup/MSFT_SPOSiteGroup.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteGroup/MSFT_SPOSiteGroup.psm1 @@ -144,7 +144,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -543,7 +543,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteScript/MSFT_SPOSiteScript.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteScript/MSFT_SPOSiteScript.psm1 index d5db3db547..13a02c63e8 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteScript/MSFT_SPOSiteScript.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSiteScript/MSFT_SPOSiteScript.psm1 @@ -118,7 +118,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -465,7 +465,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOStorageEntity/MSFT_SPOStorageEntity.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOStorageEntity/MSFT_SPOStorageEntity.psm1 index 2d7c0067d5..2887273b50 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOStorageEntity/MSFT_SPOStorageEntity.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOStorageEntity/MSFT_SPOStorageEntity.psm1 @@ -126,7 +126,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -449,7 +449,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantCdnEnabled/MSFT_SPOTenantCdnEnabled.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantCdnEnabled/MSFT_SPOTenantCdnEnabled.psm1 index 68a11be647..81c9dfa789 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantCdnEnabled/MSFT_SPOTenantCdnEnabled.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantCdnEnabled/MSFT_SPOTenantCdnEnabled.psm1 @@ -75,7 +75,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -112,7 +112,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -367,7 +367,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantCdnPolicy/MSFT_SPOTenantCdnPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantCdnPolicy/MSFT_SPOTenantCdnPolicy.psm1 index 6f5bf47579..276571516e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantCdnPolicy/MSFT_SPOTenantCdnPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantCdnPolicy/MSFT_SPOTenantCdnPolicy.psm1 @@ -83,7 +83,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -358,7 +358,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantSettings/MSFT_SPOTenantSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantSettings/MSFT_SPOTenantSettings.psm1 index 6a04da6cad..9d61abbdea 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantSettings/MSFT_SPOTenantSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTenantSettings/MSFT_SPOTenantSettings.psm1 @@ -183,7 +183,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -586,7 +586,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTheme/MSFT_SPOTheme.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTheme/MSFT_SPOTheme.psm1 index 86afb7bc8d..98676d0c98 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTheme/MSFT_SPOTheme.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOTheme/MSFT_SPOTheme.psm1 @@ -98,7 +98,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -399,7 +399,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOUserProfileProperty/MSFT_SPOUserProfileProperty.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOUserProfileProperty/MSFT_SPOUserProfileProperty.psm1 index 23b8a7ffb6..762c73973d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOUserProfileProperty/MSFT_SPOUserProfileProperty.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOUserProfileProperty/MSFT_SPOUserProfileProperty.psm1 @@ -93,7 +93,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -435,7 +435,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallingPolicy/MSFT_TeamsCallingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallingPolicy/MSFT_TeamsCallingPolicy.psm1 index fa1d846b28..c0a0a8401f 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallingPolicy/MSFT_TeamsCallingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallingPolicy/MSFT_TeamsCallingPolicy.psm1 @@ -155,7 +155,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -485,7 +485,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsChannel/MSFT_TeamsChannel.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsChannel/MSFT_TeamsChannel.psm1 index 14b4d0278b..ffc885c61f 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsChannel/MSFT_TeamsChannel.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsChannel/MSFT_TeamsChannel.psm1 @@ -112,7 +112,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -415,7 +415,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsChannelsPolicy/MSFT_TeamsChannelsPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsChannelsPolicy/MSFT_TeamsChannelsPolicy.psm1 index d468fb9a96..d5f25c67e0 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsChannelsPolicy/MSFT_TeamsChannelsPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsChannelsPolicy/MSFT_TeamsChannelsPolicy.psm1 @@ -84,7 +84,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -296,7 +296,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsClientConfiguration/MSFT_TeamsClientConfiguration.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsClientConfiguration/MSFT_TeamsClientConfiguration.psm1 index b3ef80f0c4..761140f8ab 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsClientConfiguration/MSFT_TeamsClientConfiguration.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsClientConfiguration/MSFT_TeamsClientConfiguration.psm1 @@ -126,7 +126,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -391,7 +391,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallRoutingPolicy/MSFT_TeamsEmergencyCallRoutingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallRoutingPolicy/MSFT_TeamsEmergencyCallRoutingPolicy.psm1 index 9e73085531..c97e8d9b57 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallRoutingPolicy/MSFT_TeamsEmergencyCallRoutingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallRoutingPolicy/MSFT_TeamsEmergencyCallRoutingPolicy.psm1 @@ -85,7 +85,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -351,7 +351,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallingPolicy/MSFT_TeamsEmergencyCallingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallingPolicy/MSFT_TeamsEmergencyCallingPolicy.psm1 index 87a58de300..d90d491ba7 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallingPolicy/MSFT_TeamsEmergencyCallingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallingPolicy/MSFT_TeamsEmergencyCallingPolicy.psm1 @@ -92,7 +92,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -335,7 +335,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGuestCallingConfiguration/MSFT_TeamsGuestCallingConfiguration.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGuestCallingConfiguration/MSFT_TeamsGuestCallingConfiguration.psm1 index c8f77995ca..e97b1cd9f6 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGuestCallingConfiguration/MSFT_TeamsGuestCallingConfiguration.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGuestCallingConfiguration/MSFT_TeamsGuestCallingConfiguration.psm1 @@ -55,7 +55,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -209,7 +209,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGuestMeetingConfiguration/MSFT_TeamsGuestMeetingConfiguration.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGuestMeetingConfiguration/MSFT_TeamsGuestMeetingConfiguration.psm1 index 65ea9a47be..6c302f845a 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGuestMeetingConfiguration/MSFT_TeamsGuestMeetingConfiguration.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGuestMeetingConfiguration/MSFT_TeamsGuestMeetingConfiguration.psm1 @@ -66,7 +66,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -233,7 +233,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGuestMessagingConfiguration/MSFT_TeamsGuestMessagingConfiguration.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGuestMessagingConfiguration/MSFT_TeamsGuestMessagingConfiguration.psm1 index 6e461c727d..0c87611237 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGuestMessagingConfiguration/MSFT_TeamsGuestMessagingConfiguration.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGuestMessagingConfiguration/MSFT_TeamsGuestMessagingConfiguration.psm1 @@ -90,7 +90,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -312,7 +312,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastConfiguration/MSFT_TeamsMeetingBroadcastConfiguration.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastConfiguration/MSFT_TeamsMeetingBroadcastConfiguration.psm1 index 1424238325..54c24b5683 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastConfiguration/MSFT_TeamsMeetingBroadcastConfiguration.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastConfiguration/MSFT_TeamsMeetingBroadcastConfiguration.psm1 @@ -80,7 +80,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -278,7 +278,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastPolicy/MSFT_TeamsMeetingBroadcastPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastPolicy/MSFT_TeamsMeetingBroadcastPolicy.psm1 index 26474f74d0..aa1ebabc74 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastPolicy/MSFT_TeamsMeetingBroadcastPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastPolicy/MSFT_TeamsMeetingBroadcastPolicy.psm1 @@ -82,7 +82,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -309,7 +309,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingConfiguration/MSFT_TeamsMeetingConfiguration.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingConfiguration/MSFT_TeamsMeetingConfiguration.psm1 index 8f135edbe1..a9bde04d89 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingConfiguration/MSFT_TeamsMeetingConfiguration.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingConfiguration/MSFT_TeamsMeetingConfiguration.psm1 @@ -117,7 +117,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -367,7 +367,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingPolicy/MSFT_TeamsMeetingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingPolicy/MSFT_TeamsMeetingPolicy.psm1 index 7f5c202782..cad91e0e83 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingPolicy/MSFT_TeamsMeetingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingPolicy/MSFT_TeamsMeetingPolicy.psm1 @@ -262,7 +262,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -768,7 +768,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMessagingPolicy/MSFT_TeamsMessagingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMessagingPolicy/MSFT_TeamsMessagingPolicy.psm1 index 120eddfde9..e9eac8925d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMessagingPolicy/MSFT_TeamsMessagingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMessagingPolicy/MSFT_TeamsMessagingPolicy.psm1 @@ -159,7 +159,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -487,7 +487,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsPstnUsage/MSFT_TeamsPstnUsage.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsPstnUsage/MSFT_TeamsPstnUsage.psm1 index 0ebd7946a5..3b1f66521d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsPstnUsage/MSFT_TeamsPstnUsage.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsPstnUsage/MSFT_TeamsPstnUsage.psm1 @@ -73,7 +73,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -249,7 +249,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTeam/MSFT_TeamsTeam.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTeam/MSFT_TeamsTeam.psm1 index 0e0b0a34dd..e61141f359 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTeam/MSFT_TeamsTeam.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTeam/MSFT_TeamsTeam.psm1 @@ -224,7 +224,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -731,7 +731,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantDialPlan/MSFT_TeamsTenantDialPlan.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantDialPlan/MSFT_TeamsTenantDialPlan.psm1 index 706733e5da..f1032481bc 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantDialPlan/MSFT_TeamsTenantDialPlan.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantDialPlan/MSFT_TeamsTenantDialPlan.psm1 @@ -99,7 +99,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -379,7 +379,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpgradeConfiguration/MSFT_TeamsUpgradeConfiguration.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpgradeConfiguration/MSFT_TeamsUpgradeConfiguration.psm1 index 56f6e1812f..9be382216f 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpgradeConfiguration/MSFT_TeamsUpgradeConfiguration.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpgradeConfiguration/MSFT_TeamsUpgradeConfiguration.psm1 @@ -58,7 +58,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -218,7 +218,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpgradePolicy/MSFT_TeamsUpgradePolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpgradePolicy/MSFT_TeamsUpgradePolicy.psm1 index edffde42cd..56e58f14e2 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpgradePolicy/MSFT_TeamsUpgradePolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpgradePolicy/MSFT_TeamsUpgradePolicy.psm1 @@ -69,7 +69,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -245,7 +245,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUser/MSFT_TeamsUser.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUser/MSFT_TeamsUser.psm1 index 8fcd25e2d0..661b1c3ecd 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUser/MSFT_TeamsUser.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUser/MSFT_TeamsUser.psm1 @@ -110,7 +110,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -557,7 +557,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVoiceRoute/MSFT_TeamsVoiceRoute.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVoiceRoute/MSFT_TeamsVoiceRoute.psm1 index 8c0a85e39f..9a7492c79b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVoiceRoute/MSFT_TeamsVoiceRoute.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVoiceRoute/MSFT_TeamsVoiceRoute.psm1 @@ -91,7 +91,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -348,7 +348,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVoiceRoutingPolicy/MSFT_TeamsVoiceRoutingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVoiceRoutingPolicy/MSFT_TeamsVoiceRoutingPolicy.psm1 index caf96cf4b4..d1bbc963cf 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVoiceRoutingPolicy/MSFT_TeamsVoiceRoutingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVoiceRoutingPolicy/MSFT_TeamsVoiceRoutingPolicy.psm1 @@ -74,7 +74,7 @@ function Get-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` @@ -290,7 +290,7 @@ function Export-TargetResource } elseif ($null -ne $GlobalAdminAccount) { - $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[0] + $tenantIdValue = $GlobalAdminAccount.UserName.Split('@')[1] } Add-M365DSCEvent -Message $_ -EntryType 'Error' ` -EventID 1 -Source $($MyInvocation.MyCommand.Source) ` From 5a6d8a45a8671def3418ddf3d186e840ecff8002 Mon Sep 17 00:00:00 2001 From: timsto <34174209+Timsto@users.noreply.github.com> Date: Tue, 10 Nov 2020 15:26:33 +0000 Subject: [PATCH 06/10] minor fixes at r1 --- .../MSFT_AADPolicy/MSFT_AADPolicy.psm1 | 117 +++++++++--------- .../DSCResources/MSFT_AADPolicy/readme.md | 2 +- 2 files changed, 61 insertions(+), 58 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 index 6061d9c90e..e281b11ff8 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 @@ -15,19 +15,19 @@ function Get-TargetResource [Parameter()] [System.String] $AlternativeIdentifier, - + [Parameter()] - [System.Collections.Generic.List`1[System.String]] + [System.Collections.Generic.List`1[String]] $Definition, - + [Parameter()] [Boolean] - $isOrganizationDefault, - + $IsOrganizationDefault, + [Parameter()] - [System.Collections.Generic.List`1[System.String]] + [System.Collections.Generic.List`1[String]] $KeyCredentials, - + [Parameter()] [System.String] $Type, @@ -71,22 +71,22 @@ function Get-TargetResource { $nullReturn = $PSBoundParameters $nullReturn.Ensure = "Absent" - try + try { if ($null -ne $Id) { $Policy = Get-AzureADPolicy -ID $Id } } - catch + catch { Write-Verbose -Message "Could not retrieve AzureAD Policy by ID {$Id}" } - if ($null -eq $Policy) + if ($null -eq $Policy) { try { - $Policy = Get-AzureADPolicy -All $True -ErrorAction SilentlyContinue | Where-Object {$_.DisplayName -like $DisplayName} + $Policy = Get-AzureADPolicy -All $True -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -like $DisplayName } } catch { @@ -95,29 +95,29 @@ function Get-TargetResource -EventID 1 -Source $($MyInvocation.MyCommand.Source) } } - if ($null -eq $Policy) + if ($null -eq $Policy) { return $nullReturn } - else + else { Write-Verbose "Found existing AzureAD Policys" $Result = @{ - Id = $Policy.Id - OdataType = $Policy.OdataType - AlternativeIdentifier = $Policy.AlternativeIdentifier - Definition = $Policy.Definition - DisplayName = $Policy.DisplayName - IsOrganizationDefault = $Policy.IsOrganizationDefault - KeyCredentials = $Policy.KeyCredentials - Type = $policy.Type - Ensure = "Present" - GlobalAdminAccount = $GlobalAdminAccount - ApplicationId = $ApplicationId - TenantId = $TenantId - CertificateThumbprint = $CertificateThumbprint - } - + Id = $Policy.Id + OdataType = $Policy.OdataType + AlternativeIdentifier = $Policy.AlternativeIdentifier + Definition = $Policy.Definition + DisplayName = $Policy.DisplayName + IsOrganizationDefault = $Policy.IsOrganizationDefault + KeyCredentials = $Policy.KeyCredentials + Type = $policy.Type + Ensure = "Present" + GlobalAdminAccount = $GlobalAdminAccount + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-M365DscHashtableToString -Hashtable $result)" return $result } @@ -147,19 +147,19 @@ function Set-TargetResource [Parameter()] [System.String] $AlternativeIdentifier, - + [Parameter()] [System.Collections.Generic.List`1[System.String]] $Definition, - + [Parameter()] [Boolean] - $isOrganizationDefault, - + $IsOrganizationDefault, + [Parameter()] [System.Collections.Generic.List`1[System.String]] $KeyCredentials, - + [Parameter()] [System.String] $Type, @@ -207,20 +207,20 @@ function Set-TargetResource $currentParameters.Remove("Ensure") | Out-Null # Policy should exist but it doesn't - if($Ensure -eq 'Present' -and $currentAADPolicy.Ensure -eq "Absent") + if ($Ensure -eq 'Present' -and $currentAADPolicy.Ensure -eq "Absent") { Write-Verbose -Message "Creating New AzureAD Policy {$Displayname)}" $currentParameters.Remove("Id") | Out-Null New-AzureADPolicy @currentParameters } - # Policy should exist and will be configured to desire state + # Policy should exist and will be configured to desire state elseif ($Ensure -eq 'Present' -and $CurrentAADPolicy.Ensure -eq 'Present') { Write-Verbose -Message "Updating exisitng AzureAD Policy {$Displayname)}" $currentParameters.Id = $currentAADPolicy.ID - Set-AzureADPolicy @currentParameters + Set-AzureADPolicy @currentParameters } - # Policy exist but should not + # Policy exist but should not elseif ($Ensure -eq 'Absent' -and $CurrentAADPolicy.Ensure -eq 'Present') { Write-Verbose -Message "Removing AzureAD Policy {$Displayname)}" @@ -245,19 +245,19 @@ function Test-TargetResource [Parameter()] [System.String] $AlternativeIdentifier, - + [Parameter()] [System.Collections.Generic.List`1[System.String]] $Definition, - + [Parameter()] [Boolean] - $isOrganizationDefault, - + $IsOrganizationDefault, + [Parameter()] [System.Collections.Generic.List`1[System.String]] $KeyCredentials, - + [Parameter()] [System.String] $Type, @@ -284,7 +284,7 @@ function Test-TargetResource $CertificateThumbprint ) - Write-Verbose -Message "Testing configuration of AzureAD Policy" + Write-Verbose -Message "Testing configuration of AzureAD Policy" $CurrentValues = Get-TargetResource @PSBoundParameters @@ -292,12 +292,15 @@ function Test-TargetResource $ValuesToCheck = $PSBoundParameters $ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null - $ValuesToCheck.Remove("Id") | Out-Null + $ValuesToCheck.Remove("Id") | Out-Null + $ValuesToCheck.Remove("ApplicationId") | Out-Null + $ValuesToCheck.Remove("TenantId") | Out-Null + $ValuesToCheck.Remove("CertificateThumbprint") | Out-Null $TestResult = Test-M365DSCParameterState -CurrentValues $CurrentValues ` - -Source $($MyInvocation.MyCommand.Source) ` - -DesiredValues $PSBoundParameters ` - -ValuesToCheck $ValuesToCheck.Keys + -Source $($MyInvocation.MyCommand.Source) ` + -DesiredValues $PSBoundParameters ` + -ValuesToCheck $ValuesToCheck.Keys Write-Verbose -Message "Test-TargetResource returned $TestResult" @@ -339,20 +342,20 @@ function Export-TargetResource $dscContent = '' $ConnectionMode = New-M365DSCConnection -Platform 'AzureAD' -InboundParameters $PSBoundParameters $i = 1 - Write-Host "`r`n" -NoNewLine + Write-Host "`r`n" -NoNewline try { - $AADPolicy = Get-AzureADPolicy -ErrorAction Stop - foreach($AADPolicy in $AADPolicys) + $AADPolicys = Get-AzureADPolicy -ErrorAction Stop + foreach ($AADPolicy in $AADPolicys) { - Write-Host " |---[$i/$($AADPolicys.Count)] $($AADPolicy.DisplayName)" -NoNewLine + Write-Host " |---[$i/$($AADPolicys.Count)] $($AADPolicy.DisplayName)" -NoNewline $Params = @{ - GlobalAdminAccount = $GlobalAdminAccount - ApplicationId = $ApplicationId - TenantId = $TenantId - CertificateThumbprint = $CertificateThumbprint - DisplayName = $AADPolicy.DisplayName - ID = $AADPolicy.ID + GlobalAdminAccount = $GlobalAdminAccount + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + DisplayName = $AADPolicy.DisplayName + ID = $AADPolicy.ID } $Results = Get-TargetResource @Params diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/readme.md b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/readme.md index cab71596b0..1c9780ff70 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/readme.md +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/readme.md @@ -2,7 +2,7 @@ ## Description -This resource configures the Azure AD Policys +This resource configures the Azure AD Policies ## Azure AD Permissions From 948846fdbcb0f7b37c8f92852d4541c2f492e0d4 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 10 Nov 2020 14:32:58 -0500 Subject: [PATCH 07/10] Fixes Issue #890 --- CHANGELOG.md | 6 + .../MSFT_SCRetentionCompliancePolicy.psm1 | 375 +++++++++--------- 2 files changed, 195 insertions(+), 186 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be643536c0..839c742b2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change log for Microsoft365DSC +## 1.20.1111.1 + +* Fixes an issue with SCRetentionCompliancePolicy where + the wrong parameter sets was being passed for creation. + (Issue #890) + ## 1.20.1104.1 * AADMSGroup diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionCompliancePolicy/MSFT_SCRetentionCompliancePolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionCompliancePolicy/MSFT_SCRetentionCompliancePolicy.psm1 index e80cbe1c91..3bfc875058 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionCompliancePolicy/MSFT_SCRetentionCompliancePolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCRetentionCompliancePolicy/MSFT_SCRetentionCompliancePolicy.psm1 @@ -332,236 +332,239 @@ function Set-TargetResource $CreationParams.Remove("TeamsChatLocationException") $CreationParams.Remove("DynamicScopeLocation") - # Exchange Location is specified or already existing, we need to determine - # the delta. - if ($null -ne $CurrentPolicy.ExchangeLocation -or ` - $null -ne $ExchangeLocation) + if ($CurrentPolicy.Ensure -eq 'Present') { - $ToBeRemoved = $CurrentPolicy.ExchangeLocation | ` - Where-Object { $ExchangeLocation -NotContains $_ } - if ($null -ne $ToBeRemoved) + # Exchange Location is specified or already existing, we need to determine + # the delta. + if ($null -ne $CurrentPolicy.ExchangeLocation -or ` + $null -ne $ExchangeLocation) { - $CreationParams.Add("RemoveExchangeLocation", $ToBeRemoved) - } - - $ToBeAdded = $ExchangeLocation | ` - Where-Object { $CurrentPolicy.ExchangeLocation -NotContains $_ } - if ($null -ne $ToBeAdded) - { - $CreationParams.Add("AddExchangeLocation", $ToBeAdded) - } + $ToBeRemoved = $CurrentPolicy.ExchangeLocation | ` + Where-Object { $ExchangeLocation -NotContains $_ } + if ($null -ne $ToBeRemoved) + { + $CreationParams.Add("RemoveExchangeLocation", $ToBeRemoved) + } - $CreationParams.Remove("ExchangeLocation") - } + $ToBeAdded = $ExchangeLocation | ` + Where-Object { $CurrentPolicy.ExchangeLocation -NotContains $_ } + if ($null -ne $ToBeAdded) + { + $CreationParams.Add("AddExchangeLocation", $ToBeAdded) + } - # Exchange Location Exception is specified or already existing, we need to determine - # the delta. - if ($null -ne $CurrentPolicy.ExchangeLocationException -or ` - $null -ne $ExchangeLocationException) - { - $ToBeRemoved = $CurrentPolicy.ExchangeLocationException | ` - Where-Object { $ExchangeLocationException -NotContains $_ } - if ($null -ne $ToBeRemoved) - { - $CreationParams.Add("RemoveExchangeLocationException", $ToBeRemoved) + $CreationParams.Remove("ExchangeLocation") } - $ToBeAdded = $ExchangeLocationException | ` - Where-Object { $CurrentPolicy.ExchangeLocationException -NotContains $_ } - if ($null -ne $ToBeAdded) + # Exchange Location Exception is specified or already existing, we need to determine + # the delta. + if ($null -ne $CurrentPolicy.ExchangeLocationException -or ` + $null -ne $ExchangeLocationException) { - $CreationParams.Add("AddExchangeLocationException", $ToBeAdded) - } - $CreationParams.Remove("ExchangeLocationException") - } + $ToBeRemoved = $CurrentPolicy.ExchangeLocationException | ` + Where-Object { $ExchangeLocationException -NotContains $_ } + if ($null -ne $ToBeRemoved) + { + $CreationParams.Add("RemoveExchangeLocationException", $ToBeRemoved) + } - # Modern Group Location is specified or already existing, we need to determine - # the delta. - if ($null -ne $CurrentPolicy.ModernGroupLocation -or ` - $null -ne $ModernGroupLocation) - { - $ToBeRemoved = $CurrentPolicy.ModernGroupLocation | ` - Where-Object { $ModernGroupLocation -NotContains $_ } - if ($null -ne $ToBeRemoved) - { - $CreationParams.Add("RemoveModernGroupLocation", $ToBeRemoved) + $ToBeAdded = $ExchangeLocationException | ` + Where-Object { $CurrentPolicy.ExchangeLocationException -NotContains $_ } + if ($null -ne $ToBeAdded) + { + $CreationParams.Add("AddExchangeLocationException", $ToBeAdded) + } + $CreationParams.Remove("ExchangeLocationException") } - $ToBeAdded = $ModernGroupLocation | ` - Where-Object { $CurrentPolicy.ModernGroupLocation -NotContains $_ } - if ($null -ne $ToBeAdded) + # Modern Group Location is specified or already existing, we need to determine + # the delta. + if ($null -ne $CurrentPolicy.ModernGroupLocation -or ` + $null -ne $ModernGroupLocation) { - $CreationParams.Add("AddModernGroupLocation", $ToBeAdded) - } - $CreationParams.Remove("ModernGroupLocation") - } + $ToBeRemoved = $CurrentPolicy.ModernGroupLocation | ` + Where-Object { $ModernGroupLocation -NotContains $_ } + if ($null -ne $ToBeRemoved) + { + $CreationParams.Add("RemoveModernGroupLocation", $ToBeRemoved) + } - # Modern Group Location Exception is specified or already existing, we need to determine - # the delta. - if ($null -ne $CurrentPolicy.ModernGroupLocationException -or ` - $null -ne $ModernGroupLocationException) - { - $ToBeRemoved = $CurrentPolicy.ModernGroupLocationException | ` - Where-Object { $ModernGroupLocationException -NotContains $_ } - if ($null -ne $ToBeRemoved) - { - $CreationParams.Add("RemoveModernGroupLocationException", $ToBeRemoved) + $ToBeAdded = $ModernGroupLocation | ` + Where-Object { $CurrentPolicy.ModernGroupLocation -NotContains $_ } + if ($null -ne $ToBeAdded) + { + $CreationParams.Add("AddModernGroupLocation", $ToBeAdded) + } + $CreationParams.Remove("ModernGroupLocation") } - $ToBeAdded = $ModernGroupLocationException | ` - Where-Object { $CurrentPolicy.ModernGroupLocationException -NotContains $_ } - if ($null -ne $ToBeAdded) + # Modern Group Location Exception is specified or already existing, we need to determine + # the delta. + if ($null -ne $CurrentPolicy.ModernGroupLocationException -or ` + $null -ne $ModernGroupLocationException) { - $CreationParams.Add("AddModernGroupLocationException", $ToBeAdded) - } - $CreationParams.Remove("ModernGroupLocationException") - } + $ToBeRemoved = $CurrentPolicy.ModernGroupLocationException | ` + Where-Object { $ModernGroupLocationException -NotContains $_ } + if ($null -ne $ToBeRemoved) + { + $CreationParams.Add("RemoveModernGroupLocationException", $ToBeRemoved) + } - # OneDrive Location is specified or already existing, we need to determine - # the delta. - if ($null -ne $CurrentPolicy.OneDriveLocation -or ` - $null -ne $OneDriveLocation) - { - $ToBeRemoved = $CurrentPolicy.OneDriveLocation | ` - Where-Object { $OneDriveLocation -NotContains $_ } - if ($null -ne $ToBeRemoved) - { - $CreationParams.Add("RemoveOneDriveLocation", $ToBeRemoved) + $ToBeAdded = $ModernGroupLocationException | ` + Where-Object { $CurrentPolicy.ModernGroupLocationException -NotContains $_ } + if ($null -ne $ToBeAdded) + { + $CreationParams.Add("AddModernGroupLocationException", $ToBeAdded) + } + $CreationParams.Remove("ModernGroupLocationException") } - $ToBeAdded = $OneDriveLocation | ` - Where-Object { $CurrentPolicy.OneDriveLocation -NotContains $_ } - if ($null -ne $ToBeAdded) + # OneDrive Location is specified or already existing, we need to determine + # the delta. + if ($null -ne $CurrentPolicy.OneDriveLocation -or ` + $null -ne $OneDriveLocation) { - $CreationParams.Add("AddOneDriveLocation", $ToBeAdded) - } - $CreationParams.Remove("OneDriveLocation") - } + $ToBeRemoved = $CurrentPolicy.OneDriveLocation | ` + Where-Object { $OneDriveLocation -NotContains $_ } + if ($null -ne $ToBeRemoved) + { + $CreationParams.Add("RemoveOneDriveLocation", $ToBeRemoved) + } - # OneDrive Location Exception is specified or already existing, we need to determine - # the delta. - if ($null -ne $CurrentPolicy.OneDriveLocationException -or ` - $null -ne $OneDriveLocationException) - { - $ToBeRemoved = $CurrentPolicy.OneDriveLocationException | ` - Where-Object { $OneDriveLocationException -NotContains $_ } - if ($null -ne $ToBeRemoved) - { - $CreationParams.Add("RemoveOneDriveLocationException", $ToBeRemoved) + $ToBeAdded = $OneDriveLocation | ` + Where-Object { $CurrentPolicy.OneDriveLocation -NotContains $_ } + if ($null -ne $ToBeAdded) + { + $CreationParams.Add("AddOneDriveLocation", $ToBeAdded) + } + $CreationParams.Remove("OneDriveLocation") } - $ToBeAdded = $OneDriveLocationException | ` - Where-Object { $CurrentPolicy.OneDriveLocationException -NotContains $_ } - if ($null -ne $ToBeAdded) + # OneDrive Location Exception is specified or already existing, we need to determine + # the delta. + if ($null -ne $CurrentPolicy.OneDriveLocationException -or ` + $null -ne $OneDriveLocationException) { - $CreationParams.Add("AddOneDriveLocationException", $ToBeAdded) - } - $CreationParams.Remove("OneDriveLocationException") - } + $ToBeRemoved = $CurrentPolicy.OneDriveLocationException | ` + Where-Object { $OneDriveLocationException -NotContains $_ } + if ($null -ne $ToBeRemoved) + { + $CreationParams.Add("RemoveOneDriveLocationException", $ToBeRemoved) + } - # Public Folder Location is specified or already existing, we need to determine - # the delta. - if ($null -ne $CurrentPolicy.PublicFolderLocation -or ` - $null -ne $PublicFolderLocation) - { - $ToBeRemoved = $CurrentPolicy.PublicFolderLocation | ` - Where-Object { $PublicFolderLocation -NotContains $_ } - if ($null -ne $ToBeRemoved) - { - $CreationParams.Add("RemovePublicFolderLocation", $ToBeRemoved) + $ToBeAdded = $OneDriveLocationException | ` + Where-Object { $CurrentPolicy.OneDriveLocationException -NotContains $_ } + if ($null -ne $ToBeAdded) + { + $CreationParams.Add("AddOneDriveLocationException", $ToBeAdded) + } + $CreationParams.Remove("OneDriveLocationException") } - $ToBeAdded = $PublicFolderLocation | ` - Where-Object { $CurrentPolicy.PublicFolderLocation -NotContains $_ } - if ($null -ne $ToBeAdded) + # Public Folder Location is specified or already existing, we need to determine + # the delta. + if ($null -ne $CurrentPolicy.PublicFolderLocation -or ` + $null -ne $PublicFolderLocation) { - $CreationParams.Add("AddPublicFolderLocation", $ToBeAdded) - } - $CreationParams.Remove("PublicFolderLocation") - } + $ToBeRemoved = $CurrentPolicy.PublicFolderLocation | ` + Where-Object { $PublicFolderLocation -NotContains $_ } + if ($null -ne $ToBeRemoved) + { + $CreationParams.Add("RemovePublicFolderLocation", $ToBeRemoved) + } - # SharePoint Location is specified or already existing, we need to determine - # the delta. - if ($null -ne $CurrentPolicy.SharePointLocation -or ` - $null -ne $SharePointLocation) - { - $ToBeRemoved = $CurrentPolicy.SharePointLocation | ` - Where-Object { $SharePointLocation -NotContains $_ } - if ($null -ne $ToBeRemoved) - { - $CreationParams.Add("RemoveSharePointLocation", $ToBeRemoved) + $ToBeAdded = $PublicFolderLocation | ` + Where-Object { $CurrentPolicy.PublicFolderLocation -NotContains $_ } + if ($null -ne $ToBeAdded) + { + $CreationParams.Add("AddPublicFolderLocation", $ToBeAdded) + } + $CreationParams.Remove("PublicFolderLocation") } - $ToBeAdded = $SharePointLocation | ` - Where-Object { $CurrentPolicy.SharePointLocation -NotContains $_ } - if ($null -ne $ToBeAdded) + # SharePoint Location is specified or already existing, we need to determine + # the delta. + if ($null -ne $CurrentPolicy.SharePointLocation -or ` + $null -ne $SharePointLocation) { - $CreationParams.Add("AddSharePointLocation", $ToBeAdded) - } - $CreationParams.Remove("SharePointLocation") - } + $ToBeRemoved = $CurrentPolicy.SharePointLocation | ` + Where-Object { $SharePointLocation -NotContains $_ } + if ($null -ne $ToBeRemoved) + { + $CreationParams.Add("RemoveSharePointLocation", $ToBeRemoved) + } - # SharePoint Location Exception is specified or already existing, we need to determine - # the delta. - if ($null -ne $CurrentPolicy.SharePointLocationException -or ` - $null -ne $SharePointLocationException) - { - $ToBeRemoved = $CurrentPolicy.SharePointLocationException | ` - Where-Object { $SharePointLocationException -NotContains $_ } - if ($null -ne $ToBeRemoved) - { - $CreationParams.Add("RemoveSharePointLocationException", $ToBeRemoved) + $ToBeAdded = $SharePointLocation | ` + Where-Object { $CurrentPolicy.SharePointLocation -NotContains $_ } + if ($null -ne $ToBeAdded) + { + $CreationParams.Add("AddSharePointLocation", $ToBeAdded) + } + $CreationParams.Remove("SharePointLocation") } - $ToBeAdded = $SharePointLocationException | ` - Where-Object { $CurrentPolicy.SharePointLocationException -NotContains $_ } - if ($null -ne $ToBeAdded) + # SharePoint Location Exception is specified or already existing, we need to determine + # the delta. + if ($null -ne $CurrentPolicy.SharePointLocationException -or ` + $null -ne $SharePointLocationException) { - $CreationParams.Add("AddSharePointLocationException", $ToBeAdded) - } - $CreationParams.Remove("SharePointLocationException") - } + $ToBeRemoved = $CurrentPolicy.SharePointLocationException | ` + Where-Object { $SharePointLocationException -NotContains $_ } + if ($null -ne $ToBeRemoved) + { + $CreationParams.Add("RemoveSharePointLocationException", $ToBeRemoved) + } - # Skype Location is specified or already existing, we need to determine - # the delta. - if ($null -ne $CurrentPolicy.SkypeLocation -or ` - $null -ne $SkypeLocation) - { - $ToBeRemoved = $CurrentPolicy.SkypeLocation | ` - Where-Object { $SkypeLocation -NotContains $_ } - if ($null -ne $ToBeRemoved) - { - $CreationParams.Add("RemoveSkypeLocation", $ToBeRemoved) + $ToBeAdded = $SharePointLocationException | ` + Where-Object { $CurrentPolicy.SharePointLocationException -NotContains $_ } + if ($null -ne $ToBeAdded) + { + $CreationParams.Add("AddSharePointLocationException", $ToBeAdded) + } + $CreationParams.Remove("SharePointLocationException") } - $ToBeAdded = $SkypeLocation | ` - Where-Object { $CurrentPolicy.SkypeLocation -NotContains $_ } - if ($null -ne $ToBeAdded) + # Skype Location is specified or already existing, we need to determine + # the delta. + if ($null -ne $CurrentPolicy.SkypeLocation -or ` + $null -ne $SkypeLocation) { - $CreationParams.Add("AddSkypeLocation", $ToBeAdded) - } - $CreationParams.Remove("SkypeLocation") - } + $ToBeRemoved = $CurrentPolicy.SkypeLocation | ` + Where-Object { $SkypeLocation -NotContains $_ } + if ($null -ne $ToBeRemoved) + { + $CreationParams.Add("RemoveSkypeLocation", $ToBeRemoved) + } - # Skype Location Exception is specified or already existing, we need to determine - # the delta. - if ($null -ne $CurrentPolicy.SkypeLocationException -or ` - $null -ne $SkypeLocationException) - { - $ToBeRemoved = $CurrentPolicy.SkypeLocationException | ` - Where-Object { $SkypeLocationException -NotContains $_ } - if ($null -ne $ToBeRemoved) - { - $CreationParams.Add("RemoveSkypeLocationException", $ToBeRemoved) + $ToBeAdded = $SkypeLocation | ` + Where-Object { $CurrentPolicy.SkypeLocation -NotContains $_ } + if ($null -ne $ToBeAdded) + { + $CreationParams.Add("AddSkypeLocation", $ToBeAdded) + } + $CreationParams.Remove("SkypeLocation") } - $ToBeAdded = $SkypeLocationException | ` - Where-Object { $CurrentPolicy.SkypeLocationException -NotContains $_ } - if ($null -ne $ToBeAdded) + # Skype Location Exception is specified or already existing, we need to determine + # the delta. + if ($null -ne $CurrentPolicy.SkypeLocationException -or ` + $null -ne $SkypeLocationException) { - $CreationParams.Add("AddSkypeLocationException", $ToBeAdded) + $ToBeRemoved = $CurrentPolicy.SkypeLocationException | ` + Where-Object { $SkypeLocationException -NotContains $_ } + if ($null -ne $ToBeRemoved) + { + $CreationParams.Add("RemoveSkypeLocationException", $ToBeRemoved) + } + + $ToBeAdded = $SkypeLocationException | ` + Where-Object { $CurrentPolicy.SkypeLocationException -NotContains $_ } + if ($null -ne $ToBeAdded) + { + $CreationParams.Add("AddSkypeLocationException", $ToBeAdded) + } + $CreationParams.Remove("SkypeLocationException") } - $CreationParams.Remove("SkypeLocationException") } } else From 21c9c85a3995723a720cb848d7257360dee2a769 Mon Sep 17 00:00:00 2001 From: timsto <34174209+Timsto@users.noreply.github.com> Date: Wed, 11 Nov 2020 10:44:35 +0000 Subject: [PATCH 08/10] r3 fixed Definition Type and removed KeyCredential --- .../MSFT_AADPolicy/MSFT_AADPolicy.psm1 | 19 +----- .../MSFT_AADPolicy/MSFT_AADPolicy.schema.mof | 1 - .../AADPolicy/1-ConfigureAADPolicy.ps1 | 2 +- .../Microsoft365DSC.AADPolicy.Tests.ps1 | 60 +++++++++---------- 4 files changed, 34 insertions(+), 48 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 index e281b11ff8..af4aeaf6ff 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 @@ -17,17 +17,13 @@ function Get-TargetResource $AlternativeIdentifier, [Parameter()] - [System.Collections.Generic.List`1[String]] + [System.String[]] $Definition, [Parameter()] [Boolean] $IsOrganizationDefault, - [Parameter()] - [System.Collections.Generic.List`1[String]] - $KeyCredentials, - [Parameter()] [System.String] $Type, @@ -109,7 +105,6 @@ function Get-TargetResource Definition = $Policy.Definition DisplayName = $Policy.DisplayName IsOrganizationDefault = $Policy.IsOrganizationDefault - KeyCredentials = $Policy.KeyCredentials Type = $policy.Type Ensure = "Present" GlobalAdminAccount = $GlobalAdminAccount @@ -149,17 +144,13 @@ function Set-TargetResource $AlternativeIdentifier, [Parameter()] - [System.Collections.Generic.List`1[System.String]] + [System.String[]] $Definition, [Parameter()] [Boolean] $IsOrganizationDefault, - [Parameter()] - [System.Collections.Generic.List`1[System.String]] - $KeyCredentials, - [Parameter()] [System.String] $Type, @@ -247,17 +238,13 @@ function Test-TargetResource $AlternativeIdentifier, [Parameter()] - [System.Collections.Generic.List`1[System.String]] + [System.String[]] $Definition, [Parameter()] [Boolean] $IsOrganizationDefault, - [Parameter()] - [System.Collections.Generic.List`1[System.String]] - $KeyCredentials, - [Parameter()] [System.String] $Type, diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.schema.mof index 648ca609cd..e9c2d547dd 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.schema.mof @@ -6,7 +6,6 @@ class MSFT_AADPolicy : OMI_BaseResource [Write, Description("AlternativeIdentifier Policy.")] string AlternativeIdentifier; [Write, Description("Definition of the Policy.")] String Definition[]; [Write, Description("IsOrganizationDefault of the Policy.")] Boolean IsOrganizationDefault; - [Write, Description("KeyCredentials of the Policy.")] String KeyCredentials[]; [Write, Description("Type of the Policy.")] string Type; [Write, Description("Specify if the Azure AD Policy should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; [Write, Description("Credentials of the Azure AD Admin"), EmbeddedInstance("MSFT_Credential")] string GlobalAdminAccount; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 index 0bb47ea85a..b4e88a5237 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 @@ -19,7 +19,7 @@ Configuration Example DisplayName = "PolicyDisplayName" Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') IsOrganizationDefault = $false - Type = "TokenIssuancePolicy" + type = "TokenIssuancePolicy" Ensure = "Present" GlobalAdminAccount = $credsGlobalAdmin } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 index a5ca8a56f0..e3c8747ec7 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADPolicy.Tests.ps1 @@ -2,14 +2,14 @@ param( ) $M365DSCTestFolder = Join-Path -Path $PSScriptRoot ` - -ChildPath "..\..\Unit" ` - -Resolve + -ChildPath "..\..\Unit" ` + -Resolve $CmdletModule = (Join-Path -Path $M365DSCTestFolder ` - -ChildPath "\Stubs\Microsoft365.psm1" ` - -Resolve) + -ChildPath "\Stubs\Microsoft365.psm1" ` + -Resolve) $GenericStubPath = (Join-Path -Path $M365DSCTestFolder ` - -ChildPath "\Stubs\Generic.psm1" ` - -Resolve) + -ChildPath "\Stubs\Generic.psm1" ` + -Resolve) Import-Module -Name (Join-Path -Path $M365DSCTestFolder ` -ChildPath "\UnitTestHelper.psm1" ` -Resolve) @@ -60,12 +60,12 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name "The Policy should exist but it does not" -Fixture { BeforeAll { $testParams = @{ - DisplayName = "PolicyDisplayName" - Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') - IsOrganizationDefault = $false - Type = "TokenIssuancePolicy" - Ensure = "Present" - GlobalAdminAccount = $credsGlobalAdmin + DisplayName = "PolicyDisplayName" + Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') + IsOrganizationDefault = $false + Type = "TokenIssuancePolicy" + Ensure = "Present" + GlobalAdminAccount = $credsGlobalAdmin } Mock -CommandName Get-AzureADPolicy -MockWith { @@ -88,12 +88,12 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name "The Policy exists but it should not" -Fixture { BeforeAll { $testParams = @{ - DisplayName = "PolicyDisplayName" - Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') - IsOrganizationDefault = $false - Type = "TokenIssuancePolicy" - Ensure = "Absent" - GlobalAdminAccount = $credsGlobalAdmin + DisplayName = "PolicyDisplayName" + Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') + IsOrganizationDefault = $false + Type = "TokenIssuancePolicy" + Ensure = "Absent" + GlobalAdminAccount = $credsGlobalAdmin } Mock -CommandName Get-AzureADPolicy -MockWith { @@ -126,12 +126,12 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name "The Policy exists and values are already in the desired state" -Fixture { BeforeAll { $testParams = @{ - DisplayName = "PolicyDisplayName" - Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') - IsOrganizationDefault = $false - Type = "TokenIssuancePolicy" - Ensure = "Present" - GlobalAdminAccount = $credsGlobalAdmin + DisplayName = "PolicyDisplayName" + Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') + IsOrganizationDefault = $false + Type = "TokenIssuancePolicy" + Ensure = "Present" + GlobalAdminAccount = $credsGlobalAdmin } Mock -CommandName Get-AzureADPolicy -MockWith { @@ -159,12 +159,12 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name "Values are not in the desired state" -Fixture { BeforeAll { $testParams = @{ - DisplayName = "PolicyDisplayName1" - Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') - IsOrganizationDefault = $true - Type = "TokenIssuancePolicy" - Ensure = "Present" - GlobalAdminAccount = $credsGlobalAdmin + DisplayName = "PolicyDisplayName1" + Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') + IsOrganizationDefault = $true + Type = "TokenIssuancePolicy" + Ensure = "Present" + GlobalAdminAccount = $credsGlobalAdmin } Mock -CommandName Get-AzureADPolicy -MockWith { From b0374cc643b1173c8a39e2a7940d03a70a251eef Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 11 Nov 2020 08:43:03 -0500 Subject: [PATCH 09/10] Fixes issue with Export of AADPolicy --- .../DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 | 13 +++++++++++-- .../Resources/AADPolicy/1-ConfigureAADPolicy.ps1 | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 index af4aeaf6ff..59d340c43c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADPolicy/MSFT_AADPolicy.psm1 @@ -97,7 +97,7 @@ function Get-TargetResource } else { - Write-Verbose "Found existing AzureAD Policys" + Write-Verbose "Found existing AzureAD Policy {$($Policy.DisplayName)}" $Result = @{ Id = $Policy.Id OdataType = $Policy.OdataType @@ -105,7 +105,7 @@ function Get-TargetResource Definition = $Policy.Definition DisplayName = $Policy.DisplayName IsOrganizationDefault = $Policy.IsOrganizationDefault - Type = $policy.Type + Type = $Policy.Type Ensure = "Present" GlobalAdminAccount = $GlobalAdminAccount ApplicationId = $ApplicationId @@ -346,6 +346,15 @@ function Export-TargetResource } $Results = Get-TargetResource @Params + # Fix quotes inside the Definition's JSON; + $NewDefinition = @() + foreach ($item in $Results.Definition) + { + $fixedContent = $item.Replace('"', '`"') + $NewDefinition += $fixedContent + } + $results.Definition = $NewDefinition + if ($Results.Ensure -eq 'Present') { $Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode ` diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 index b4e88a5237..0bb47ea85a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADPolicy/1-ConfigureAADPolicy.ps1 @@ -19,7 +19,7 @@ Configuration Example DisplayName = "PolicyDisplayName" Definition = @('{"TokenIssuancePolicy":{"Version": 1,"SigningAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1","TokenResponseSigningPolicy": "TokenOnly","SamlTokenVersion": "2.0"}}') IsOrganizationDefault = $false - type = "TokenIssuancePolicy" + Type = "TokenIssuancePolicy" Ensure = "Present" GlobalAdminAccount = $credsGlobalAdmin } From 68188c683fd8b273e5d32c41f0a209b68e4925e6 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 11 Nov 2020 15:50:02 -0500 Subject: [PATCH 10/10] Release 1.20.1111.1 --- CHANGELOG.md | 2 + Modules/Microsoft365DSC/Microsoft365DSC.psd1 | 50 +++----------------- 2 files changed, 9 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 839c742b2a..4482231291 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 1.20.1111.1 +* AADPolicy + Initial Release; * Fixes an issue with SCRetentionCompliancePolicy where the wrong parameter sets was being passed for creation. (Issue #890) diff --git a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 index 459a810203..ebad388624 100644 --- a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 +++ b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 2020-11-04 +# Generated on: 2020-11-11 @{ @@ -11,7 +11,7 @@ # RootModule = '' # Version number of this module. - ModuleVersion = '1.20.1104.1' + ModuleVersion = '1.20.1111.1' # Supported PSEditions # CompatiblePSEditions = @() @@ -174,47 +174,11 @@ IconUri = 'https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Dependencies/Images/Logo.png?raw=true' # ReleaseNotes of this module - ReleaseNotes = "* EXOOutboundConnector - * Fixed issue #821 - * O365OrgCustomizationSetting - * Fixes an issue where the resource was not being exported; - * O365User - * Added additional information in the error log for when - we try to set an invalid license - * ODSettings - * Removed AD group guid dependency issue # 862 - * SPOTenantSettings - * Parameter RequireAcceptingAccountMatchInvitedAccount - is now deprecated (Issue #864) - * SPOSharingSettings - * Fixed issue # 855 - * Fixed issue # 866 changed domains to array - * Fixed issue where trying to set anonymous link types if - sharing not properly configured issue #865 - * SPOTheme - * Fixed issue where Palette was not being properly extracted as - an array of CIMInstances. - * TeamsTeam - * Added support for visibility HiddenMembership - * MODULES - * M365DSCUtil - * Fixed an issue where function Test-M365DSCObjectHasProperty was missing - (Issue #861) - * M365DSCReverse - * Fixed an issue where passing in the file name and using the GUI for - extraction did not store the file at the specified location (Issue #810) - * Fixed and issue where the -GenerateInfo parameter would always generate - a link to the same resource. - * Added current version module in the Export file. - * MISC - * Added Authentication Type used to the Telemetry Engine. - * DEPENDENCIES - * AzureADPreview Updated to 2.0.2.119 - * DSCParser Updated to 1.3.0.0 - * Microsoft.Graph.Authentication Updated to 1.1.0 - * Microsoft.Graph.Planner Updated to 1.1.0 - * Microsoft.PowerApps.Administration.PowerShell Updated - to 2.0.96;" + ReleaseNotes = "* AADPolicy + Initial Release; + * Fixes an issue with SCRetentionCompliancePolicy where + the wrong parameter sets was being passed for creation. + (Issue #890)" # Flag to indicate whether the module requires explicit user acceptance for install/update # RequireLicenseAcceptance = $false