0 votes

Is it possible to export Business Rules and/or Custom Command, from the Admin Console, so that we can have a backup of the current setup?

I especially want to have a document of the Custom Commands and their IDs, which I'm using in PowerShell scripts.

by (730 points)

1 Answer

0 votes
by (216k points)

Hello,

It is possible to backup and restore the whole of Adaxes service configuration, including all Adaxes configuration objects (like Business Rules, Custom Commands, Property Patterns etc), local Adaxes log database, Password Self-Service Configuration and all information related to users who have already enrolled, everything that is stored on Adaxes backend, such as virtual properties, for example, SMS/Email settings etc. For more information, see Backup/Restore Service Configuration.

If you reinstall or upgrade Adaxes, you can restore the configuration and get everything back. For more information, see a description of the upgrade procedure in our Installation Notes: http://www.adaxes.com/resources/InstNotes.htm#upgrade.

If you want some kind of a human readable report with certain information on configuration objects, such as IDs of all Custom Commands, this is also possible. You can create a PowerShell script that generates such a report and saves it to a file or sends to a certain e-mail, for example. If you need such a script, we can help you writing it.

0

Yes, thank you. Can you please help me with a simple script that outputs the Custom commands (ID, Name, Description) to simple text/CSV file? Thank you

0

Yes, sure. We've asked our script guys to write a sample for you.

0

Here you are. To launch the script:

  1. Copy the following script and paste it to a text editor (e.g. notepad.exe).

     Param($csvFilePath)
    
     # Connect to Adaxes service
     $admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
     $admService = $admNS.GetServiceDirectly("localhost")
    
     # Bind to the 'Custom Commands' container
     $customCommandsPath = $admService.Backend.GetConfigurationContainerPath(
         "CustomCommands")
     $customCommandsContainer = $admService.OpenObject($customCommandsPath,
          $NULL, $NULL, 0)
    
     # Search all Custom Commands
     $customCommandsContainer.SearchFilter = "(objectCategory=adm-CustomCommand)"
     $customCommandsContainer.SearchScope = "ADS_SCOPE_SUBTREE"
     $searchResults = $customCommandsContainer.ExecuteSearch()
    
     $report = @()
    
     # Add Commands to the report
     foreach ($searchResult in $searchResults.FetchAll())
     {
         # Bind to the Custom Command
         $customCommand = $admService.OpenObject($searchResult.AdsPath,
              $NULL, $NULL, 0)
    
         # Name
         $name = $customCommand.Get("name")
    
         # Description
         try
         {
             $description = $customCommand.Get("description")
         }
         catch
         {
             $description = "<not set>"
         }
    
         # ID
         $commandIdBinary = $customCommand.Get("adm-CustomCommandID")
         $commandIdGuid = New-Object "System.Guid" (,$commandIdBinary)
         $commandId = $commandIdGuid.ToString("B")
    
         # Add command to the report
         $reportRecord = New-Object PSObject
         $reportRecord | Add-Member NoteProperty Name $name
         $reportRecord | Add-Member NoteProperty Description $description
         $reportRecord | Add-Member NoteProperty ID $commandId
         $report += $reportRecord
     }
     $searchResults.Dispose()
    
     # Export report to file
     if ($report.Length -gt 0)
     {
         $report | Export-Csv $csvFilePath -NoTypeInformation
     }
     else
     {
         Write-Host No Custom Commands Found! Nothing to export
     }
    
  2. Save the script to a file with a .ps1 extension, for example, Myscript.ps1.

  3. Copy the file with the script to the computer where your Adaxes service is installed.

  4. Log on to that computer with credentials of Adaxes default service administrator (the user that you specified during Adaxes installation).

  5. Launch Windows PowerShell. To do this:

    • Press Win+R.
    • Type powershell.exe.
    • Press Enter.
  6. Navigate to the directory where you copied the script. For example, if you copied it to C:\Scripts, type

     cd C:\Scripts
    
  7. Launch the script passing the name of the CSV file that will be created as the first parameter. For example, if you named the file with the script Myscript.ps1, type

     .\Myscript.ps1 custom.commands.csv
    

    where custom.commands.csv is the name of the CSV file that will be created in the same directory.

  8. Press enter to generate a report.

0

Can we export the 'Actions' from the Custom Commands to a readable file similar to the example script you have posted? For example, I have custom commands for each department that are assigned specific Security Groups. I would like to be able to get those exported easily without having to copy and paste each one.

0

Hi Support,

I have the same question as Patrick. I need to export those custom commands for our IT audit so the can see what our default templates are. Is this possible and do you maybe have a sample scipt?

Thanks in advance!

0

Hello guys,

We've compiled a script that allows exporting all Business Rules, Custom Commands and Scheduled Tasks in human-readable form. Have a look at the following script in our repository: Business Rules, Custom Commands and Scheduled Tasks report.

Related questions

0 votes
1 answer

I have a question: I have a security role that allows specific users to modify "extensionattribute2" in AD. Is it possible to create an approval for this that would ... manager of the target account to approve the change before it is really applied? Thanks!

asked Jan 16, 2012 by BradG (950 points)
0 votes
1 answer

Hello, We have some Create Business Rules with ifs and other actions. Now these have to be controlled by a third person who has no rights to the console. How can I export the ... to a .txt file? The TXT must contain the condition and the actions. Thanks a lot

asked Aug 10, 2023 by DRiVSSi (320 points)
0 votes
1 answer

Hi all, I need to update, during business rules, a custom Attribute with the last 5 characters from an other custom Attribute. EX: employeeNumber = 0123456789 adm- ... I received an error in substring function, can you help me? Thanks in advance

asked Nov 9, 2022 by Simone.Vailati (430 points)
0 votes
1 answer

Hi, our user objects are synced from HR system into AD and generated by a middleware - would a business rule "After creating a user" be triggered in this way or not? Looks ... for this? I need to control those tasks and would like to exit in case of issues

asked Jun 5, 2023 by wintec01 (1.5k points)
0 votes
1 answer

We'll be updating over 14K accounts with data (adding data to a virtual attribute) using a scheduled task but I don't want the updates to trigger Business Rules and flood the Adaxes log with entries. Is there an easy way to prevent this?

asked Apr 12, 2022 by sandramnc (870 points)
3,588 questions
3,277 answers
8,303 comments
548,096 users