microsoft / Microsoft365DSC

Manages, configures, extracts and monitors Microsoft 365 tenant configurations
https://aka.ms/M365DSC
MIT License
1.61k stars 501 forks source link

TeamsMessagingPolicy not in the desired state for the attribute 'Allow Giphy' #1892

Closed atdheekurteshi closed 2 years ago

atdheekurteshi commented 2 years ago

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

TeamsMessagingPolicy not in the desired state for the attribute 'Allow Giphy'

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

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.413.1
PsDscRunAsCredential :
ResourceId           : [TeamsMessagingPolicy]Container-100-703b1917-558f-4497-99dd-1b32a7d5993a
SourceInfo           : ::10::3::TeamsMessagingPolicy
DurationInSeconds    : 16.173
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Container-100-703b1917-558f-4497-99dd-1b32a7d5993a
RebootRequested      : False
ResourceName         : TeamsMessagingPolicy
StartDate            : 4/19/2022 2:15:20 PM
StateChanged         : False
PSComputerName       : localhost

outputs the TeamsMessagingPolicy not in desired state although for the Attribute AllowGiphy The DSC configuration that is used to reproduce the issue (as detailed as possible)

MOF file extract:

/*
@TargetNode='localhost'
@GeneratedBy=x
@GenerationDate=04/19/2022 14:04:55
@GenerationHost=x
*/

instance of MSFT_Credential as $MSFT_Credential1ref
{
Password = "x"
 UserName = "x";

};

instance of MSFT_TeamsMessagingPolicy as $MSFT_TeamsMessagingPolicy1ref
{
ResourceID = "[TeamsMessagingPolicy]Container-100-703b1917-558f-4497-99dd-1b32a7d5993a";
 AllowGiphy = False;
 Credential = $MSFT_Credential1ref;
 Ensure = "Present";
 SourceInfo = "::10::3::TeamsMessagingPolicy";
 Identity = "Global";
 ModuleName = "Microsoft365DSC";
 ModuleVersion = "1.22.413.1";

 ConfigurationName = "MainConfig";

};
instance of OMI_ConfigurationDocument

                    {
 Version="2.0.0";

                        MinimumCompatibleVersion = "1.0.0";

                        CompatibleVersionAdditionalProperties= {"Omi_BaseResource:ConfigurationName"};

                        Author="x";

                        GenerationDate="04/19/2022 14:04:55";

                        GenerationHost="x";

                        ContentType="PasswordEncrypted";

                        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.413.1

In PowerShell is working

PS C:\Windows\system32> Set-CsTeamsMessagingPolicy -Identity Global -AllowGiphy $false
PS C:\Windows\system32> Get-CsTeamsMessagingPolicy -Identity Global  | select AllowGiphy

AllowGiphy
----------
     False

PS C:\Windows\system32>
malauter commented 2 years ago

I followed the steps you described, but I cannot reproduce the issue on my machine with 1.22.420.1 and updated dependencies. Can you please check if the issue persists with current DSC version and dependencies?

Install-Module Microsoft365DSC -Force Update-M365DSCDependencies Uninstall-M365DSCOutdatedDependencies

atdheekurteshi commented 2 years ago

I have followed the steps once again but I get the same status:

Powershell results:

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

ConfigurationName    : MainConfig
DependsOn            :
ModuleName           : Microsoft365DSC
ModuleVersion        : 1.22.420.1
PsDscRunAsCredential :
ResourceId           : [TeamsMessagingPolicy]Container-100-c72d8b32-c609-4bb9-adb0-c3033cfa4261
SourceInfo           : ::10::3::TeamsMessagingPolicy
DurationInSeconds    : 2.438
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Container-100-c72d8b32-c609-4bb9-adb0-c3033cfa4261
RebootRequested      : False
ResourceName         : TeamsMessagingPolicy
StartDate            : 4/22/2022 11:52:24 AM
StateChanged         : False
PSComputerName       : localhost

outputs the TeamsMessagingPolicy not in desired state although for the Attribute AllowGiphy The DSC configuration that is used to reproduce the issue (as detailed as possible)

MOF file extract:

/*
@TargetNode='localhost'
@GeneratedBy=x
@GenerationDate=04/19/2022 14:04:55
@GenerationHost=x
*/

instance of MSFT_Credential as $MSFT_Credential1ref
{
Password = "x"
 UserName = "x";

};

instance of MSFT_TeamsMessagingPolicy as $MSFT_TeamsMessagingPolicy1ref
{
ResourceID = "[TeamsMessagingPolicy]Container-100-703b1917-558f-4497-99dd-1b32a7d5993a";
 AllowGiphy = True;
 Credential = $MSFT_Credential1ref;
 Ensure = "Present";
 SourceInfo = "::10::3::TeamsMessagingPolicy";
 Identity = "Global";
 ModuleName = "Microsoft365DSC";
 ModuleVersion = "1.22.420.1";

 ConfigurationName = "MainConfig";

};
instance of OMI_ConfigurationDocument

                    {
 Version="2.0.0";

                        MinimumCompatibleVersion = "1.0.0";

                        CompatibleVersionAdditionalProperties= {"Omi_BaseResource:ConfigurationName"};

                        Author="x";

                        GenerationDate="04/19/2022 14:04:55";

                        GenerationHost="x";

                        ContentType="PasswordEncrypted";

                        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.420.1
atdheekurteshi commented 2 years ago

It was solved in version: 1.22.420.1, Released (20.04.2022)