Restoring the directory: Entra ID from the backup

Which object types the directory extract backs up from Entra ID and Intune, how to search and compare versions, what of it is written back, why an object from the recycle bin keeps more than a newly created one, how policies can come back switched on, how BitLocker keys are protected and what remains a preview.

The directory extract backs up Microsoft Entra ID and Intune. This page lists the object types and describes the way back for each.

How often the extract runs is set in the settings: together with the rarely changing sources or every eight hours, see What gets backed up.

Not to be confused with the directory agent, which reports people from an on-premises Active Directory or LDAP to Conbool. The agent supplies the platform with people; this page is about writing back a backed-up Entra state. See Directory.

What is backed up and what is written back

Object typeWritten back
Usersyes, from the recycle bin or created anew; changed attributes are reset
Groups with their membersyes, from the recycle bin or created anew; missing members are added
Conditional access policiesyes: deleted ones are created anew in report-only mode, changed ones are reset; switched on only with a separate consent and approval, see below
Named locationsyes: deleted ones are created anew, changed ones are reset
Authentication strengthsyes: deleted ones are created anew, changed ones are reset
Authentication contextsyes: deleted ones are created anew, changed ones are reset
Roles with their membersno, preview only
App registrationsno, preview only
Service principals (enterprise applications)no, preview only
Administrative unitsno, preview only
Custom rolesno, preview only
Role assignments, including those for individual administrative unitsno, preview only
Authentication methods policyno, preview only
Devices in Entra IDno, preview only
Devices managed by Intuneno, preview only
BitLocker recovery keysno, for viewing only, see below
Intune policies, profiles and scriptsno, preview only

The extract contains no user passwords and no secrets or certificates of app registrations: Microsoft does not hand them out.

You can also download the backed-up state as a ZIP file: JSON per object type, users, groups and memberships additionally as CSV, each conditional access policy as a file of its own. An administrator can use it to rebuild by hand what remains a preview.

The Directory view

You see what is backed up of the directory under Recover, tab Directory. Every backup run stores a version. A sentence at the top says how many object types are backed up in the selected version. If an object type needs your consent at Microsoft, the link Renew consent follows.

Object types and objects. The list shows the number of objects, the number of revisions and the last change for each object type. Under “Version” you pick an older version. Clicking an object type shows its objects; the field “Filter by name or ID” narrows them down. An object opens at the side with three tabs:

  • Attributes shows what is backed up of the object.
  • Revisions shows from when to when each state applied.
  • Compare sets two versions side by side, see below.

You download a single object with Download as JSON, the whole version under More actions with Download as ZIP.

Search across all versions. The field “Search versions” searches not only the selected version but all loaded ones. Under “Search in” you choose Everything, Name, Attribute or Value. Each result names the object, the attribute, the value and the period in which the value applied, marked “current” or “earlier”. This shows you, for example, since when a user has been listed in a particular department. You find a BitLocker key by the name of its device. The search needs 2 to 200 characters. If there are very many versions, the view loads only the most recent ones and says so.

Compare. In the Compare tab you choose two versions under “From” and “With”, or “Today at Microsoft”. The backup service reads today's state from Microsoft at that moment, not your browser. The comparison is per attribute, with “Before” and “After”. Empty, “no value” and an empty list count as equal; for lists the order does not matter. If a version did not back up the object type, no comparison is possible, and the view says so.

Why an object type is not backed up. Below every object type missing from the selected version, its reason is shown:

StateMeaning
Not licensedYour Microsoft tenant has no licence for it, for example for Intune. There is nothing to back up.
No permissionMicrosoft does not let the backup app read this object type. Renew consent adds the missing permission.
Missing in this versionOlder versions have the object type, this one does not. The next run tries again.
Not read yetThe object type is not in any version yet. The next run tries again.

Object types without a licence are not counted in the sentence at the top. If an object type is missing from a version, that does not mean there were no objects: for this version it is unknown.

The change plan

Before anything is written, a plan is built. It compares the backed-up state with today's and shows line by line what would be created and what would change.

Anything that has been added is never removed. The plan creates and modifies; it does not clean up. An account created after the backup point in time is left untouched.

Today's state is read live from Microsoft for this. With several thousand accounts that takes a few minutes.

Users and groups: recycle bin or new creation

