Solved

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

Posted on 2014-03-07
8
569 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 70

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 70

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
Ready to trade in that old firewall?

Whether you need to trade-up to a shiny new Firebox or just ready to upgrade from whatever appliance you're using now, WatchGuard has the right appliance for you! Find your perfect Firebox today with appliance sizing tool!

 

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 70

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

What, When and Where - Security Threats from Q1

Join Corey Nachreiner, CTO, and Marc Laliberte, Information Security Threat Analyst, on July 26th as they explore their key findings from the first quarter of 2017.

Question has a verified solution.

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

A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

635 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