SP 2013 - Use PowerShell to Deploy, Activate and Associate a SharePoint Designer Workflow

Hello Community!
I'm using SP 2013 Enterprise and I need to use PowerShell to deploy a reusable SharePoint Designer Workflow to the solution gallery, activate it, activate the workflow feature, and then associate the workflow to a list and or library.  Has anyone done
this before and if so please provide guidance and code examples.
Thanks!
Tom
Tom Molskow - Senior SharePoint Architect - Microsoft Community Contributor 2011 and 2012 Award -
Linked-In - SharePoint Gypsy

Hi Tom,
Below are the links might help, please check:
Lists the Windows PowerShell cmdlets that you can use to manage workflows in a SharePoint 2013 farm.
http://technet.microsoft.com/en-us/library/ee906558(v=office.15).aspx
Series of articles written by Sahil Malik about SharePoint 2013 workflow
http://www.codemag.com/Article/1301021
http://www.codemag.com/Article/1304021
SharePoint 2013: How to Schedule a PowerShell Script to Run Automatically
http://www.proactivespeaks.com/2013/07/30/sharepoint-2013-how-to-schedule-a-powershell-script-to-run-automatically/
Similar threads:
http://stackoverflow.com/questions/15045189/how-to-start-workflow-2013-from-powershell
http://sharepoint.stackexchange.com/questions/65555/deploying-workflow-wsp-as-sandbox-solution
http://sharepoint.stackexchange.com/questions/89312/launch-sharepoint-2013-workflow-w-javascript
Regards,
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected] .
Rebecca Tu
TechNet Community Support