An object still in Microsoft's recycle bin is restored and keeps its identifier, its mailbox, its licences and its memberships.

An object no longer there is created anew. It receives a new identifier and thereby loses everything attached to the old one: the mailbox, licence assignments, permissions on files and sites.

Microsoft keeps deleted users and Microsoft 365 groups in the recycle bin for thirty days. Act within that window and you get the person back; after it you get an entry with the same name. Security groups do not go to the recycle bin; for them only new creation remains.

Memberships are restored from the backup unless you switch this off: a newly created group gets its members back, and a newly created user returns to the groups that exist today or came back in the same run. Dynamic groups are skipped, as their members follow from the rule. No member is ever removed.

Password. A newly created user gets a random password or one you specify, and must change it at the first sign-in. A specified password is neither stored nor logged.

Changed users and groups. Only the attributes that differ from the backed-up state are reset. A changed group gets its missing members back; anyone who joined since stays.

Conditional access policies and what belongs to them

A deleted conditional access policy is created anew from the backup, with a new identifier and in report-only mode; one that was switched off in the backed-up state stays off. An administrator switches it on in Entra, after checking the sign-in logs. The exception is restoring switched on, see below. That way a restored policy locks no one out, even if the directory has changed since the backup.

Changed policies are reset by 365 Backup to the backed-up state. Only the attributes that differ are reset; whatever exists today in addition is cleared. Whether the policy is switched on or off stays as it is today. If only that state differs, 365 Backup changes nothing; you switch it in Entra. A policy switched on today is not overwritten. The plan then says: “Switched on today, so it is not overwritten. Set it to report-only in Entra, then build the plan again.”

Changed locations, strengths and contexts likewise go back to the backed-up state, as long as no switched-on policy uses them. If one does, everything stays as it is, and the plan names the policy. Writing back never sets the “trusted” marking of a named location: a location that was trusted in the backup comes back without it. If a location is trusted today, its IP ranges stay as they are.

If the policy refers to a named location, an authentication strength or an authentication context that no longer exists, that object is created from the backup first. If one with the same name exists today, the policy refers to that one.

Nothing is created for an object that exists today under the same name, nor for a policy that names a user or group that does not exist today; the result names what is missing. No policy is deleted.

Restoring policies switched on

Without a further choice a policy comes back in report-only mode, and one that is switched on today stays untouched. If a policy is to come back exactly as backed up, switched on as well, the change plan offers “Restore policies as backed up (enforced)”. Then:

  • Policies switched on today get the backed-up state as well, together with their locations, strengths and contexts.
  • What was switched on in the backup is switched on again. This also applies to a deleted policy that is created anew.
  • Missing locations, strengths and contexts are created along with them.
  • Today's exclusions for emergency and administrator accounts stay. All other exclusions go back to the backed-up state.
  • No location is marked as trusted here either.

A separate application. This route runs through a second application with its own consent. In Conbool it is called “Restore policies switched on”, at Microsoft “Conbool 365 Backup Directory Admin”, publisher Conbool GmbH. It holds the most far-reaching permissions in this product. Microsoft asks for these permissions:

  • Policy.ReadWrite.ConditionalAccess
  • Policy.ReadWrite.AuthenticationMethod
  • RoleManagement.ReadWrite.Directory
  • Application.ReadWrite.All
  • AppRoleAssignment.ReadWrite.All
  • AdministrativeUnit.ReadWrite.All
  • DeviceManagementConfiguration.ReadWrite.All
  • plus Policy.Read.All for reading

These are write permissions for conditional access policies, authentication methods, roles, all apps with their permissions, administrative units and Intune. Conbool currently uses only one of them: restoring policies you select individually. Without this consent Conbool writes back no policy switched on; everything else on this page works as described.

Consent. Under Settings, tab Connections, you find “Restore policies switched on” with the button “Grant consent”. Consent applies per Microsoft organisation. Conbool asks first (“Grant far-reaching permissions?”). Microsoft then shows the permissions once more, and you confirm there with “Accept”. Only an account with the Global Administrator or Privileged Role Administrator role can consent. If a Microsoft organisation is only shared with your account, this is not possible; only the account that owns it may do so. The application only takes effect if “Write back to the directory” is switched on in the settings. If you disconnect the organisation, this consent lapses too.

