Renew Expiring SharePoint Client Secret

Overview

SharePoint Add-ins are initially registered using the AppRegNew.aspx page and expire after one year. Prior to this expiration, the secret must be renewed. The renewal can be for up to three years.

Prerequisites

Windows PowerShell with the Microsoft.Graph.Applications modules must be installed.
Open Windows PowerShell and use the following command to check if Microsoft.Graph.Applications module is installed:
Get-InstalledModule Microsoft.Graph.Applications

If the Microsoft.Graph.Applications module is not installed, execute the following command to install it:
Install-Module Microsoft.Graph.Applications

Script Execution

  1. Download the PowerShell script from here.
  2. Then navigate to the script file, according to your directory location, and execute it:
  3. Complete the sign-in process using your global administrator account. Permission consent may need to be granted if this module is used for the first time:
  4. Enter the application client ID and client secret provided by DynamicPoint.
  5. First you will see a list with current credential keys which will be removed, followed by the new ones being added:
  6. Press Enter to complete: