Error while adding the app in the sharepoint(2013) page through powershell script

Hi,
    I have created one powershell script to uninstall and install the sharepoint 2013 apps. The code is working fine, but after adding the app in the page I am getting the error "
Internet Explorer can not display the webpage".
If I am deploying the app through Visual Studio, its getting deployed successfully and I am getting an option to trust the app.And I am able to add it in the page. But this permission is not coming when I am installing the app using power shell.
Please let me know whether to do any modifications to the power shell script.
Thanks.
Pradeep

Hi,
   We are using sharepoint hosted app.
Below is the script to uninstall and install the app.
cls
Add-PSSnapin Microsoft.SharePoint.PowerShell –ea SilentlyContinue
# uninstall the app
Write-Host "uninstallation of app"
$InstalledSPApps = Get-SPAppInstance -Web "http://mySharepointSite.xyz.com"
$appToUninstall = $InstalledSPApps | where {$_.Title -eq 'myCustomSharepointApp'}
if ($appToUninstall -ne $null)
    Uninstall-SPAppInstance -Identity $appToUninstall ;
    Write-Host "uninstalled successfully"
# Import-SPAppPackage
Write-Host "Import the app"
pause
$sourceApp = ([microsoft.sharepoint.administration.spappsource]::RemoteObjectModel);
$myspapp = Import-SPAppPackage -Path "D:\SharePoint 2013\AppsSolution\myCustomSharepointApp.app" -Site "http://mySharepointSite.xyz.com" -Source $sourceApp ;
Write-Host "Enter to install the app"
pause
$app = Install-SPApp -Web "http://mySharepointSite.xyz.com" -Identity $myspapp;
$AppName = $app.Title;
Write-Host "app '$AppName' registered"
pause
$appInstance = Get-SPAppInstance -Web "http://mySharepointSite.xyz.com" | where-object {$_.Title -eq $AppName};
$counter = 1;
$maximum = 150;
$sleeptime = 2;
Write-Host -ForegroundColor White "Please wait..." -NoNewline;
pause
while (($appInstance.Status -eq ([Microsoft.SharePoint.Administration.SPAppInstanceStatus]::Installing)) -and ($counter -lt $maximum))
    Write-Host "." -NoNewline;
    sleep $sleeptime;
    $counter++;
    $appInstance = Get-SPAppInstance -Web "http://mySharepointSite.xyz.com" | where-object {$_.Title -eq $AppName}
pause
if ($appInstance.Status -eq [Microsoft.SharePoint.Administration.SPAppInstanceStatus]::Installed)
    Write-Host "The App was successfully installed.";
    $appUrl = $appInstance.AppWebFullUrl;
    Write-Host -ForegroundColor White "The App is available at '$appUrl'.";

