How Can We Help?
< All Topics
Print

07. How to extend and get the expiration period for SharePoint Credentials (App-Only)

Quickly Navigate to Popular Sections:

How to get expiration period for SharePoint Credentials

Our guide to check the expiration date of SharePoint credentials using PowerShell, requiring SharePoint Client ID and Global Admin permissions.

Step 1: Open PowerShell ISE as administrator in the local computer:
Hingepoint Proconnector |

Step 2: Put the script from below and press F5:

Note: Please paste your current SharePoint Client ID to the script (replace the value that highlighted in yellow). You can copy SharePoint Client ID from any SharePoint integration on the HingePoint Sync management portal.

if (!(Get-Module AzureAD))
{
try
{
Install-Module AzureAD -Confirm:$false -Force -ErrorAction Stop
import-module AzureAD

}
catch
{

$Error[0]
}

}

#Parameters
$ClientID = "11111111-1111-1111-1111-111111111111"

#Connect to AzureAD
Connect-AzureAD

#Get the Client ID
$App = Get-AzureADServicePrincipal -All $true | Where-Object {$_.AppID -eq $ClientID}

#Get the Current Expiry Date
$CurrentExpiryDate = (Get-AzureADServicePrincipalPasswordCredential -ObjectId $App.ObjectId).EndDate
Write-host "Current Expiry Date:"$CurrentExpiryDate -BackgroundColor Green

Hingepoint Proconnector |

Step 3: Enter credentials of user with Global Admin permissions to O365 tenant:
Hingepoint Proconnector |
Hingepoint Proconnector |

Step 4: Find expression End Date property in the output of the script:
Hingepoint Proconnector |

How to Extend SharePoint Client Secret expiration period for 10 years?

Instructions to extend the SharePoint Client Secret expiration period to 10 years, involving PowerShell script execution, SharePoint Client ID and Secret, and Global Admin access.

!Important: Please paste your current SharePoint Client ID and SharePoint Client Secret to the script (replace the value that highlighted in yellow). You can copy SharePoint Client ID from any SharePoint integration on the HingePoint Sync management portal.

Please contact the HingePoint Dev team (dev.team@hingepoint.com) before executing the script from below to plan these changes.

Step 1:  Open PowerShell ISE as administrator:
Hingepoint Proconnector |

 

Step 2: Put the script from below and press F5:

Note: Please paste your current SharePoint Client ID to the script (replace the value that highlighted in yellow). You can copy SharePoint Client ID from any SharePoint integration on the HingePoint Sync management portal.

if (!(Get-Module AzureAD))
{
try
{
Install-Module AzureAD -Confirm:$false -Force -ErrorAction Stop
import-module AzureAD

}
catch
{
$Error[0]
}

}

#Parameters
$ClientID = "11111111-1111-1111-1111-111111111111"
$ClientSecret= "9D1e4JgBMlkVlaXEdKTgZqJuzhRsmTfVMyQYoOcyHaM="

#Connect to AzureAD
Connect-AzureAD

#Get the Client ID
$App = Get-AzureADServicePrincipal -All $true | Where-Object {$_.AppID -eq $ClientID}

#Get the Current Expiry Date
$CurrentExpiryDate = (Get-AzureADServicePrincipalPasswordCredential -ObjectId $App.ObjectId).EndDate
Write-host "Current Expiry Date:"$CurrentExpiryDate -BackgroundColor Green

#Extend the validity of the App by 10 years

$StartDate = Get-Date
$EndDate = $StartDate.AddYears(10)
New-AzureADServicePrincipalPasswordCredential -ObjectId $App.ObjectId -StartDate $StartDate -EndDate $EndDate -Value $ClientSecret
New-AzureADServicePrincipalKeyCredential -ObjectId $App.ObjectId -StartDate $StartDate -EndDate $EndDate -Value $ClientSecret

Hingepoint Proconnector |

 

Step 3: Enter credentials of user with Global Admin permissions to O365 tenant:
Hingepoint Proconnector |
Hingepoint Proconnector |

 

Step 4: Find new expression End Date property in the output of the script:
Hingepoint Proconnector |

 

How to Edit your SharePoint Integrations after renewing the tokens?

Steps to update the expiry date in SharePoint Integrations after renewing tokens, including editing the 'End Date' in File Sync Portal and assistance for multiple integrations.

Step 1: You need to edit the Expiry Date for all the existing SP Credentials in your File Sync Portal under Integrations -> Edit
Hingepoint Proconnector |

Step 2: Select your SP Integrations and update the ‘End Date’ field and click on Save. The SP Integrations’ End Date must be edited for the next 10 years.
Hingepoint Proconnector |

Step 3: In case if you have multiple SP Integrations to be edited, please reach out to dev.team@hingepoint.com with your renewal date and we can get them updated for you.