locked
UAG SP4 Export2Tspub.exe RRS feed

  • Question

  • Hi

    We have upgraded our UAG server to sp4 and are testing Export2Tspub in our RDS 2012 farm.

    This is the command and output we get when running it from an elevated PS on a RDSH 2012 server. No .tspub file is generated.

    PS C:\install> .\Export2Tspub.exe
    Initializing
    Reading RemoteApps configuration
    Executing PowerShell cmdlets...
    Converting entities
    Exception occurred Parameter cannot be null
    Failed to parse configuration
    Done!

    Please help anyone.

    -Robert

    Tuesday, December 17, 2013 1:49 PM

All replies

  • Hi Robert.

    Could you please give me your topology of RD Session hosts and RD Connection Broker.

    Try to run Export2Tspub.exe on the Connection Broker machine.

    Enable Verbose logging mode and post a log file.

    To Enable Verbose logging mode edit file Export2Tspub.exe.config and change the following string <add name="TraceLevel" value="Verbose" />

    Thursday, December 19, 2013 2:47 PM
  • Hi. We have two connection brokers (HA mode with MS SQL DB), one Web Access and 3-4 Session hosts. We have already tried to run the tool on both of the connection brokers, with the same result.

    We enabled Trace Log, which seems to complain about missing objects on D: drive (which doesn’t exist on the server).

    We have also tried to create a D: disk and run the Export2Tsbub.exe from d:

    Here is the output: 20.12.2013 08:42:17[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Program.cs]Main@13: Parse command line arguments Initializing 20.12.2013 08:42:17[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Args\ArgsProvider.cs]GetParamsFromCmdArgs@10: Enter method 20.12.2013 08:42:17[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Args\ArgsProvider.cs]SetDefaultParams@67: Enter method 20.12.2013 08:42:17[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Args\ArgsProvider.cs]SetDefaultFilePath@74: Enter method 20.12.2013 08:42:17[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Args\ArgsProvider.cs]SetDefaultFilePath@76: Output path:C:\Install 20.12.2013 08:42:17[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\Exporter.cs]ExportAppsConfiguration@13: Enter method 20.12.2013 08:42:17[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\Exporter.cs]ReadPsScript@64: Enter method 20.12.2013 08:42:17[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\ResourceFileReader.cs]ReadPsScriptFile@12: Enter method 20.12.2013 08:42:17[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\ResourceFileReader.cs]ReadFile@24: Enter method 20.12.2013 08:42:17[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\Exporter.cs]ExportAppsConfiguration@15: Going to execute PowerShell script. Reading RemoteApps configuration 20.12.2013 08:42:17[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\PsExcecuter.cs]ExecuteScript@12: Enter method 20.12.2013 08:42:17[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\PsExcecuter.cs]ExecuteScript@13: PS script: function Convert-EnumStringToNum { param ( $EnumVal ) if($EnumVal -eq $null){return 0} return ([int]$EnumVal) } import-module RemoteDesktop $resultObj = $null $brokers = Get-RDServer -Role RDS-CONNECTION-BROKER if($brokers -eq $null){return $resultObj} #create object that will be returned from the script. $resultObj = New-Object "System.Collections.Generic.List[PSObject]" foreach($broker in $brokers) { $collections = Get-RDSessionCollection -ConnectionBroker $broker.Server if($collections -eq $null){return $null} #create list of collections in result object $collectionListObj = New-Object "System.Collections.Generic.List[PSObject]" foreach($collection in $collections) { $collectionName = $collection.CollectionName $collectionAlias = $collection.CollectionAlias #get colleciton configuration propeties $collectionConfigClient = Get-RDSessionCollectionConfiguration -Client -CollectionName $collectionName #get collection user groups $collectionConfigUsers = Get-RDSessionCollectionConfiguration -UserGroup -CollectionName $collectionName #get CustomRDPSettings $customRdp = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\CentralPublishedResources\PublishedFarms\$collectionAlias\DeploymentSettings").CustomRDPSettings #get session host of the collection $sHost = Get-RDSessionHost -CollectionName $collectionName $apps = Get-RDRemoteApp -CollectionName $collectionName if ($apps -eq $null){return $null} $appListObj = New-Object "System.Collections.Generic.List[PSObject]" foreach($app in $apps) { $appName = $app.Alias $rdsSets = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\CentralPublishedResources\PublishedFarms\$collectionAlias\Applications\$appName").RDPFileContents #create PSObject wrapper for current app $appObject = New-Object "PSObject" -Property @{ Application = $app; CmdLineSetting = Convert-EnumStringToNum $app.CommandLineSetting RDPContents = $rdsSets; Name = "RemoteApp" } #add wrapped object to collection $appListObj.Add($appObject) } #create object for application collection $collectionObject = New-Object "PSObject" -Property @{ SessionCollection = $collection; Applications = $appListObj; SessionHost = $sHost; ClientConfig = $collectionConfigClient; RedirectionOptions = Convert-EnumStringToNum $collectionConfigClient.ClientDeviceRedirectionOptions UsersConfig = $collectionConfigUsers; CustomRdpSettings = $customRdp; Name = "ApplicationCollection" } $collectionListObj.Add($collectionObject) } #get deployment configuration $depConfig = Get-RDDeploymentGatewayConfiguration -ConnectionBroker $broker.Server #create PSObject wrapper for current session broker object and its items $brokerObj = New-Object PSObject -Property @{ SessionBroker = $broker; AppCollections = $collectionListObj; GatewayAuthMode = Convert-EnumStringToNum $depConfig.Gatewaymode LogonMethod = Convert-EnumStringToNum $depConfig.LogonMethod Name = "SessionBroker" } $resultObj.Add($brokerObj) } Write-Output $resultObj Executing PowerShell cmdlets... 20.12.2013 08:43:42[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\Exporter.cs]ExportAppsConfiguration@25: Going to convert result 20.12.2013 08:43:42[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]Convert@11: Enter method Converting entities 20.12.2013 08:43:42[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]ConvertGatewaySettings@135: Enter method 20.12.2013 08:43:42[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]CheckIsNull@156: Enter method 20.12.2013 08:43:42[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]CheckIsNull@159: Invalid object received Exception occurred Parameter cannot be null Failed to parse configuration Done!


    
    Friday, December 20, 2013 8:03 AM
  • Sorry. I don't have opportunity to check RD Connection Brokers in HA mode, i suppose it's a problem. You can check Export2Tspub on RD Connection Broker without HA mode to check if it is a problem. As you can see Export2Tspub it's just powershell script which is exporting published applications and save it in tspub format, you can try do it by yourself.
    Monday, December 23, 2013 9:07 AM
  • Has this been solved? We are facing the same issue.
    Tuesday, April 8, 2014 11:09 AM
  • Do you use RD Connection Brokers in HA mode? Do you have same trace log?
    Tuesday, April 8, 2014 11:56 AM
  • Hi,

    The broker is deployed as a single node. I have the same log as the one above.

    Last part:

    Write-Output $resultObj
    Executing PowerShell cmdlets...
    4/9/2014 10:45:55 AM[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\Exporter.cs]ExportAppsConfiguration@2
    5: Going to convert result
    4/9/2014 10:45:55 AM[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]Convert@11: Enter
     method
    Converting entities
    4/9/2014 10:45:55 AM[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]ConvertGatewaySet
    tings@135: Enter method
    4/9/2014 10:45:55 AM[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]CheckIsNull@156:
    Enter method
    4/9/2014 10:45:55 AM[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]CheckIsNull@159:
    Invalid object received
    Exception occurred Parameter cannot be null
    Failed to parse configuration
    Done!

    Wednesday, April 9, 2014 9:30 AM
  • Do you have more than one Session host in Collection? If yes, try to left only on one session host server in collection.
    Wednesday, April 9, 2014 10:12 AM
  • Hi Daftping,

    We found out it had to do with a collection that didn't contain any apps. We have four collections, and two of them didn't have any app published. That's why the Cannot be Null error appeared.

    However, after publishing an app in those collections, the script is now giving a different error. See:

    Write-Output $resultObj
    Executing PowerShell cmdlets...
    4/10/2014 1:03:02 PM[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\Exporter.cs]ExportAppsConfiguration@2
    5: Going to convert result
    4/10/2014 1:03:02 PM[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]Convert@11: Enter
     method
    Converting entities
    4/10/2014 1:03:02 PM[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]ConvertGatewaySet
    tings@135: Enter method
    4/10/2014 1:03:02 PM[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]CheckIsNull@156:
    Enter method
    4/10/2014 1:03:02 PM[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]ConvertDeployment
    Settings@146: Enter method
    4/10/2014 1:03:02 PM[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]CheckIsNull@156:
    Enter method
    Exception occurred 'System.Array' does not contain a definition for 'SessionHost'
    Failed to parse configuration
    Done!
    PS D:\>

    Any idea?

    Thursday, April 10, 2014 11:08 AM
  • This error "Exception occurred 'System.Array' does not contain a definition for 'SessionHost'" is definitely mean that you have more than one Session Host server in collection. As workaround you can remove Sessions Host server from collection and leave just one, export to tspub and add them again.
    Thursday, April 10, 2014 11:43 AM
  • Hello Daftping,

    I wonder how i can remove a server from a collection. I normally dont work with RDS.
    When i open Server Manager - Remote Desktop Services, i first got a screen saying alot of RDS servers were not in the pool, and i had to add them. So i added those servers, and now in Server Manager i see a topology of the RDS environment. When i click on Servers i get a screen with all RDS servers. So is this the place (Server Manager -> Remote Desktop Services -> Servers) where i should delete all RDS servers except for one? 

    When i go to Server Manager -> Remote Desktop Services -> Collections i see there are four collections. Every collection has two Session Host servers in it. So:

    Collection 1 -> Server A and Server B
    Collection 2 -> Server C and Server D
    Collection 3 -> Server E and Server F
    Collection 4 -> Server G and Server H

    Does this mean i have to remove one server from every collection? In what way does this impact the performance or users having connections to one of those?

    Also, how do i remove a Session Host server from a collection? Because when i right click one server, i get one option: Do not allow new connections.
    Should i do this with Poweshell perhaps? When i delete one server (for example Server A) from the Servers screen i loose the Topology again with the collections, and see a screen saying i need to add that server.

    Thanks!

    Thursday, April 10, 2014 7:39 PM
  • Hi All,

    Has someone been able to get this one working? I am trying to export tspub file using this utility and this is not working for me as well.

    Regards

    Shubham

    Saturday, May 10, 2014 9:43 PM
  • UAG Sp4 rollup1 is not released yet, it has a fix for this issue where TSPub export fails for HA config.

    If there is any urgency and cant wait for rollup release then please contact Microsoft support and request for hotfix.


    Faisal :>

    Tuesday, July 8, 2014 2:35 PM
  • Little bit late, but it was solved by removing one server from every collection (there can only be one server in a collection), and also by adding an application to a collection that didnt have applications assigned to it. It looked like an empty collection, and the tspub will fail also on that.
    Thursday, August 21, 2014 6:20 PM
  • So we're using Export2Tspub.exe version 1.0.0.0 dated 15/11/2013 and also end up with the dreaded:

    18/06/2015 10:09:37[d:\src\main\private\isa\iag\ExportToTsPub\Export2Tspub\Export\ToTspubConverter.cs]CheckIsNull@159: Invalid object received
    Exception occurred Parameter cannot be null
    Failed to parse configuration

    No HA on any part of our PoC

    Applications assigned to all Collections (5 collections in total) - apart from one collection acting as a Remote Desktop for users - bet it's this!

    Only one Host per collection.

    I shall remove the Remote Desktop Collection and rerun to confirm.

    Lea

     
    Thursday, June 18, 2015 9:21 AM
  • In fact I simply added an app and that resolved the error.  The app was removed after ExportTspub.exe was run returning to the Published Desktop.

    Interestingly a .tspub file is generated per collection.

    Thanks to the above posters for resolving this.

    Lea

     
    Thursday, June 18, 2015 10:32 AM