Similar Messages

  • 404 error while adding custom webpart to the page

    I have my solution working in development environment. I deployed the wsp in prod env. While adding one specific webpart to the page leads to 404 error page.
    Thanks in advance.

    Hi,
    boreal123's reply makes sense.
    I would say that somewhere in your specific method call a web service, but it cannot find. You can check the related code snippet.
    I suggest that you can try to store the url in a webpart property so that it can be modified easily.
    Best Regards
    Guangchao chen
    TechNet Community Support

  • Error while adding a attribute to the the Custom view through a wizard

    Hi ,
    I have created a new custom view with value node through wizard  succesfully.
    Now I want to add a new attribute to that node.I am trying to do that by a wizard.
    But i am getting the follwing error " Error during analysis of Source Code" although i have
    commented or removed my all custom code from that view.
    I tried adding the new aattributes in the metthods "IF_BSP_MODEL~INIT " and
    "GET_TABLE_LINE_SAMPLE " manually but that also does not worked.
    Plz help me with this asap.
    Regards,
    Sharad

    Hi Sharad,
                          I hope all your classes are active. In case you want to add a new attribute there are two steps.
    1.Right click on context node and create attribute, it opens a wizard and continue. This will add the field in the context node and generate the getter-setter methods.
    2. In the above two method whcih you mentioned add the new field in the structure of value node. And then create your own getter-setter methods. and activate it. After this you will be able to see the attribute added in the context node.
    By using any of the two approaches you will be able to see teh new field in the configuration.
    Hope this helps.
    Regards,
    Ruby.

  • Getting an error while adding a user to the directory server

    Hi !
    I am getting an "initOrgAuthLevel iPlanetAMAuthepdAuthService, Service does not exist" error while trying to add a user or a new role to the user through identity server.
    Can anybody explain me why?.

    It appears to me you are missing some services in AM check the AM startup logs.. you should not see any exceptions. If so, you may have to reinstall the AM.

  • Itunes 7.0.2.16 closes without error while adding a folder to the libary

    Hi,
    my itunes (latest german version) closes without any warning while adding a folder to my libary. What is wrong?
    Torsion75

    This is a known issue.
    To get around this I created a folder that I put songs into when I want to import more than 1. Then I have iTunes import the songs. Then I empty the import folder to get ready for next time.

  • Error while adding new field in the Segment type thru WE31.

    Hi All,
    I want to  add one field in the Z segment type using WE31.But i am getting the error message as
    'Current segment definition <segment name> can no longer be changed and The current segment definition
    is already released.You can either add a new segment definition or cancel the release of the current segment definition'.
    The current segment defenition which i am trying to change got the SAP release of 45B. But the system has upgraded to Ecc6 recently.
    I tried going to the edit menu and cancel the release, but still it is not allowing.
    Whats the impact of the Add button(Add version) and creating a new version?.will it create a new version for ECC6?.
    Points will be rewarded
    regards,
    neslin.

    Hi
    You can create a new version.  This will not create any problems.  You might not be able to cancel the release because of upgrade.
    Thanks
    Vijay

  • Javascript gives an error while added externally or within the script tag

    I have included a Javascript that will return the id of the current element that I am accessing , i am using this script along with the jsf tags.
    The code looks like this :
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
    <html>
    <head>
    <script language="Javascript">
    function focus_id()
    alert(this.id);
    </script>
    </head>
    <f:subview id="task-tree">
    <t:div style="width:170px; height:500px; overflow:auto;">
    <t:tree2
       ... >
       <f:facet name="root-facet">
          <h:panelGroup>
             <t:graphicImage alt="#{msgs.openFolderAlt}" value="/images/dtree/folderopen.gif" rendered="#{t.nodeExpanded}" border="0"/>
             <t:graphicImage alt="#{msgs.folderAlt}"value="/images/dtree/folder.gif" rendered="#{!t.nodeExpanded}" border="0"/>
             <h:outputText value="#{node.description}" styleClass="nodeFolder"/>
          </h:panelGroup>
       </f:facet>
       <f:facet name="node-facet">
          <h:panelGroup>
             <t:graphicImage alt="#{msgs.openFolderAlt}" value="/images/dtree/folderopen.gif" rendered="#{t.nodeExpanded}" border="0"/>
             <t:graphicImage alt="#{msgs.folderAlt}" value="/images/dtree/folder.gif" rendered="#{!t.nodeExpanded}" border="0"/>
             <h:outputText value="#{node.description}" styleClass="nodeFolder"/>
          </h:panelGroup>
       </f:facet>
       <f:facet name="node-with-action-facet">
          <h:panelGroup>
             <t:graphicImage alt="#{msgs.openFolderAlt}" value="/images/dtree/folderopen.gif" rendered="#{t.nodeExpanded}" border="0"/>
             <t:graphicImage alt="#{msgs.folderAlt}" value="/images/dtree/folder.gif" rendered="#{!t.nodeExpanded}" border="0"/>
             <h:commandLink
                immediate="true"
                actionListener="#{t.setNodeSelected}"
                action="#{node.doAction}"
                styleClass="#{t.nodeSelected ? 'rowHighlighted' : 'document'}"
                onclick="focus_id();" >
                <h:outputText value="#{node.label}"/>
             </h:commandLink>
          </h:panelGroup>
       </f:facet>
       <f:facet name="leaf-facet">
          <h:panelGroup>
             <h:commandLink
                immediate="true"
                actionListener="#{t.setNodeSelected}"
                action="#{node.doAction}"
                styleClass="#{t.nodeSelected ? 'rowHighlighted' : 'document'}"
                onclick="focus_id();" >
                <h:outputText value="#{node.label}"/>
             </h:commandLink>
          </h:panelGroup>
       </f:facet>
    </t:tree2>
    </t:div>
    </f:subview>
    </html>This code works fine and returns the element id if included inline but not
    otherwise .... Any clues that you can give me as to why this happens will be great ...

    Problem was solved.
    It was some of illegial symbols at the beginning of xml.

  • Error while adding a WFE to a Sharepoint farm

    Hi,
    I am getting an error while trying to add a WFE to a sharepoint farm.
    Below is the script I am running in the WFE server
    Connect-SPConfigurationDatabase
    -DatabaseServer $DBServer -DatabaseName
    $DBName -Passphrase (ConvertTo-SecureString $PassPhrase
    -AsPlainText -Force
    Below is the error
    I had done a lot of other tests to check whether the connection between the WFE and sharepoint farm is valid or not. For eg:
    - Was able to create a configuration database in sharepoint farm from WFE server using New-SPConfigurationDatabase script. By this I was able to setup central admin in WFE.
    The only problem is I am not able to connect to an existing configuration database. Please help.

    Yes I tried adding in SQL alias and executed the sharepoint wizard, but I am still getting the same error.
    "Failed to connect to the configuration database.
    An exception of type System.ArgumentNullException was thrown.  Additional exception information: Value cannot be null.
    Parameter name: service
    System.ArgumentNullException: Value cannot be null.
    Parameter name: service
       at Microsoft.SharePoint.Administration.SPServiceInstance..ctor(String name, SPServer server, SPService service)
       at Microsoft.SharePoint.Administration.SPFarm.Join()
       at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.CreateOrConnectConfigDb()
       at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.Run()
       at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()"

  • Error while adding a webpart to a sharepoint

    I need some help with adding a custom web part to the landing page. I created a new wsp file for the web part and tried to add it as a solution into the web galleries of the site settings. But I am unable to invoke this web part and it throws an error, “The
    site collection containing this sandboxed solution has exceeded its daily resource usage quota”
    The web part appears within the custom web part section when I try to add it into the page. As an FYI, I tries to modify the quotas and locks of the template being used within the site collection-> modify quotas and lock of the central administration
    and have increased Sandboxed resource solution quota to 300 points but still it somehow doesn’t appear to change while adding the web part.
    What am I doing wrong here?

    Well, the issue was that while updating the quotas and locks for the sharepoint site I needed to select the web application and not the web farm. The resource did get increased to 300 points at the farm level but as I was using a sandboxed application
    to be added as a web part, the target should have been the web application. I corrected this and then added the solution to the sharepoint and activated the solution. After which I was able to include the web part into the site. Hope this helped, do let me
    know if anyone needs any further explanation.

  • Can you install the Office Web Application Server on one of the App Servers for SharePoint 2013?

    Hi,
    Is it possible to run Office Web Application Server (shows preview images for docs and allows Notepad, Word, Excel to work etc) on one of the SharePoint 2013 App Servers. I don't want to have to create a new server. It talks about setting
    up a farm. 
    Better still how the feck do you switch this functionlity off - I always remember it being a pain in the arse. We accidentally ran the first part of the configuration on one of the SharePoint App Servers only to find out our subscription does not
    have this download (bar stewards changed this Nov 2014 - just after started contract).    
    Help would be much appreciated as close to go live
    Thanks.
    John.

    Hi John,
    Please reboot the server at the very beginning and test the issue again.
    Quote from you:
    Problem is I get Internet Web Page cannot display the webpage everytime I click in a excel document, powerpoint document, notebook link or the preview
    Please post the url in browser address here.
    If you just executed the command below:
    Add-WindowsFeature Web-Server,Web-Mgmt-Tools,Web-Mgmt-Console,Web-WebServer,Web-Common-Http,Web-Default-Doc,Web-Static-Content,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Security,Web-Filtering,Web-Windows-Auth,Web-App-Dev,Web-Net-Ext45,Web-Asp-Net45,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Includes,InkandHandwritingServices
    It just install some windows feature to the current server, we can find it should be done before installing several server products.
    Could you please verify if the command you executed is the same as the one above?
    You could also go to local disk and check if there is OfficeWebApps folder under C:\ProgramData\Microsoft\?
    If you check in Control Panel > Programs, is there any feature related to Office Web Apps?
    If you have confirmed there is no Office Web Apps feature installed, please go to SharePoint document library settings, and make the document to open in client, does it work?
    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

  • Error while uninstalling and then re installing sharepoint 2013 on same server(windows server 2012)

    Hi All,
    I have installed SharePoint 2013 prerequisites successfully on windows server 2012. While installing SharePoint 2013, system struck on for several minutes. I have restart my system manually. Later I then installed prerequisites which showed a successful
    lessage. But When I try to install SharePoint 2013. I am getting the following error:
    trial editions and lincensed editions of SharePoint, Project Server, and Office Web apps products may not be installed on the same server.
    I am unable to find solution for this issue. what is the solution for this?
    Thanks in Advance..
    Prem Kumar

    To be honest, the quickest thing you could do (and what I would do regardless) is re-build the server (re-install Windows).
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Error while importing zip file for second time to B2B through ant script

    [echo] args=import
    importstatus:
    [echo] Commandline arguments 1: [import]
    [echo] Import with overwrite=true
    [echo] B2BCommandLineUtility: importRepository: Error messages:
    [echo] MDS-00521: error while reading document /soa/b2b/tpa_JOvrtiV-7030143
    019445112136.xml from metadata repository
    [echo] MDS-00520: failure to read document /soa/b2b/tpa_JOvrtiV-70301430194
    45112136.xml because it is not in the metadata repository
    [echo] MDS-00911: Document with name "/soa/b2b/tpa_JOvrtiV-7030143019445112
    136.xml" and version 16 does not exist in the repository.
    [echo] ORA-01403: no data found
    [echo] ORA-06512: at "DEV_MDS.MDS_INTERNAL_SHREDDED", line 407
    [echo] ORA-06512: at "DEV_MDS.MDS_INTERNAL_SHREDDED", line 603
    [echo] ORA-06512: at line 1
    [echo]
    [echo] ORA-01403: no data found
    [echo] ORA-06512: at "DEV_MDS.MDS_INTERNAL_SHREDDED", line 407
    [echo] ORA-06512: at "DEV_MDS.MDS_INTERNAL_SHREDDED", line 603
    [echo] ORA-06512: at line 1
    [echo]
    [echo] ORA-01403: no data found
    [echo] ORA-06512: at "DEV_MDS.MDS_INTERNAL_SHREDDED", line 407
    [echo] ORA-06512: at "DEV_MDS.MDS_INTERNAL_SHREDDED", line 603
    [echo] ORA-06512: at line 1
    [echo]
    [echo]
    Can anybody plz help???
    Thanks in Advance!!!

    Hi,
    Even I am getting the same error while importing the .zip file for the second time through B2B console-->Administration-->Import/export tab.
    But again it works for the third time..
    Error Message:
    Import of file OriginalProject.zip failed. MDS-00521: error while reading document /soa/b2b/tpa_MnjhBHh-70301432125893445241.xml from metadata repository MDS-00520: failure to read document /soa/b2b/tpa_MnjhBHh-70301432125893445241.xml because it is not in the metadata repository MDS-00911: Document with name "/soa/b2b/tpa_MnjhBHh-70301432125893445241.xml" and version 34 does not exist in the repository. ORA-01403: no data found ORA-06512: at "DEV_MDS.MDS_INTERNAL_SHREDDED", line 407 ORA-06512: at "DEV_MDS.MDS_INTERNAL_SHREDDED", line 603 ORA-06512: at line 1 ORA-01403: no data found ORA-06512: at "DEV_MDS.MDS_INTERNAL_SHREDDED", line 407 ORA-06512: at "DEV_MDS.MDS_INTERNAL_SHREDDED", line 603 ORA-06512: at line 1 ORA-01403: no data found ORA-06512: at "DEV_MDS.MDS_INTERNAL_SHREDDED", line 407 ORA-06512: at "DEV_MDS.MDS_INTERNAL_SHREDDED", line 603 ORA-06512: at line 1
    Please help...

  • How can i deploy sandboxed solution .wsp file to sharepoint 2013 online using powershell script?

    Is there any way to deploy the Sandbox solution .wsp file to sharepoint 2013 online publishing site using powershell or CSOM or any other way?

    Hi,
    According to your post, my understanding is that you wanted to deploy sandboxed solution .wsp file to sharepoint 2013 online.
    "Add-SPSolution" command is not available in SharePoint Online management shell. So, we cannot use PowerShell to update and deploy a solution in SharePoint Online environment. Meanwhile, here is index of Windows PowerShell for SharePoint Online
    cmdlets for your reference:
    http://technet.microsoft.com/en-us/library/fp161364.aspx
    You can CSOM to deploy solution using helper class from CodePlex. The activation code is as follows: SandboxSolutions.ActivateSolution(siteCollectionURl, cookies, "solution_name.wsp");
    About the Client Side Object Model (CSOM), it is a development related issue, we have a specific support channel for the SharePoint developers, so I recommend you go to our MSDN forum for further assistance.
    Here is a similar thread for you to take a look at:
    http://community.office365.com/en-us/forums/156/t/197404.aspx
    In addition, if you would like to upload and activate sandbox solution manually, you can refer to:
    http://community.office365.com/en-us/forums/154/p/64010/244496.aspx#244496
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Error while activating XI App:  references the inactive object

    Guys,
    I am getting this error when I am activating my XI application .
    <i><b>Activation of the change list canceled Check result for Message Mapping Stockquote_Request_Map_01 | http://sapteched/XI/sessionid_XI251/inb/student_01:  Object Message Mapping Stockquote_Request_Map_01 | http://sapteched/XI/sessionid_XI251/inb/student_01 references the inactive object RFC Message ZGET_STOCKQUOTE | urn:sap-com:document:sap:rfc:functions | ZGET_STOCKQUOTE Check result for Message Mapping Stockquote_Response_Map_01 | http://sapteched/XI/sessionid_XI251/inb/student_01:  Object Message Mapping Stockquote_Response_Map_01 | http://sapteched/XI/sessionid_XI251/inb/student_01 references the inactive object RFC Message ZGET_STOCKQUOTE | urn:sap-com:document:sap:rfc:functions | ZGET_STOCKQUOTE.Response</b></i>

    Hi Manish,
    Make sure you have saved and activated all your dependent objects. If you have imported RFC structure then check
    for e.g. ZGET_STOCKQUOTE is your imported RFC structure then make sure its saved and activated.
    Then try activating your message mapping.
    Regards,
    Sridhar

  • Getting an error while adding the user in Sharepoint foundation 2010 environment.

    Hi,
    I am having full control access to SharePoint site. Then i tried add user for that site.
    But i am getting following error while adding the user to the site.
    An unexpected error has occurred.
    Troubleshoot issues with microsoft SharePoint Foundation.
    Correlation ID:3035B777-1B7C-4463-B35E-06657B72C2E4
    Can you please help me anyone on this.
    Thanks,
    Ashok

    This could be any one of a number of things.  You need to lookup the Correlation ID in the ULS logs on the SharePoint server.  That should provide the additional information necessary to diagnose and solve the problem.  Here's a blog post
    on how to find the error.
    http://habaneroconsulting.com/Blog/Posts/Get_the_Real_SharePoint_Error_using_the_ULS_Logs.aspx#.UvEuffldWik 
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

Maybe you are looking for

  • Creating a report based on a calendar

    Hi there! I would appreciate if anyone helps me with this issue. I've to manage a report based on a calendar. It is based on a monthly calendar in which you can see data for each day, then you can drill down to a weekly view and even a daily one (the

  • Sol 9 smpatch missing some patch names from analyze results

    when running smpatch analyze -x idlist=patches_to_analyze (which contains 9 patches), some of the results are missing their names: bash-2.05# smpatch analyze -x idlist=patches_to_analyze 118322-01 112233-12 SunOS 5.9: Kernel Patch 112912-01 SunOS 5.9

  • Problem - remote parametric procedue

    I have couple databases linked eachother, I want to execute remote parametric procedure over dblink but, the dblink is variable (in native procedure). I know that I have to use dynamic sql (because of dblink name) but I dont know how to put (varchar)

  • Ajax implementation in portlert.

    Hi, I have a Question on Inter Portlet Communication. i have a page which consists 2 portlets. On the 1st portlet i have one link ,now my question is how can i show the data in the 2nd portlet by clicking on the link of the 1st portlet. And the data

  • Unable to write to Seagate Backup Plus drive on Mac

    I just installed a brand new Seagate Backup Plus drive on my laptop with the goal of being able to use it on Macs and PCs.Seagate's web site says this: Using the drive under MacOS and Windows If you want to use the drive under Windows and MacOS, simp