Similar Messages

  • How to see/use Target Audience column in SharePoint Designer Workflow (SharePoint 2013 Online, Designer Workflow)

    Hello,
    I'm attempting to use use the Target Audiences field in a SPD 2013 workflow, in this case just attempting to log the value to history for testing purposes.  This is failing saying the column does not exist.
    I enabled Audience Targeting on the list then create a simple workflow to log the value to history when the item changes.
    I change an item and the workflow starts, but when it gets to any action looking at "Current Item:Target Audiences" it stops and says:
    HTTP BadRequest to <site url>/_api/web/lists(guid'XXXXXXXX')/Items(4)?%24select=ID%2CTarget_x0020_Audiences 
    The field or property 'Target_x0020_Audiences' does not exist. 
    But it does.  It is listed in the list setting and enabled for the content type.
    I ran the listed API through an API program and sure enough, Target Audience is not listed in the results object.
    I'm 99% sure I've enabled this and that the field is present and the workflow is valid.  I ran the same situation on two lists to ensure it wasn't a hiccup, same results.
    Is this a know issue?  I couldn't find anything obvious online saying you cannot see this field via workflow, most of what i found said this would work.
    Thanks an advance for any input.

    Thanks so much Lisa, for the clarification.
    I understand what you have explained, and have seen several similar explanations that have lead to my confusion.  Can you elaborate a bit, maybe for the sake of future information seekers?
    I understand that audiences can be defined using the rules operations in Central Admin, but it seems another standard function is to just directly assign existing SharePoint groups.  I think this is what you mean above, but this is also the point of
    my misunderstanding.
    In this particular setup I have only used existing SharePoint groups with no audiences defined in Central Admin.  List Item A has a target audience of SharePoint group X, just that simple of a setup.
    Assuming the above is valid, I would then like to see or alter the groups via SPD workflow.
    Based on the following posts, I was under the impression this may be possible (but obviously not fully clear and thus I posted this):
    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/5eb984ba-55a3-4da7-a904-c34b2fece84c/how-do-i-set-the-target-audience-using-sharepoint-designer-workflow
    http://www.sharepoint-tips.com/2011/01/setting-target-audiences-with-code.html
    (sorry about lack of links, my account must still require verification)
    So in SPD, I set a simple action such as "Log Current Item:Target Audience to history" (note the I am able to select target audience in SPD like any other field with no errors).  At this point I am assuming everything is valid as SPD is treating
    the field like any other string field.  When executed the error in the above post comes up.
    So to confirm your explanation, this is not supported?  Even though the field is available for selection by design, it is not capable of use and known to produce errors in all cases of its use?  The first post above is 100% wrong and you cannot
    use SPD to set/view the target audience field?  The second post is also wrong as it seems to present the fields as available for alteration using string concatenation?
     If in fact the field is present by design, but also impossible to use by design, is this potentially a bug as the field is not supposed to be available if it will always produce the error when used with no error in SPD during compile?
    Thank you again for the reply and I hope we might be able to provide a rock solid answer to this for future seekers. 

  • Copy ID from one library to list using sharepoint designer workflow 2013

    Hello,
    I am new In SharePoint Designer workflow.
    I want to copy ID [by default] from one SharePoint Library to SharePoint List by using SharePoint Designer workflow 2013.
    So Please provide me any solution on it.
    Thanks,
    Samadhan.

    Hi Bjorn,
    Please create a workflow based on SharePoint 2010 platform, there is OOB action "Copy List Item" which can copy attachment to another list.
    Then use "Update List Item" action to update fields value for the new item. In this action, we could use Item title to locate the newly created item. For your reference:
    However, we cannot make this workflow to start automatically. As workaround, we could use SharePoint Designer to create a Custom Action in the Source List and initiate the workflow. In my test, I created a Custom Action in the type of List Item Menu. Then
    the custom action would appear in the Item ellipsis dropdown menu:
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • When building a vacation leave holiday system using SharePoint Foundation 2010 and SharePoint Designer workflows how can I add half day functionality?

    Hi,
    I have built a vacation leave holiday system for SharePoint Foundation 2010 using SharePoint Designer workflows and Javascript. Everything works perfectly but I'm struggling to design a solution for users to specify half day requests that span over dates
    greater than 1 day, i.e. my half day solution works but only when the start and end date are the same. How would I change the user interface to allow users to choose which day they want the half day to be requested when the vacation leave holiday request is
    from, say,  6th - 10th Jan 2014?
    Thanks.

    Hi ,
    I have a test on my machine with a custom approval workflow and it can work normally .Here are the detailed steps :
    1.      
    Open the site in SharePoint Designer .Create a workflow to associate with the document library .Set the workflow to start when an item is created and when an item is changed
    .Also allow the workflow to start manually .
    2.      
    Choose ‘Collect Data from a user’ .
    3.      
    Click on the data and give a name to the Task created .
    4.      
    Define the custom form field name as ‘Approve ?’ .Set the information type as Choice .
    5.      
    Set the choices as ‘Approve’ and ’Reject’ .Display as Checkboxes .Uncheck the ‘Allow fill-in values’ and ‘Allow blank values’
    .Click finish to save .
    6.      
    Click on users and add the users who will approve the documents .
    7.      
    Keep the output to variable as collect .
    8.      
    Add a new step .Choose ‘If any value equals value ’ .Set the any value ‘Data source’ as  workflow variables and parameters .Set the ‘Field
    from source’ as Variable: collect .
    9.      
    Set the value behind ‘equals ’ as ‘Approve’ .
    10.  
    Add a new action ‘Update list item ’ .Set the item as current item .Add the field Approval status as Approved .
    11.  
    Add an Else-if branch to update the Approval status as Rejected .
    12.  
    Publish the workflow and test in your site .
    Thanks,
    Entan Ming

  • Convert word document in PDF,e pub,by using third party dll in Sharepoint designer workflow 2013?

    Hi,
    I want to convert word document to PDF,  EPub, by using third party (.dll).
    In SharePoint designer workflow in 2013.
    So that I have question, Can we Install third party (.dll) in SharePoint workflow Designer for conversion?
    Means I have created one simple application conversion of word to e Pub, PDF, Image by using (Spire.doc dll) in Visual Studio.
    So this same conversion I want to work in SharePoint designer workflows?
    So anybody has any solution then please provide me.
    Thanks,
    Samadhan

    it might be worth looking at these CodePlex steps, that plug directly into the Word Automation Services.
    http://sp2010wordautomation.codeplex.com/
    It'll provide you with a configurable step like the below that should help you achieve your aims
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • How to get First Occurnece of SubString from any string using SharePoint Designer Workflow in SharePoint Online 2013(Office 365)

    Hello All,
    I am facing Problem in SharePoint Designer Workflow. The Problem is that while replacing some subtstring with Space from a string which contains item like {Test, Test, Test, Test}, It replaces all items.
    Below two line we are using in Workflow.
    Can any body suggest some soultion for Finding first ouucrence of ", " so that we can replace only first value from string not all. When String values are different then getting proper values but if String values are same with comma
    seperated then it replace all values.
    Please some body help and your help will be heighly appriciable.
    Thanks in Advance.
    Thanks,
    Vivek Kumar Pandey   

    Have you tried to use Regular Expressions instead of Replace?
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Does a new customer buying creative cloud include download and use of Photoshop, Fireworks, Bridge and Acrobat for one designer/individual?

    Does a new customer buying creative cloud include download and use of Photoshop, Fireworks, Bridge and Acrobat for one designer/individual?

    Cloud Plans https://creative.adobe.com/plans
    -and subscription terms http://www.adobe.com/misc/subscription_terms.html
    -what is in the entire Cloud http://www.adobe.com/creativecloud/catalog/desktop.html
    -http://www.adobe.com/products/catalog/mobile._sl_id-contentfilter_sl_catalog_sl_mobiledevi ces.html

  • SharePoint Designer Workflow 2013 Issue

    Hi All,
    We have an issue with the SharePoint designer workflow with the below error message.
    "Something went wrong. To Try again, reload the page and then start the workflow"
    suggest...
    Arun Prakash

    Hi,
    According to your description, my understanding is that you got an error when you create a SharePoint Designer workflow.
    Please do an IISRESET.
    Whether the issue occurs at another site or site collection, do a test in another site or site collection, compare the results.
    If the results is same,  please uninstall Workflow Mananger from all servers, then reinstall it .
    Note : If you are on a multi-server environment, make sure you have installed Workflow Manager client on all of your farm servers.
    Here are some useful posts for you to take a look at:
    http://social.msdn.microsoft.com/forums/en-us/ad882c89-22db-4d6c-8f60-5761c5f0b0a8/problem-with-sharepoint-2013-workflows
    http://lennytech.wordpress.com/2013/06/02/configuring-sharepoint-2013-to-use-workflow-manager-1-0/
    if this issue still exists, please check the log file to find more information about this issue.
    Best regards,
    Lisa Chen

  • How to send emails to Multiple Users from a Single People Picker lookup field using Sharepoint designer workflow

    Hi All,
    I am working with SharePoint 2013 designer workflow. we are using office 365.
    Our requirement to send email to multiple users, get the user groups from lookup list people and groups column.
    But SP designer sending emails to the first user alone.
    Please guide me to proceed.
    Advance Thanks.
    Regards
    Jenkins NS
    Thanks and Regards Jenkins

    finally I got a solution
     Identified a workaround to solve the issue using SharePoint designer.
    Step 1
    Create a lookup list Example department
    Columns
    Title (by default) – Single line of text
    Users – Person or Group
    Emails – Multiple lines of text
    hidden the Emails column (go to content type and set the column as hidden)
    Create a SharePoint designer Workflow
    Start Workflow automatically when an item is created
    Also Start Workflow automatically when an item is changed
    Workflow Stage 1
    Set Emails to current Item: Users
    The workflow will get all users email ids and add in the Emails column delimiter as semicolon.
    Step 2
    Create a custom list to get the email ids and send email
    Create a lookup column ex: analysis and refer department list, Allow multiple values
    Then Create a SharePoint designer workflow
    full details workflow steps please follow below
    URL
    http://jenkinsblogs.com/2015/04/30/how-to-send-emails-to-multiple-users-from-lookup-list-people-picker-field-using-sharepoint-designer-workflow/
    Thanks and Regards Jenkins

  • SharePoint Designer Workflow - Unable to use ProjectUID in Emails

    Hello Everyone,
    I have a SharePoint Designer workflow running smoothly. The client now has a requirement where every email should link to the project's PDP page.
    I can do this by stitching a URL together like this:
    But when my workflow gets to this email, it fails with a status of Suspended (and the error below).
    RequestorId: 8df1cbcb-fc04-dc9f-0000-000000000000. Details: RequestorId: 8df1cbcb-fc04-dc9f-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 403
    {"error":{"code":"35120, Microsoft.ProjectServer.PJClientCallableException","message":{"lang":"en-US","value":"WorkflowActivityInvalidArgument"}}} {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPClientServiceRequestDuration":["276"],"SPRequestGuid":["8df1cbcb-fc04-dc9f-b9ff-b373c077c4f0"],"request-id":["8df1cbcb-fc04-dc9f-b9ff-b373c077c4f0"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4517"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1;
    RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Tue, 11 Feb 2014 20:48:48 GMT"],"Server":["Microsoft-IIS\/7.5"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]}  
    at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context)   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)  
    at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
    I have even tried sending an email with nothing but the ProjectUID and it still fails with this message, so I know that this variable is the issue.
    I have this issue on multiple environments and multiple servers, I cannot believe I couldn't find anyone else having this issue while researching.
    Does anyone have any clue as to what is happening? Isn't this happening for you as well?
    120811049008

    Hello Paul,
    This seems to be a bug and supposed to be fix in December 2013 CU. Please review the below thread
    http://social.technet.microsoft.com/Forums/ie/en-US/71829125-09de-4094-9a0d-d9740aa73348/error-workflow-project-server-2013
    Hope this helps.
    Thank you,
    Kiran K.

  • Migrate the SharePoint 2007 Site containing SharePoint Designer Workflows with Infopath forms to SharePoint 2013

    Hi,
    We have a requirement to migrate the SharePoint 2007 Site containing  SharePoint Designer Workflows with Info path forms to SharePoint 2013.
    Can somebody please guide us as to what could be the best approach to go ahead?
    Thanks in advance.
    Regards,
    Vijay

    Use STSADM
    backup and
    restore to migrate SharePoint 2007 site
    containing  SharePoint Designer Workflows with Info path forms to SharePoint 2013. 

  • SharePoint Designer Workflow 'Failed on Start', SP Logs has WorkflowValidationFailedException, works ok when recycle IIS App Pool and restart

    Hi there, 
    I know there are a lot of posts about "Failed to Start" errors, but I have yet to see one that describes our problem.
    We have workflows built with SharePoint Designer 2007
    Normally these workflows start ok and work completely
    Occasionally though they will all fail to start, instead showing "Failed on Start (retrying)" in the Workflow Status and the following exception in the SP Logs:
    01/16/2015 15:43:27.28 w3wp.exe (0x15D4) 0x1A00 Windows SharePoint Services Workflow Infrastructure 936l High Engine RunWorkflow: System.Workflow.ComponentModel.Compiler.WorkflowValidationFailedException: The workflow failed validation. at System.Workflow.Runtime.WorkflowDefinitionDispenser.ValidateDefinition(Activity root, Boolean isNewType, ITypeProvider typeProvider) at System.Workflow.Runtime.WorkflowDefinitionDispenser.LoadRootActivity(Type workflowType, Boolean createDefinition, Boolean initForRuntime) at System.Workflow.Runtime.WorkflowDefinitionDispenser.GetRootActivity(Type workflowType, Boolean createNew, Boolean initForRuntime) at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance) at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext con...
    01/16/2015 15:43:27.28* w3wp.exe (0x15D4) 0x1A00 Windows SharePoint Services Workflow Infrastructure 936l High ...text, WorkflowInstance workflowInstance) at System.Workflow.Runtime.WorkflowRuntime.GetWorkflowExecutor(Guid instanceId, CreationContext context) at System.Workflow.Runtime.WorkflowRuntime.InternalCreateWorkflow(CreationContext context, Guid instanceId) at System.Workflow.Runtime.WorkflowRuntime.CreateWorkflow(Type workflowType, Dictionary`2 namedArgumentValues, Guid instanceId) at Microsoft.SharePoint.Workflow.SPWinOeHostServices.Send(SPWinOeWorkflow winoeworkflow, SPWorkflowEvent e) at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)
    What is strange, is that if I recycle the App Pool for the SharePoint site and then restart the workflows, they all work fine for a time. Until the next time they don't =) 
    The workflows must be configured ok since they do work complete at time, but I wonder if there is something with the memory usage of the app pool or something that is being re-compiled when the App Pool is recycled
    The App Pool is set to recycle nightly, and when virtual memory > 1700MB or memory > 1000MB
    Is anyone able to shed any light on this problem?? Or what steps I can take to debug the problem further.
    Thanks in advance
    Miguel Clark =)

    Hi Sudip,
    Thanks for the link.
    The workflows in question are SharePoint Designer workflows using standard actions, so unsure exactly how to check the 'correlation tokens' and 'DLLs', plus the workflow works fine as soon as I recycle the IIS App Pool, so do not see how these could be the
    problem
    As to the 'lodctr' commands, we have tried  these in the past, to no effect. Though may try them again next time the issue comes up just to see if it does the same thing as recycling the app pool.
    My big question here is "why would it suddenly work after recycling the app pool??" I feel like it must be something memory related, since recycling the app pool releases the resources used by the IIS worker process.
    Miguel =) 

  • SharePoint Designer workflow - date display and number ;# signs.

    Hi,
    I have created a SharePoint Designer workflow with customized email messages sent to specified people.
    I've got tow questions:
    1) In the email message there are lookups for date.The date is displayed in mm/dd/yyyy format and I would like to change it into dd/mm/yyyy. Is that possible?
    2) In the email messages there are lookups for a value from a list. the values are displayed with a number ; and # signs. For example 1;#PortfolioA  2;#Portfolio2. How can I eliminate the number,; and # signs and have the portfolio displayed only as
    'PortfolioA"?
    I will be grateful for any suggestion.
    Thank you.
    Jowita

    Hi Jowita,
    For the Date&Time column, you can create an additional column using Calculated type, and set the formula is: =TEXT([Date],"dd/mm/yyyy"), then when you design the email body in workflow, you can use the calculated column instead of the
    original date column.
    For the Lookup column, when you add it into the email body, you can set it returns field as “Lookup Value(as Text)”, like the screenshot:
    Thanks,
    Wendy
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Edit webpart properties using sharepoint designer workflow

    Hi Guys,
    I am not sure if there is any way to Edit properties of Excel Web Access WebPart using SharePoint Designer Workflow. I want to change workbook source of a web part on specific date.
    I don't have environment to write custom code.
    Thanks, Nilesh

    Hi,
    Per my knowledge, we can't achieve your requirement using SharePoint Designer Workflow.
    We have to use custom code to achieve it. The following articles for your reference:
    How to: Work with Web Parts on a Page Using JavaScript
    http://msdn.microsoft.com/en-us/library/office/hh185010(v=office.14).aspx
    Programmatically Update the SharePoint Web Part Properties on the List Forms
    http://nikpatel.net/2010/11/04/programmatically-update-the-sharepoint-web-part-properties-on-site-pages/
    ExcelWebRenderer class
    http://msdn.microsoft.com/en-us/library/microsoft.office.excel.webui.excelwebrenderer(v=office.15).aspx
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Using powershell to deploy provider-hosted app and specify remote Url instead of using appinv.aspx page

    Hello all,
    Could you possibly help me with provider-hosted app development/deployment process.
    We developed SharePoint provider-hosted app that works just fine in development environment. Now we need to automate it's installation in test environment via powershell.
    In AppManifest.xml that we are deploying we have key instead of explicit URL:
    <App xmlns="http://schemas.microsoft.com/sharepoint/2012/app/manifest" Name="ShowAllRoomsApp" ProductID="{922a18aa-5592-b59a-4da9-4791baef02e7}" Version="1.0.0.0"
    SharePointMinVersion="15.0.0.0">
      <Properties>
        <Title>SomeTitle</Title>
        <StartPage>~remoteAppUrl/Pages/Default.aspx?{StandardTokens}</StartPage>
    If we use as
    https://technet.microsoft.com/en-us/library/jj655398.aspx recommends, we cannot specify Redirect Url as we can do this on
    /_layouts/appinv.aspx
    So now it seems like the only way to deploy this kind of solution is using appinv.aspx page.Or must we apply this URL in AppManifest on developing stage in Visual Studio?
    What did I miss?
    P. S. Even if I use /_layouts/appinv.aspx after powershell commandlets, I get error.

    hi,
    to deploy provider hosted app you need 2 things
    1. Client ID
    2. Redirect URL.
    What you can do you can generate app from visual studio using clientID and URL from developer enviornment.
    Now a app file is just a simple compressed zip file if you rename it as .zip and extract you will find AppManifest
    inside it. So to create an app for Testing enviornment what you have to to Get the CLient ID (from AppRegNew.aspx) in testing enviornment. Unzip .App file change the AppManifest with testing client ID and URL than again zip file and rename as .app.
    Now if you upload this file it will work.
    To automate this scenerio i have created a simple windows Application in which i Pass the Client ID and StartURl and an App File it unzips the app file make changes to app and again zip it.
    public static class AppPackageHelper
    public const string StartUrlExpression = "{0}?{1}";
    public const string StandardToken = "{StandardTokens}";
    public static string Publish(string appPath, string ClientId,string StartUrl)
    string tempDir = string.Empty;
    string outPutFile = string.Empty;
    try
    string parentDir = System.IO.Path.GetDirectoryName(appPath);
    outPutFile = System.IO.Path.Combine(parentDir, ClientId + "-Winshuttle.app");
    tempDir = System.IO.Path.Combine(parentDir, ClientId.ToString());
    Directory.CreateDirectory(tempDir);
    int lastInd = appPath.LastIndexOf('.');
    string tempPath = string.Empty;
    string targetFilePath = string.Empty;
    string cabPath = System.IO.Path.Combine(tempDir, System.IO.Path.GetFileNameWithoutExtension(appPath) + ".cab");
    FileInfo fInfo = new FileInfo(appPath) { IsReadOnly = false };
    File.Copy(appPath, cabPath);
    XDocument doc = null;
    string appManifest = string.Empty;
    using (ZipArchive zipArch = ZipFile.Open(cabPath, ZipArchiveMode.Update))
    appManifest = string.Format(@"{0}\AppManifest.xml", Directory.GetParent(cabPath).FullName);
    ZipArchiveEntry manifestEntry = zipArch.Entries.LastOrDefault(e => e.Name.ToLower() == "appmanifest.xml");
    manifestEntry.ExtractToFile(appManifest);
    doc = XDocument.Load(appManifest);
    XNamespace ns = doc.Root.GetDefaultNamespace();
    string defaultUrl = string.Format(StartUrlExpression, StartUrl.TrimEnd('/'), StandardToken);
    doc.Descendants(XName.Get("StartPage", ns.NamespaceName)).First().Value = defaultUrl;
    doc.Descendants(XName.Get("RemoteWebApplication", ns.NamespaceName)).First().Attribute(XName.Get("ClientId")).Value = setupInfo.ClientId.ToString();
    doc.Save(appManifest);
    if (manifestEntry != null)
    manifestEntry.Delete();
    zipArch.CreateEntryFromFile(appManifest, "AppManifest.xml");
    int totEnt = zipArch.Entries.Count;
    for (int e = 0; e < totEnt; e++)
    if (zipArch.Entries[e].Open().Length == 0)
    //if (zipArch.Entries.Count > totEnt && e >= totEnt) break;
    //zipArch.CreateEntry(zipArch.Entries[e].FullName);
    File.Delete(appManifest);
    if (File.Exists(outPutFile))
    File.Delete(outPutFile);
    File.Move(cabPath, outPutFile);
    return outPutFile;
    catch
    throw;
    finally
    if (System.IO.Directory.Exists(tempDir))
    System.IO.Directory.Delete(tempDir, true);
    return outPutFile;
    using System.IO.Compression.FileSystem.dll.
    Also if you want to do it using powershell You need to do the same thing unzip-> changes values-> zip
    So basic thing is You need to ahve only valid AppManifest file which contains 2 valid values Client Id and StartUrl
    if you changes it inside appmanifest manuall than it will also work. Using above code you can create a console Application to do it. You can use powershell it just that i dont know how to zip unzip in powershell but i am pretty sure you can easily find it
    on searching.
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

Maybe you are looking for

  • Help me choose a technology please ??

    Hi, I am a MSc (Software Development) student from University of Huddersfield, UK. I have to submit a final year project proposal by the end of July. My real client is a pharmaceutical company with many offices in many cities. They maintain a central

  • Please help with update for ios 8.1.3

    Some one PLEASE HELP ME!!!  I just updated my I phone 4s to ios 8.1.3 it was taking a long time then they finally updated and had the Hello screen after that I saw my photos then they would just delete it right in front of me I also lost some of my c

  • Photos not importing from Canon camera.

    I plug my Canon camera into my iMac and iPhoto asks if I want to import and as long as the camera is connected, it shows the pics were imported.  However, when I disconnect the camera, the photos do not show up.  My iMac is only a few weeks old and I

  • How to download dynamic table data into CSV format

    Hi, I have data in dynamic table <it_data>, and I want to download that into CSV format. so I tried to use FM SAP_CONVERT_TO_CSV_FORMAT but how to use this FM with dynamic table? here <it_data> type standard table, we can pass this to I_TAB_SAP_DATA.

  • EBS Performance  Check

    Hi, The database I am currently working on is about 400Gb. There is lot of load during month end period and even more during financial year end. On a regular basis,if we confront performance issues , we find more CPU and I/O consuming sessions and ac