SharePoint Template Operation basics
In this document the basic elements of managing the Anywhere365 software are described.
Periodic Operations: (SharePoint Online) Renew Client Secret
Prerequisites
Make sure the following prerequisites are met
-
User is SharePoint Online global administrators and tenant administrator for the Office 365 tenant
-
Install SharePoint Online Management Shell
https://www.microsoft.com/en-us/download/details.aspx?id=35588
-
Install PowerShell PowerShellGet
-
Open PowerShell as administrator
-
Run:
Install-Module –Name PowerShellGet –Force
Update-Module -Name PowerShellGet
-
-
Install "Microsoft Online Services"
-
Open PowerShell as administrator
-
Run:
Install-Module -Name MSOnline
-
Generate
-
Run Powershell as administrator
-
Run the following cmdlets: (Change the client id value to your client id)
Connect-MsolService
$clientId = 'clientid'
$bytes = New-Object Byte[] 32
$rand = [System.Security.Cryptography.RandomNumberGenerator]::Create()
$rand.GetBytes($bytes)
$rand.Dispose()
$newClientSecret = [System.Convert]::ToBase64String($bytes)
New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Symmetric -Usage Sign -Value $newClientSecret
New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Symmetric -Usage Verify -Value $newClientSecret
New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Password -Usage Verify -Value $newClientSecret
$newClientSecret
-
Copy outcome and save it
(Optional) Extend expiration date to 3 years
Replace the "New-MsolServicePrincipalCredential” statements from the previous code with:
$dtStart = [System.DateTime]::Now
$dtEnd = $dtStart.AddYears(3)
New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Symmetric -Usage Sign -Value $newClientSecret -StartDate $dtStart -EndDate $dtEnd
New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Symmetric -Usage Verify -Value $newClientSecret -StartDate $dtStart -EndDate $dtEnd
New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Password -Usage Verify -Value $newClientSecret -StartDate $dtStart -EndDate $dtEnd
Did you find this page helpful?
Yes No
Sorry about that
Why wasn't this helpful? (check all that apply)
Thank you for your feedback.
Want to tell us more?
Email your feedback to our documentation team.
Great!
Thanks for taking the time to give us some feedback.