Solved

Can't create Remote App via Powershell that points to an Excel workbook

Posted on 2014-03-07
8
557 Views
Last Modified: 2014-03-14
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?
0
Comment
Question by:ryanmaves
  • 4
  • 3
8 Comments
 
LVL 69

Expert Comment

by:Qlemo
ID: 39915081
Why not providing the path to Excel as Remote App?
0
 

Author Comment

by:ryanmaves
ID: 39918046
Because we need the user to open a specific workbook when they launch the Remote App RDP file.  It contains database connection information that is specific to the user.
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 39918137
Of course you want to open a specifc workbook. But the correct command to do so is e.g.
"c:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE" 9\ATM999_Cube.xlsx

Open in new window

0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

Author Comment

by:ryanmaves
ID: 39921235
I understand how to invoke Excel while having it open a specific workbook if I were to do it via the command line but this doesn't answer how to do it within a Powershell's New-Item command.
0
 
LVL 69

Accepted Solution

by:
Qlemo earned 500 total points
ID: 39921303
The error message of New-Item is specific to the item you want to create - here it is a Remote App entry. I'm convinced it isn't related to New-Item itself.
So use the path to Excel as ApplicationPath, and provide the XLSX as additional parameters (how ever you can do that - don't know and cant't test the RDS provider, sorry).
0
 

Author Comment

by:ryanmaves
ID: 39930512
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.
0
 

Author Closing Comment

by:ryanmaves
ID: 39930516
Pointed me in the right direction.  Thank you.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question