dsccommunity / xRemoteDesktopSessionHost

This module contains DSC resources for the management and configuration of Microsoft Remote Desktop Session Host (RDSH).
MIT License
35 stars 47 forks source link

xRDRemoteApp: Property [ Verbose ] with value True does not match #69

Closed mjcarrabine closed 4 years ago

mjcarrabine commented 4 years ago

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

I am using the XRemoteDesktopSessionHost resource to deploy my Remote Desktop Session Host instance, and everything seems to be working correctly.

However, the xRDRemoteApp resources are running successfully, but then Test-DscConfiguration is showing them as InDesiredState: False due to what looks like an issue with the Verbose property.

Any thoughts?

I can reproduce this on 2 machines now.

Verbose logs showing the problem

Start-DscConfiguration -Wait -Verbose -UseExisting returns

VERBOSE: [DEV-RDS05]: LCM:  [ Start  Resource ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Test     ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Testing if RemoteApp is published.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Getting published RemoteApp program
Calculator, if one exists.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Property [ Alias ] with value win32calc does
 not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Property [ CollectionName ] with value
Collection 1 does not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Property [ DisplayName ] with value
Calculator does not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Property [ FilePath ] with value
C:\Windows\system32\win32calc.exe does not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Property [ Verbose ] with value True does
not match
VERBOSE: [DEV-RDS05]: LCM:  [ End    Test     ]  [[xRDRemoteApp]Win32Calc]  in 3.7260 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Set      ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Making updates to RemoteApp.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Fetching FTAs and Icon contents from
endpoint: DEV-RDS05.IRMDEV.IRM.COM
VERBOSE: [DEV-RDS05]: LCM:  [ End    Set      ]  [[xRDRemoteApp]Win32Calc]  in 10.1170 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Resource ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Resource ]  [[xRDRemoteApp]iexplore]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Test     ]  [[xRDRemoteApp]iexplore]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Testing if RemoteApp is published.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Getting published RemoteApp program Internet
Explorer, if one exists.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Property [ Alias ] with value iexplore does
not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Property [ CollectionName ] with value
Collection 1 does not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Property [ DisplayName ] with value Internet
Explorer does not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Property [ FilePath ] with value C:\Program
Files\Internet Explorer\iexplore.exe does not match
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Property [ Verbose ] with value True does not
 match
VERBOSE: [DEV-RDS05]: LCM:  [ End    Test     ]  [[xRDRemoteApp]iexplore]  in 4.7620 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Set      ]  [[xRDRemoteApp]iexplore]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Making updates to RemoteApp.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Fetching FTAs and Icon contents from
endpoint: DEV-RDS05.IRMDEV.IRM.COM
VERBOSE: [DEV-RDS05]: LCM:  [ End    Set      ]  [[xRDRemoteApp]iexplore]  in 11.9650 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Resource ]  [[xRDRemoteApp]iexplore]

Running Start-DscConfiguration -Wait -Verbose -UseExisting a second time returns

VERBOSE: [DEV-RDS05]: LCM:  [ Start  Resource ]  [[xRDSessionCollection]RDSessionCollection]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Test     ]  [[xRDSessionCollection]RDSessionCollection]
VERBOSE: [DEV-RDS05]:                            [[xRDSessionCollection]RDSessionCollection] Checking for existence of
RDSH collection.
VERBOSE: [DEV-RDS05]:                            [[xRDSessionCollection]RDSessionCollection] Getting information about
RDSH collection.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Test     ]  [[xRDSessionCollection]RDSessionCollection]  in 1.5150 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ Skip   Set      ]  [[xRDSessionCollection]RDSessionCollection]
VERBOSE: [DEV-RDS05]: LCM:  [ End    Resource ]  [[xRDSessionCollection]RDSessionCollection]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Resource ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Test     ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Testing if RemoteApp is published.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Getting published RemoteApp program
Calculator, if one exists.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Property [ Verbose ] with value True does
not match
VERBOSE: [DEV-RDS05]: LCM:  [ End    Test     ]  [[xRDRemoteApp]Win32Calc]  in 3.8600 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Set      ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]Win32Calc] Making updates to RemoteApp.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Set      ]  [[xRDRemoteApp]Win32Calc]  in 8.2350 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Resource ]  [[xRDRemoteApp]Win32Calc]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Resource ]  [[xRDRemoteApp]iexplore]
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Test     ]  [[xRDRemoteApp]iexplore]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Testing if RemoteApp is published.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Getting published RemoteApp program Internet
Explorer, if one exists.
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Property [ Verbose ] with value True does not
 match