Always with approval. Every enforced restore needs approval by a second person, even if the four-eyes principle is otherwise off. This is how it works:

  1. Choose a fixed version at the top and reload the plan. The latest version will not do: when writing, a different version might apply than at approval.
  2. Select the policies and choose “Restore policies as backed up (enforced)”.
  3. Enter the reason under “Reason for the second person” and press “Request approval”.
  4. The second person sees, under Approvals, the names of the policies as backed up and the version, and approves. Nobody can approve their own request.
  5. Then write back the same selection once more, with “Write back … selected as enforced”.

The approval is valid for 48 hours and only once.

Protection against lockout. Writing only goes ahead while at least one active account holding Global Administrator, Conditional Access Administrator or Security Administrator is covered by no switched-on policy that can prevent sign-in. Conbool checks this in the plan and once more right before writing each policy. If it is unclear whether an account is covered, for instance with a group whose members are unknown, it counts as covered. If today's state cannot be read, nothing is written. A policy that would close the last such gap stays unwritten, and the plan states the reason: “Once switched on, it would, together with the other switched-on policies, cover every emergency and administrator account.” Then exclude an emergency account from all policies in Entra and build the plan again.

Devices and Intune

The Intune types comprise, each with its assignments: compliance policies, configuration profiles, settings catalog policies, endpoint security and security baselines, administrative templates, Autopilot profiles, app protection policies for iOS and Android, and scripts for Windows and macOS as well as remediation scripts, the scripts with their content.

If your tenant has no Intune licence, 365 Backup does not read the Intune types. This is not an error and triggers no notification.

Managed devices. The extract records which device belongs to whom and how it is set up. Phone number, device and SIM card identifiers such as the IMEI, network addresses, email address and notes are not backed up by 365 Backup; on personal devices these would be employee data. The serial number is kept so that you can recognise a device.

Permissions of their own. For Intune, devices and BitLocker keys the backing application needs permissions of its own, see Setup. If one is missing, only the types that depend on it are missing from the extract; users, groups and policies continue to be backed up.

Older versions do not contain these types. There they count as not backed up, not as empty, and the change plan does not report their objects of today as added. If a type cannot be read in a run, the run carries over its objects from the previous version instead of treating them as deleted.

BitLocker recovery keys

Microsoft records every retrieval of a key in the Entra ID audit log. 365 Backup therefore reads each key only once, as soon as it is new, and stores it encrypted, separately from the rest of the extract. A key does not change; a new one receives a new identifier at Microsoft.

The extract holds only the details of a key: identifier, device, drive type and creation time. The ZIP file, too, contains only these details, never the key itself.

A key can be viewed under Recover, tab Directory: in the object type BitLocker recovery key, or by searching for the device name. It stays hidden there.

Only owners, security admins and backup administrators of the account can reveal a key. The page asks first and names the device. Each person can reveal at most ten times per hour, an account at most fifty times a day. After one minute the key is hidden again.

Every reveal is recorded in the audit log with name, time, identifier and device. The entry is written first; if that fails, the key stays hidden. The key never appears in exports.

A key stays backed up as long as a retained version refers to it; after that the deletion run removes it. If the data source is deleted under Article 17, its keys are deleted too.

What remains a preview

These object types are currently not written back by 365 Backup, not even with either of the two consents:

  • Roles and their members
  • App registrations
  • Service principals
  • Administrative units
  • Custom roles and role assignments
  • the authentication methods policy
  • Devices from Entra ID and Intune
  • BitLocker recovery keys
  • all Intune types: policies, profiles and scripts

They appear in the plan with their backed-up state so that an administrator can apply them by hand. Assigning a role requires a Microsoft permission with which an application could make itself Global Administrator; the “Maintain directory” application does not have it. The “Restore policies switched on” application has it, but currently does not use it. For each newly created user and group, the result therefore lists the roles that belonged to it according to the backup.

Without consent, preview only

Writing back runs through the separate Maintain directory application, to which an administrator consents separately per Microsoft organisation, see Setup. It carries permissions for users, groups and conditional access policies, none for roles. With them any user of the Microsoft tenant could be modified. Without that consent, therefore, only a plan is produced, which an administrator applies themselves.

Where consent has been granted, it is used only for the objects you select in the plan. Every operation is recorded in the audit log.

Restoring policies switched on also needs the consent “Restore policies switched on”, see above. Without it nothing is written back switched on, and the page says so.