Install the Microsoft 365 Backup App on your Synology
Create the Azure AD Registered App that will allow the backup to connect with the correct permissions using the provided how-to from the following link:
https://www.synology.com/en-global/knowledgebase/DSM/tutorial/Backup/How_to_register_an_Azure_AD_app
In Active Backup for Microsoft 365. Create a backup task. Make sure to select what you need to backup and avoid the possible cruft of dead and unused accounts and services.
Troubleshooting
I had a problem with the AppGenerator.ps1
script failing to create the credentials in Azure (see error message below) so I added a sleep command to allow the script to pause for a bit to wait for the missing resources to make their appearance.
However before I did the above I deleted the app several times in Azure AD registered apps and one time it worked with out the above work-a-round
Error Message of Failed .\AppGenerator.ps1 Run
PS C:\Users\JamesMcDonal_pt0ydur\OneDrive - Toggen\Toggen\Backup Solution\Synology> .\AppGenerator.ps1
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): Y
Before generating your Azure AD application, please enter a password you wish to use to protect the certificate: ************
[INFO] Creating the client application (Microsoft 365 Backup)
New-AzureADApplicationKeyCredential : Error occurred while executing GetApplication
Code: Request_ResourceNotFound
Message: Resource 'c6d99636-7bea-4085-a65a-74d185b1c2c3' does not exist or one of its queried reference-property
objects are not present.
RequestId: 8a28c8ba-4e53-48c3-94d8-9694213deea8
DateTimeStamp: Sun, 08 Nov 2020 22:30:27 GMT
HttpStatusCode: NotFound
HttpStatusDescription: Not Found
HttpResponseStatus: Completed
At C:\Users\JamesMcDonal_pt0ydur\OneDrive - Toggen\Toggen\Backup Solution\Synology\AppGenerator.ps1:134 char:29
+ ... edentials = New-AzureADApplicationKeyCredential -ObjectId $clientAadA ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzureADApplicationKeyCredential], ApiException
+ FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD.Graph.PowerShell.Cus
tom.NewAzureADApplicationKeyCredential
Get-AzureADApplicationOwner : Error occurred while executing GetApplicationOwners
Code: Request_ResourceNotFound
Message: Resource 'c6d99636-7bea-4085-a65a-74d185b1c2c3' does not exist or one of its queried reference-property
objects are not present.
RequestId: 462526bb-6fac-4bcb-a9f1-a238f15d5f4e
DateTimeStamp: Sun, 08 Nov 2020 22:30:27 GMT
HttpStatusCode: NotFound
HttpStatusDescription: Not Found
HttpResponseStatus: Completed
At C:\Users\JamesMcDonal_pt0ydur\OneDrive - Toggen\Toggen\Backup Solution\Synology\AppGenerator.ps1:142 char:14
+ ... $owner = Get-AzureADApplicationOwner -ObjectId $clientAadApplicati ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-AzureADApplicationOwner], ApiException
+ FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.GetAppl
icationOwners
Add-AzureADApplicationOwner : Error occurred while executing AddApplicationOwner
Code: Request_ResourceNotFound
Message: Resource 'c6d99636-7bea-4085-a65a-74d185b1c2c3' does not exist or one of its queried reference-property
objects are not present.
RequestId: bf855c05-613b-41cb-b33b-468bc7989568
DateTimeStamp: Sun, 08 Nov 2020 22:30:27 GMT
HttpStatusCode: NotFound
HttpStatusDescription: Not Found
HttpResponseStatus: Completed
At C:\Users\JamesMcDonal_pt0ydur\OneDrive - Toggen\Toggen\Backup Solution\Synology\AppGenerator.ps1:144 char:9
+ Add-AzureADApplicationOwner -ObjectId $clientAadApplication.O ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-AzureADApplicationOwner], ApiException
+ FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD16.PowerShell.AddAppl
icationOwner
0 Comments