VERBOSE: [DEV-RDS05]: LCM:  [ End    Test     ]  [[xRDRemoteApp]iexplore]  in 4.2250 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ Start  Set      ]  [[xRDRemoteApp]iexplore]
VERBOSE: [DEV-RDS05]:                            [[xRDRemoteApp]iexplore] Making updates to RemoteApp.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Set      ]  [[xRDRemoteApp]iexplore]  in 7.0790 seconds.
VERBOSE: [DEV-RDS05]: LCM:  [ End    Resource ]  [[xRDRemoteApp]iexplore]

Suggested solution to the issue

I don't have one at this time.

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

        xRDRemoteApp Win32Calc{
            CollectionName = "Collection 1"
            DisplayName = "Calculator"
            FilePath = "C:\Windows\system32\win32calc.exe"
            Alias = "win32calc"
            DependsOn = "[xRDSessionCollection]RDSessionCollection"
        }       
        xRDRemoteApp iexplore{
            CollectionName = "Collection 1"
            DisplayName = "Internet Explorer"
            FilePath = "C:\Program Files\Internet Explorer\iexplore.exe"
            Alias = "iexplore"
            DependsOn = "[xRDSessionCollection]RDSessionCollection"
        }

The operating system the target node is running

OsName               : Microsoft Windows Server 2019 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 1809
WindowsBuildLabEx    : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Version and build of PowerShell the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.17763.771
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.771
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version of the DSC module that was used ('dev' if using current dev branch)

1.9.0.0

danielboth commented 4 years ago

Hi @mjcarrabine, what happens if you just run Test-DscConfiguration -Detailed? (So without -Verbose?) Is that returning True?

mjcarrabine commented 4 years ago

FYI, I am using Azure Automation as the pull server if that makes a difference here.

Running Update-DscConfiguration returns Compliant in Azure once.

Then running Test-DscConfiguration returns InDesiredState = False

PS C:\windows\system32> Update-DscConfiguration

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command
--     ----            -------------   -----         -----------     --------             -------
9      Job9            Configuratio... Running       True            localhost            Update-DscConfiguration

PS C:\windows\system32> Test-DscConfiguration -Detailed

PSComputerName  ResourcesInDesiredState        ResourcesNotInDesiredState     InDesiredState
--------------  -----------------------        --------------------------     --------------
localhost       {[Group]AddToAdministrators... {[xRDRemoteApp]Win32Calc, [... False

PS C:\windows\system32> Test-DscConfiguration -Detailed | fl

InDesiredState             : False
ResourcesInDesiredState    : {[Group]AddToAdministrators, [File]ODBC, [Package]InstallODBC,
                             [WindowsFeature]RDS_RD_Server...}
ResourcesNotInDesiredState : {[xRDRemoteApp]Win32Calc, [xRDRemoteApp]iexplore}
ReturnValue                : 0
PSComputerName             : localhost

PS C:\windows\system32> (Test-DscConfiguration -Detailed).ResourcesNotInDesiredState | fl

ConfigurationName    : IRM_01_Config
DependsOn            : {[xRDSessionCollection]RDSessionCollection}
ModuleName           : xRemoteDesktopSessionHost
ModuleVersion        : 1.9.0.0
PsDscRunAsCredential :
ResourceId           : [xRDRemoteApp]Win32Calc
SourceInfo           : ::1832::3::xRDRemoteApp
DurationInSeconds    : 3.945
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : Win32Calc
RebootRequested      : False
ResourceName         : xRDRemoteApp
StartDate            : 12/17/2019 9:38:25 AM
StateChanged         : False
PSComputerName       : localhost

ConfigurationName    : IRM_01_Config
DependsOn            : {[xRDSessionCollection]RDSessionCollection}
ModuleName           : xRemoteDesktopSessionHost
ModuleVersion        : 1.9.0.0
PsDscRunAsCredential :
ResourceId           : [xRDRemoteApp]iexplore
SourceInfo           : ::1839::3::xRDRemoteApp
DurationInSeconds    : 3.88
Error                :
FinalState           :
InDesiredState       : False
InitialState         :
InstanceName         : iexplore
RebootRequested      : False
ResourceName         : xRDRemoteApp
StartDate            : 12/17/2019 9:38:29 AM
StateChanged         : False
PSComputerName       : localhost
danielboth commented 4 years ago

Hi @mjcarrabine, I was able to reproduce this issue and have created a PR to fix this issue.