Question

I am using Windows Server 2008 R2.

I'm trying to use Powershell to create a new Remote App that points to an Excel workbook. The following script fails on the New-Item call:

PS C:> Import-Module RemoteDesktopServices

PS C:> cd RDS:

PS RDS:\RemoteApp> New-Item -Path RDS:\RemoteApp\RemoteAppPrograms -Name "ATM999" -Appli 9\ATM999_Cube.xlsx"

New-Item : An unknown error has occurred. At line:1 char:9 + New-Item <<<< -Path RDS:\RemoteApp\RemoteAppPrograms -Name "ATM999" -ApplicationPath ube.xlsx" + CategoryInfo : NotSpecified: (RDS:\RemoteApp\RemoteAppPrograms\ATM999:Stri + FullyQualifiedErrorId : UnknownError,Microsoft.PowerShell.Commands.NewItemCommand

As a test, I attempted to create a new item that points to an executable rather than an Excel workbook. That works. Is there a parameter or something that I'm missing that would let me create a Remote App against an Excel workbook?

Was it helpful?

Solution

Figured it out. Here's what I did:

Import-Module RemoteDesktopServices

cd RDS:

New-Item –Path RDS:\RemoteApp\RemoteAppPrograms –Name Workbook.xlsx –ApplicationPath "C:\Program Files\Microsoft Office\Office14\Excel.exe" –CommandLineSetting 2 -RequiredCommandLine "E:\ProcessingFolder\ClientName_Cube.xlsx"

This creates an entry that points to Excel but specifies the path to the workbook in the RequiredCommandLine parameter. The "2" setting for CommandLineSetting forces the Remote App to always use the supplied RequiredCommandLine parameter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top