Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

EXOOrganizationConfig not in desired state output false #1789

Closed
atdheekurteshi opened this issue Feb 28, 2022 · 1 comment · Fixed by #1790 or #1813
Closed

EXOOrganizationConfig not in desired state output false #1789

atdheekurteshi opened this issue Feb 28, 2022 · 1 comment · Fixed by #1790 or #1813
Labels
Bug Something isn't working Exchange Online

Comments

@atdheekurteshi
Copy link

Details of the scenario you tried and the problem that is occurring

When I run the following commands in the Power-Shell everything seems to be working fine for EXOOrganizationConfig:

Publish-DscConfiguration -Path C:\...\MOFs\MainConfig -Force
Start-DscConfiguration -UseExisting -Force -Verbose -Wait
$res=Test-DscConfiguration -ComputerName localhost -Detailed -Verbose

but the following Power-Shell command

PS C:\Windows\system32> $res.ResourcesNotInDesiredState


ConfigurationName    : MainConfig
DependsOn            :
ModuleName           : Microsoft365DSC
ModuleVersion        : 1.22.216.1
PsDscRunAsCredential :
ResourceId           : [EXOOrganizationConfig]Container-39-67fd2426-17e4-480d-bb7b-b2858fa8bffa
SourceInfo           : ::51::3::EXOOrganizationConfig
DurationInSeconds    : 3.102
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Container-39-67fd2426-17e4-480d-bb7b-b2858fa8bffa
RebootRequested      : False
ResourceName         : EXOOrganizationConfig
StartDate            : 2/28/2022 12:34:15 PM
StateChanged         : False
PSComputerName       : localhost 

outputs the EXOOrganizationConfig not in desired state although the AutoExpandingArchiveEnabled is set from False to True

PS C:\Windows\system32> Get-OrganizationConfig | select AutoExpandingArchiveEnabled
AutoExpandingArchiveEnabled 
---------------------------------
                             True

The DSC configuration that is used to reproduce the issue (as detailed as possible)

MOF file extract:

/*
@TargetNode='localhost'
@GeneratedBy=xxx
@GenerationDate=02/28/2022 12:27:49
@GenerationHost=xxx
*/

instance of MSFT_SPOTenantSettings as $MSFT_SPOTenantSettings1ref
{
ResourceID = "[SPOTenantSettings]Container-78-c0ba1ac8-66c3-4596-af75-dfff09ae433d";
 ApplicationId = "xxx";
 CertificateThumbprint = "xxx";
 Ensure = "Present";
 LegacyAuthProtocolsEnabled = False;
 SourceInfo = "::10::3::SPOTenantSettings";
 TenantId = "xxx";
 IsSingleInstance = "Yes";
 ModuleName = "Microsoft365DSC";
 ModuleVersion = "1.22.216.1";

 ConfigurationName = "MainConfig";

};
instance of MSFT_EXORoleAssignmentPolicy as $MSFT_EXORoleAssignmentPolicy1ref
{
ResourceID = "[EXORoleAssignmentPolicy]Container-77-b533e748-c0e3-4873-8626-3592ed3a77d2";
 Description = "Diese Richtlinie gewährt Endbenutzern die Berechtigung zum Festlegen ihrer Optionen für Outlook im Web und zum Durchführen anderer Aufgaben im Rahmen der Selbstverwaltung.";
 Roles = {
    "MyRetentionPolicies",
    "MyMailboxDelegation",
    "MyBaseOptions"
};
 CertificateThumbprint = "xxx";
 Ensure = "Present";
 ApplicationId = "xxx";
 SourceInfo = "::19::3::EXORoleAssignmentPolicy";
 Name = "Default Role Assignment Policy";
 TenantId = "xxx";
 ModuleName = "Microsoft365DSC";
 IsDefault = True;
 ModuleVersion = "1.22.216.1";

 ConfigurationName = "MainConfig";

};
instance of MSFT_EXOHostedOutboundSpamFilterPolicy as $MSFT_EXOHostedOutboundSpamFilterPolicy1ref
{
ResourceID = "[EXOHostedOutboundSpamFilterPolicy]Container-76-674bd1b4-945c-4b1d-9532-37ae6917eaf1";
 TenantId = "xxx";
 CertificateThumbprint = "xxx";
 Ensure = "Present";
 ApplicationId = "xxx";
 SourceInfo = "::30::3::EXOHostedOutboundSpamFilterPolicy";
 AutoForwardingMode = "On";
 Identity = "Default";
 ModuleName = "Microsoft365DSC";
 ModuleVersion = "1.22.216.1";

 ConfigurationName = "MainConfig";

};
instance of MSFT_SPOAccessControlSettings as $MSFT_SPOAccessControlSettings1ref
{
CommentsOnSitePagesDisabled = True;
 DisallowInfectedFileDownload = True;
 TenantId = "xxx";
 IsSingleInstance = "Yes";
 ResourceID = "[SPOAccessControlSettings]Container-45-bc14bd84-fd75-411e-bc3b-86ec9d55ef3f";
 Ensure = "Present";
 SourceInfo = "::39::3::SPOAccessControlSettings";
 DisplayStartASiteOption = False;
 CertificateThumbprint = "xxx";
 ApplicationId = "xxx";
 ModuleVersion = "1.22.216.1";
 ModuleName = "Microsoft365DSC";
 SocialBarOnSitePagesDisabled = True;

 ConfigurationName = "MainConfig";

};
instance of MSFT_EXOOrganizationConfig as $MSFT_EXOOrganizationConfig1ref
{
ResourceID = "[EXOOrganizationConfig]Container-39-67fd2426-17e4-480d-bb7b-b2858fa8bffa";
 AutoExpandingArchive = True;
 OutlookPayEnabled = False;
 CertificateThumbprint = "xxx";
 BookingsEnabled = False;
 ApplicationId = "xxx";
 SourceInfo = "::51::3::EXOOrganizationConfig";
 TenantId = "xxx";
 IsSingleInstance = "Yes";
 ModuleName = "Microsoft365DSC";
 ModuleVersion = "1.22.216.1";

 ConfigurationName = "MainConfig";

};
instance of OMI_ConfigurationDocument


                    {
 Version="2.0.0";
 

                        MinimumCompatibleVersion = "1.0.0";
 

                        CompatibleVersionAdditionalProperties= {"Omi_BaseResource:ConfigurationName"};
 

                        Author="xxx";
 

                        GenerationDate="02/28/2022 12:27:49";
 

                        GenerationHost="xxx";
 

                        Name="MainConfig";


                    };

#### The operating system the target node is running
<!--
    Please provide as much as possible about the target node, for example
    edition, version, build and language.
    On OS with WMF 5.1 the following command can help get this information.

OsName               : Microsoft Windows 10 Pro
OsOperatingSystemSKU : 48
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage           : en-US
OsMuiLanguages       : {en-US, de-DE}

-->

#### Version of the DSC module that was used ('dev' if using current dev branch)
1.22.216.1
@malauter
Copy link
Member

malauter commented Feb 28, 2022

I think this issue is caused by the different attribute names for AutoExpandingArchive in Get- and Set-OrganizationConfig. In the set cmdlet, the attribute is -AutoExpandingArchive, but in the get cmdlet the property is AutoExpandingArchiveEnabled.

This line in the Get-TargetResource function looks for the property AutoExpandingArchive in the return of Get-OrganizationConfig, which never exists. This is why AutoExpandingArchive is always false.

if ($null -eq $ConfigSettings.AutoExpandingArchive) { $results.AutoExpandingArchive = $false }

I will create a PR to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Exchange Online
Projects
None yet
2 participants