Restore-RMActiveDirectoryObject
From PowerGUI Wiki
Restores Active Directory objects from a backup.
Contents |
Syntax
Restore-RMActiveDirectoryObject [-UndeletionContainer <String>] [-NoReport] -Backup <String> [-Object <String[]>] [-Recurse] [-Attribute <String[]>] [-ObjectType <String[]>] [-ReportUnchangedAttributes] [-ReportUnchangedObjects] [-UseAgentlessMethod] [-DomainController <String>] [-Credential <PSCredential>] [-User <String>] [-Password <SecureString>] [-BackupPassword <SecureString>] [-SqlLogin <String>] [-SqlPassword <SecureString>] [<CommonParameters>]
Detailed Description
Restores the Active Directory objects that have specified parameters from a backup.
Related Commands
Parameters
| Name | Description | Required? | Pipeline Input | Default Value |
|---|---|---|---|---|
| UndeletionContainer | Specifies the distinguished name of the target container to which the objects will be restored. If this parameter is not specified, the objects are restored to the container from which they originated. | false | false | |
| NoReport | Use this parameter to not create any report about the restore operation. | false | false | |
| Backup | Specifies the backup that contains the AD objects to be restored. | true | true (ByPropertyName) | |
| Object | Specifies the distinguished names of the objects to be restored. If this parameter is omitted, the restore operation is performed on the root domain container in the domain whose backup you have specified. | false | false | |
| Recurse | Specifies to process child objects. Applies to the objects specified in the Object parameter or to the entire domain if the Object parameter is omitted. | false | false | |
| Attribute | Specifies the LDAP display names of the object attributes to be processed. If this parameter is omitted, all object attributes are processed. This parameter is ignored if the Recurse parameter is specified. | false | false | |
| ObjectType | Specifies LDAP display names for the child object types to be processed. This parameter is ignored if the Recurse parameter is omitted. | false | false | |
| ReportUnchangedAttributes | Includes the object attributes that have not changed since the time of the specified backup into the operation report. | false | false | |
| ReportUnchangedObjects | Includes the objects that have not changed since the time of the specified backup into the operation report. | false | false | |
| UseAgentlessMethod | Specifies to use the agentless method to access a domain controller. If this parameter is omitted, domain controller is accessed by using Restore Agent. | false | false | |
| DomainController | Specifies the target domain controller to connect to.
If this parameter is omitted or if you use the agent method, the connection is established to the domain controller whose backup you specified in the Backup parameter. This parameter is ignored if the UseAgentlessMethod parameter is omitted. | false | false | |
| Credential | The user name and password of the user account with which you want to connect, in the form of a PSCredential object. Use the Get-Credential cmdlet provided by Windows PowerShell to pass a PSCredential object to this parameter. If this parameter is omitted, the credentials of current user account are used. | false | false | |
| User | The user logon name of the account with which you want to connect, in the form Domain\UserName, or in the form of a user principal name. If this parameter is omitted, the user logon name of current user account is used. | false | false | |
| Password | The password of the user account with which you want to connect. Use the Read-Host cmdlet provided by Windows PowerShell to pass a SecureString object to this parameter. If this parameter is omitted, the password of current user account is used. Use this parameter only if you specify the User parameter. | false | false | |
| BackupPassword | Specifies the password to access a password-protected backup. This is the same password that is set in the computer collection properties in the Recovery Manager console. | false | false | |
| SqlLogin | Specifies the Microsoft SQL Server login account that has sufficient permissions to access the Recovery Manager reports database on the SQL Server. | false | false | |
| SqlPassword | Specifies the password that matches the Microsoft SQL Server login account specified in the SqlLogin parameter. | false | false |
Examples
Example
$b = (Get-RMBackup –Domain dom1.local | Sort-Object –Propert Date)[-1] Restore-RMActiveDirectoryObject –Backup $b.Path –Object "ou=ou1,dc=dom1,dc=local" –Recurse
In this example, the Get-RMBackup cmdlet gets all backups for the dom1.local domain. The Sort-Object cmdlet then sorts backups by their creation date. The most recent backup object from the list is saved in the $b variable. The Compare-RMActiveDirectoryObject cmdlet restores the ou=ou1,dc=dom1,dc=local object and all its children from the backup saved in the $b variable.
