Restore-VBREntraIDTenantItem
Short Description
Restores a Microsoft Entra ID item.
Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
|
Restore-VBREntraIDTenantItem -Session <VBREntraIDTenantRestoreSession> [-CredentialsId <Guid>]
-Items <VBREntraIDTenantItem[]> [-RequestPasswordChangeOnLogon] [-SkipObjectsIfExist] [-SkipRecycleBinRestore]
[-SkipRelationships] -RestorePoint <VBREntraIDTenantRestorePoint> [-DefaultUserPassword <SecureString>]
[-UserCredentials <VBREntraIDUserCredentials[]>] [-Reason <String>] [<CommonParameters>] |
Detailed Description
This cmdlet restores Entra ID items from a tenant backup. The items can be users, groups, roles, administrative units or applications.
Parameters
Parameters
|
Parameter
|
Description
|
Type
|
Required
|
Position
|
Accept Pipeline Input
|
|
CredentialsId
|
Used only if you requested login using the Request-VBREntraIDLoginRequests login to Microsoft Entra ID using an account associated with the tenant whose data you are restoring. cmdlet.
Specifies the ID of the login session. Set the parameter value to the value returned by the Request-VBREntraIDLoginRequests login to Microsoft Entra ID using an account associated with the tenant whose data you are restoring. cmdlet.
|
Guid
|
False
|
Named
|
False
|
|
DefaultUserPassword
|
For user restore.
Specifies the default password for the users being restored.
Note: When restoring a user, you must specify this parameter or UserCredentials.
|
SecureString
|
False
|
Named
|
False
|
|
Items
|
Specifies an array of Entra ID items that you want to restore.
Accepts the VBREntraIDTenantItem[] object. To get this object, run the Get-VBREntraIDTenantItemReturns Microsoft Entra ID items that a backup contains. cmdlet.
|
VBREntraIDTenantItem[]
|
True
|
Named
|
False
|
|
Reason
|
Specifies the reason of the restore operation.
|
String
|
False
|
Named
|
False
|
|
RequestPasswordChangeOnLogon
|
For user restore.
Defines if the restored users must change their passwords on the first logon.
Default: False.
|
SwitchParameter
|
False
|
Named
|
False
|
|
RestorePoint
|
Specifies a restore point from which you want to restore Entra ID items.
Accepts the VBREntraIDTenantRestorePoint object. To get this object, run the Get-VBREntraIDTenantRestorePointReturns restore points of a Microsoft Entra ID tenant backup. cmdlet.
|
VBREntraIDTenantRestorePoint
|
True
|
Named
|
False
|
|
Session
|
Specifies the restore session started to recover items backed-up by a tenant backup job.
Accepts the VBREntraIDTenantRestoreSession object. To create this object, run the Start-VBREntraIDTenantRestoreStarts a restore session for a Microsoft Entra ID tenant. cmdlet.
|
VBREntraIDTenantRestoreSession
|
True
|
Named
|
False
|
|
SkipObjectsIfExist
|
Defines if the items existing in the production site must be skipped from restore.
|
SwitchParameter
|
False
|
Named
|
False
|
|
SkipRecycleBinRestore
|
Defines if all the items must be restored from backup.
If this parameter is set to True, the cmdlet will restore all items from the backup. Otherwise, if an item exists in the recycle bin, it will be restored from the bin.
|
SwitchParameter
|
False
|
Named
|
False
|
|
SkipRelationships
|
Defines if to skip item relationships from restore.
|
SwitchParameter
|
False
|
Named
|
False
|
|
UserCredentials
|
For user restore.
Specifies an array of passwords for users being restored.
Note: When restoring a user, you must specify this parameter or DefaultUserPassword.
Accepts the VBREntraIDUserCredentials[] object. To create this object, run the New-VBREntraIDUserCredentialsDefines an object that matches a Microsoft Entra ID user and a password. cmdlet.
|
VBREntraIDUserCredentials[]
|
False
|
Named
|
False
|
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.
Output Object
Guid.
Examples
Example 1. Restoring User
|
This example shows how to restore a user and assign new credentials to them. The user will need to change the password on the first logon.
|
$tenantRestoreSession = Get-VBREntraIDTenantRestoreSession -Id "901e32ac-4c9e-4f7a-9b36-a4fd0f7248fe"
$backup = Get-VBREntraIDTenantBackup -Name "Tenant backup"
$restorePoint = Get-VBREntraIDTenantRestorePoint -Backup $backup -Id "a66808bc-780e-46f2-8538-63ace3c8f9be"
$item = Get-VBREntraIDTenantItem -Backup $backup -Type User -Name "Test Admin"
$password = (Generate-VBREntraIDTenantUserPassword -Session $tenantRestoreSession -PasswordCount 1) | ConvertTo-SecureString -AsPlainText -Force
$userPassword = New-VBREntraIDUserCredentials -UserId $item.Id -Password $password
$itemRestoreSessionId = Restore-VBREntraIDTenantItem -Session $tenantRestoreSession -Items $item -RestorePoint $restorePoint -RequestPasswordChangeOnLogon -UserCredentials $userPassword |
Perform the following steps:
- Run the
Get-VBREntraIDTenantRestoreSessionReturns restore sessions started to recover Microsoft Entra ID tenant backups. cmdlet. Specify the Id parameter value. Save the result to the $tenantRestoreSession variable.
- Run the
Get-VBREntraIDTenantBackupReturns backups of Microsoft Entra ID tenants. cmdlet. Specify the Name parameter value. Save the result to the $backup variable.
- Run the
Get-VBREntraIDTenantRestorePointReturns restore points of a Microsoft Entra ID tenant backup. cmdlet. Set the $backup variable as the Backup parameter value. Specify the Id parameter value. Save the result to the $restorePoint variable.
- Run the
Get-VBREntraIDTenantItemReturns Microsoft Entra ID items that a backup contains. cmdlet. Set the $backup variable as the Backup parameter value. Specify the Type and Name parameter values. Save the result to the $item variable.
- Run the
Generate-VBREntraIDTenantUserPasswordCreates passwords. cmdlet. Specify the following settings:
- Set the
$session variable as the Session parameter value.
- Specify the
PasswordCount parameter value.
- Convert the result to a secure string.
- Save the result to the
$password variable.
- Run the
New-VBREntraIDUserCredentialsDefines an object that matches a Microsoft Entra ID user and a password. cmdlet. Set the $item.Id variable as the UserId parameter value. Set the $password variable as the Password parameter value. Save the result to the $userPassword variable.
- Run the
Restore-VBREntraIDTenantItem cmdlet. Specify the following settings:
- Set the
$tenantRestoreSession variable as the Session parameter value.
- Set the
$item variable as the Items parameter value.
- Set the
$restorePoint variable as the RestorePoint parameter value.
- Provide the
RequestPasswordChangeOnLogon parameter.
- Set the
$userPassword variable as the UserCredentials parameter value.
- Save the result to the
$itemRestoreSessionId variable.
|
Example 2. Restoring Groups
|
This example shows how to restore groups whose names start with "grp".
|
$tenantRestoreSession = Get-VBREntraIDTenantRestoreSession -Id "901e32ac-4c9e-4f7a-9b36-a4fd0f7248fe"
$backup = Get-VBREntraIDTenantBackup -Name "Tenant backup"
$restorePoint = Get-VBREntraIDTenantRestorePoint -Backup $backup -Id "a66808bc-780e-46f2-8538-63ace3c8f9be"
$groups = Get-VBREntraIDTenantItem -Backup $backup -Type Group -Name "grp*"
$itemRestoreSessionId = Restore-VBREntraIDTenantItem -Session $tenantRestoreSession -Items $groups -RestorePoint $restorePoint |
Perform the following steps:
- Run the
Get-VBREntraIDTenantRestoreSessionReturns restore sessions started to recover Microsoft Entra ID tenant backups. cmdlet. Specify the Id parameter value. Save the result to the $tenantRestoreSession variable.
- Run the
Get-VBREntraIDTenantBackupReturns backups of Microsoft Entra ID tenants. cmdlet. Specify the Name parameter value. Save the result to the $backup variable.
- Run the
Get-VBREntraIDTenantRestorePointReturns restore points of a Microsoft Entra ID tenant backup. cmdlet. Set the $backup variable as the Backup parameter value. Specify the Id parameter value. Save the result to the $restorePoint variable.
- Run the
Get-VBREntraIDTenantItemReturns Microsoft Entra ID items that a backup contains. cmdlet. Set the $backup variable as the Backup parameter value. Specify the Type and Name parameter values. Save the result to the $groups variable.
- Run the
Restore-VBREntraIDTenantItem cmdlet. Specify the following settings:
- Set the
$tenantRestoreSession variable as the Session parameter value.
- Set the
$groups variable as the Items parameter value.
- Set the
$restorePoint variable as the RestorePoint parameter value.
- Save the result to the
$itemRestoreSessionId variable.
|
Related Commands