Logo

Documentation home for Transend tools

Microsoft 365 Restore Archives script

Use m365_restore_archives.ps1 to undo archive enablement performed by m365_initialize_archives.ps1. The initialize script records its changes in m365_restore_archives.json in the Documents directory of the account that ran it; this restore script reads that file and disables only the archives that the initialize script enabled.

Run the restore script from the same user account and leave the JSON file in its original location. Using this script should be uncommon because disabling an archive after it has been enabled may affect access to archived content. Run it only when your migration plan specifically calls for the newly enabled archives to be removed.

Setup

  1. Download TMCTools.
  2. From the TMCTools zip file, extract common.psm1, m365.psm1 and m365_restore_archives.ps1 from the TMCTools/bin folder.
  3. Ensure you have created the required app using m365_initialize_app.ps1.

Usage

.\m365_restore_archives.ps1
  -AppId <AppId>
  -AppSecret <AppSecret>
  -TenantId <TenantId>
  [-CloudEnvironment <Default | DoD | GCCHigh | China | Germany>]

Parameters

Parameter Required Values Description
-AppId Yes App ID The application ID to use for authentication.
-AppSecret Yes App secret The application secret to use for authentication.
-TenantId Yes Tenant identifier The tenant ID to connect to.
-CloudEnvironment No Default, DoD, GCCHigh, China, Germany The cloud environment to connect to. Use this option if your tenant is not in the worldwide cloud.

Examples

Example 1: Restore state

.\m365_restore_archives.ps1 -AppId '8b26caf2-2ef6-4a9d-9c27-98616d1c1294' -AppSecret '9pitRZoTezs6M0b~bgcibEfkG6qMaczuNV25Ol6m' -TenantId 'example.org'

Troubleshooting

  • Review the log file in your Documents directory for more information.