Export (0) Print
Expand All

Remove app for SharePoint instances from a SharePoint 2013 site

SharePoint 2013
 

Applies to: SharePoint Server 2013 Standard, SharePoint Server 2013 Enterprise, SharePoint Foundation 2013

Topic Last Modified: 2013-12-18

Summary: When administrators remove apps for SharePoint from SharePoint sites, the apps are uninstalled and functionality is no longer available to users.

In this article:

Before you begin this task, review the following information about permissions:

  • A user must have the Manage Web site permission to remove an app for SharePoint. By default, this permission is only available to users with the Full Control permission level or who are in the site Owners group.

NoteNote:
Because SharePoint 2013 runs as websites in Internet Information Services (IIS), administrators and users depend on the accessibility features that browsers provide. SharePoint 2013 supports the accessibility features of supported browsers. For more information, see the following resources:

Site owners can remove apps for SharePoint from their sites. Several circumstances might influence farm administrators and site owners to remove apps from their sites. For example, an app for SharePoint may no longer be needed or could become too much of a distraction to employees. The following procedures provide steps for removing (or uninstalling) an app.

NoteNote:
When you remove an app, the data for that app will no longer be available.
To remove an app from a SharePoint site
  1. Verify that the user account that is performing this procedure is a member of the Site owners group.

  2. On the site, on the Settings menu, click View Site Contents.

  3. In the Apps section, point to the app that you want to remove, click , and then click Remove.

  4. Click OK to confirm that you want to remove the app.

Before you use the following procedure, be sure to get the title for the app that you want to remove.

To remove an app by using Windows PowerShell
  1. Verify that you have the following memberships:

    • securityadmin fixed server role on the SQL Server instance.

    • db_owner fixed database role on all databases that are to be updated.

    • Administrators group on the server on which you are running the Windows PowerShell cmdlets.

    • Site Owners group on the site collection to which you want to install the app.

    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 15 Products cmdlets.

    NoteNote:
    If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Add-SPShellAdmin.
  2. Start the SharePoint 2013 Management Shell.

    • For Windows Server 2008 R2:

      1. On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.

    • For Windows Server 2012:

      • On the Start screen, click SharePoint 2013 Management Shell.

        If SharePoint 2013 Management Shell is not on the Start screen:

      • Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.

    For more information about how to interact with Windows Server 2012, see Common Management Tasks and Navigation in Windows Server 2012 .

  3. At the Windows PowerShell command prompt, type the following commands, and press ENTER after each one:

    $instances = Get-SPAppInstance -Web <URL>
    # Gets all apps installed to the subsite you specify.
    

    $instance = $instances | where {$_.Title -eq '<app_title>'}
    # Sets the $instance variable to the app with the title you supply.
    

    Uninstall-SPAppInstance -Identity $instance
    # Uninstalls the app from the subsite.
    

    Where:

    • <URL> is the path site collection or subsite that contains the app.

    • <app_title> is the title of the app you want to remove.

  4. At the question Are you sure you want to perform this action?, type Y to uninstall the app.

For more information, see Get-SPAppInstance, Uninstall-SPAppInstance.

An app for SharePoint in the App Catalog is available for users to install. Consequently, users can install apps for SharePoint on many sites. An administrator who wants to remove a specific app might find it difficult to locate all instances of an app.

This section provides two Windows PowerShell scripts that farm administrators and site owners can use to find all locations for a specific app and then uninstall all instances from every location. Use the first script to locate all instances of a specific app in a SharePoint environment. Then use the second script to uninstall all instances of the app from the SharePoint environment.

NoteNote:
When you remove an app, the data for that app will no longer be available.
To locate specific apps by using Windows PowerShell (save as script and run script)
  1. Verify that you have the following memberships:

    • securityadmin fixed server role on the SQL Server instance.

    • db_owner fixed database role on all databases that are to be updated.

    • Administrators group on the server on which you are running Windows PowerShell cmdlets.

    • You must read about_Execution_Policies.

    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 cmdlets.

    NoteNote:
    If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Permissions and Add-SPShellAdmin.
  2. Open the Get all App instances for a specific App on a specific web application script sample on the TechNet Gallery.

  3. Copy the code from the sample to a text editor and save the file as “Get-AppInstances.ps1”

  4. Start the SharePoint 2013 Management Shell.

    • For Windows Server 2008 R2:

      1. On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.

    • For Windows Server 2012:

      • On the Start screen, click SharePoint 2013 Management Shell.

        If SharePoint 2013 Management Shell is not on the Start screen:

      • Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.

    For more information about how to interact with Windows Server 2012, see Common Management Tasks and Navigation in Windows Server 2012.

  5. Change to the directory where you saved the file.

  6. At the Windows PowerShell command prompt, type the following command:

    ./ Get-AppInstances.ps1 -productId <ProductId> -webAppUrl <webAppUrl>
    

    Where:

    • <ProductId> is the GUID ID of the App

    • and <webAppUrl> is the full URL of the web application.

To uninstall specific apps from all locations by using Windows PowerShell (save as script and run script)
  1. Verify that you have the following memberships:

    • securityadmin fixed server role on the SQL Server instance.

    • db_owner fixed database role on all databases that are to be updated.

    • Administrators group on the server on which you are running Windows PowerShell cmdlets.

    • You must read about_Execution_Policies.

    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 cmdlets.

    NoteNote:
    If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Permissions and Add-SPShellAdmin.
  2. Open the Remove all App instances for a specific App on a specific web application script sample on the TechNet Gallery.

  3. Copy the code from the sample to a text editor and save the file as “Remove-App.ps1”

  4. Save the file as Remove-App.ps1.

  5. Start the SharePoint 2013 Management Shell.

    • For Windows Server 2008 R2:

      • On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.

    • For Windows Server 2012:

      • On the Start screen, click SharePoint 2013 Management Shell.

        If SharePoint 2013 Management Shell is not on the Start screen:

      • Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.

    For more information about how to interact with Windows Server 2012, see Common Management Tasks and Navigation in Windows Server 2012.

  6. Change to the directory where you saved the file.

  7. At the Windows PowerShell command prompt, type the following command:

    ./ Remove-App.ps1 -productId <ProductId> -webAppUrl <webAppUrl>
    

    Where:

    • <ProductId> is the GUID ID of the App

    • <webAppUrl> is the full URL of the web application.

For more information, see Get-SPSite.

NoteNote:
We recommend that you use Windows PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft