Scripted way to restore multiple on-prem AD Accounts

  • 23 February 2023
  • 2 replies

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.


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. -


Hope this helps.


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)
    <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>


  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.