about EnabledMode and Enabled property of PubRDSApp

Discussion in 'PowerShell API' started by alext7, Feb 6, 2025.

Tags:
  1. alext7

    alext7 Bit poster

    Messages:
    3
    I'm writing a powershell script to query the "enabled" status of each published application using command "Get-RASPubRDSApp |select-object name, enabled".

    If there is folder structure, the "enabled" status of icon may be incorrect.
    e.g. If I have a "FolderA" in which there are App1 and App2, in case we have disable App1 and App2 by disabling "FolderA" (it will inherit to App1 and App2), the command above will still return "Enabled=true". From "parallels remote application server console", they should be in "Disabled" status.
    How can I get the status of the application correctly?
     
  2. hansb8

    hansb8 Bit poster

    Messages:
    2
    I understand the issue. You're using PowerShell to get the 'enabled' status of published applications, but Get-RASPubRDSApp doesn't seem to account for folder-level disabling, incorrectly reporting apps as enabled even when their parent folder is disabled. It seems you need a way to traverse the folder structure and check the status of each parent folder to accurately determine the application's effective status. Since Get-RASPubRDSApp only returns the application's explicitly set status and not the inherited status from its parent folders, you'll need to find a way to get the folder hierarchy information, perhaps using a command like Get-RASPubRDSFolder, and then write logic to walk up the folder tree for each application, checking if any of the parent folders are disabled. If any parent folder is disabled, then the application is effectively disabled, regardless of its own Enabled property. It's a bit more complex than just checking the application's property directly, but necessary to get the correct status.
     

Share This Page