Solved

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

Posted on 2014-03-07
8
554 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 68

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 68

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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 68

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The article will show you how you can maintain a simple logfile of all Startup and Shutdown events on Windows servers and desktops with PowerShell. The script can be easily adapted into doing more like gracefully silencing/updating your monitoring s…
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now