Export (0) Print
Expand All

Use Windows PowerShell to update alerts in SharePoint 2013


Applies to: SharePoint Server 2013, SharePoint Foundation 2013

Topic Last Modified: 2013-12-18

Summary: Learn to use Invoke-AlertFixup to update the e-mail alerts associated with a URL.

This article describes Invoke-AlertFixup, a Windows PowerShell advanced function that you can use to update the Uniform Resource Locator (URL) of a Web application used in alert e-mails after a Web application address changes. The advanced function is loaded by running a script of the same name.

For more information about advanced functions, see about_Functions_Advanced.

In this article:

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:

Before you begin this operation, read about_Execution_Policies.

This section describes how to update URLs by using Windows PowerShell.

To update URLs 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.

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

    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. Copy the code from the Script Center (, and then paste it into a text editor, such as Notepad.

  3. Save the file, naming it Invoke-AlertFixup.ps1.

    You must use the provided name or the script will fail, and you must save the file as an ANSI-encoded text file.
  4. On the Start menu, click All Programs.

  5. Click Microsoft SharePoint 2013 Products.

  6. Click SharePoint 2013 Management Shell.

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

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


    This script contains the Invoke-AlertFixup advanced function. After the script is loaded to memory for the current Windows PowerShell session, Invoke-AlertFixup can be used like a Windows PowerShell cmdlet, for example:

    Invoke-AlertFixup -site <SiteCollURL> -oldurl <OldURL>


    • <SiteCollURL> is the Site Collection URL seen in the ImmedSubscriptions table of the content database.

    • <OldURL> is the old URL of the site.

    For Invoke-AlertFixup to work correctly, the URLs that you specify with the site and oldurl parameters must be in the same site collection. This is necessary to allow necessary updating of alerts in a specific zone. Alerts for each zone must be updated individually using the necessary new zone URL to that of the original (old) zone URL.
  9. To display all alerts that would be updated by using the Invoke-AlertFixup command, at the Windows PowerShell command prompt type the following:

    Invoke-AlertFixup -site <SiteCollURL> -Oldurl <OldURL> -whatif


    • <SiteCollURL> is the Site Collection URL seen in the ImmedSubscriptions table of the content database.

    • <OldURL> is the old URL of the site.

For more information, see Script Center.

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.

Your company has a web application that is configured to use three zones, as shown in the following table.

Coho Winery zone mapping

Description URL Zone








Your company merges with Coho Vineyard and changes its name to Coho Winery and Vineyard. Management wants to change the Intranet and Extranet zones to reflect the new name change. The following table displays the new zone configuration.

Coho Winery and Vineyard zone mapping

Description URL Zone






After the name of the web application is changed and the alternate access mappings are updated, Invoke-AlertFixup should be run to update the e-mail alerts associated with the intranet and extranet sites, as follows:

Invoke-AlertFixup -site http://cohovineyardandwinery -oldurl http://cohowinery
Invoke-AlertFixup -site -oldurl
No changes are made regarding the vendor site, as Coho Winery has decided not to change the name of the vendor portal.

© 2016 Microsoft