However, when I try this against Exchange Server 2019 CU 8 I get a shell but no commands work. If I try executing "whoami" the error I get is "The term 'whoami.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again". If I try checking if constrained language mode is enabled using "$ExecutionContext.SessionState.LanguageMode" I get the error "A variable that cannot be referenced in restricted language mode or a Data section is being referenced. Variables that can be referenced include the following: $PSCulture, $PSUICulture, $true, $false, $null.". This reply is strange since I have double checked if constrained language mode is enabled on the Exchange server and it is not.
Hi,
Thank you for your effort writing this POC!
However, when I try this against Exchange Server 2019 CU 8 I get a shell but no commands work. If I try executing "whoami" the error I get is "The term 'whoami.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again". If I try checking if constrained language mode is enabled using "$ExecutionContext.SessionState.LanguageMode" I get the error "A variable that cannot be referenced in restricted language mode or a Data section is being referenced. Variables that can be referenced include the following: $PSCulture, $PSUICulture, $true, $false, $null.". This reply is strange since I have double checked if constrained language mode is enabled on the Exchange server and it is not.
See the attached picture for more information.
Is there anything I can do to fix this?
Thanks!