Solved

Scripted way to restore multiple on-prem AD Accounts

  • 23 February 2023
  • 2 replies
  • 84 views

Badge +3

I have a list of many users to restore and would prefer not to have to go click happy to restore the users.

Ideally something simple like powershell and a foreach loop for the usernames.

The rest api would work to but I saw no reference in any of the tools to restore AD Objects?

 

Please Advise.

icon

Best answer by Graham Swift 2 March 2023, 23:26

View original

2 replies

Badge +3

Hi Scott,

There is an option to save the restore from the GUI to a file using “Save as a script”. Once you have the xml file, it can be edited to add more objects.

Please refer to the BOL. - https://documentation.commvault.com/2022e/expert/14588_command_line_interface_restore_active_directory_idataagent.html

 

Hope this helps.

Regards

Venu Kondabhathini

 

 

 

 

 

Userlevel 4
Badge +10

I have seen these instructions sent in a few cases.

Create restore scripts for each item:

  1. Browse and restore and select the option to store a job to a file. After saving the job to a file, you can see a xml file which include restore objects.
  2. In the below example xml file, you can see we put comments at the end of sourceitem when we do attribute restore (check the XML is correct this may be out of date)
    <fileOption> 
    <sourceItem>,DC=com,DC=commvault,DC=jungles,OU=TESTOU,CN=qlu,codePage</sourceItem>
    <sourceItem>,DC=com,DC=commvault,DC=jungles,OU=TESTOU,CN=testuser,comments</sourceItem>
    <browseFilters>&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;databrowse_Query type="0" queryId="0"&gt;&lt;dataParam&gt;&lt;paging firstNode="0" pageSize="1000" skipNode="0" /&gt;&lt;/dataParam&gt;&lt;/databrowse_Query&gt;</browseFilters>
    </fileOption>

     

  3. Use 3rd party tool or ldap to query all users in their domain, then get all DN exported (for example run the following command in a DC powershell window)
    get-adobject -LDAPFilter "(objectClass=user)" | select DistinguishedName

     

  4. Manually edit the xml file, add “,DN,comment” in sourceitem fileld.
  5. Run the restore job.

Note: For the last option, a separate script would have to be created for each attribute to be restored for each user.

You could do something similar via a workflow and build out the sourceItem information based on a csv/text input.

Reply