This section describes how to synchronize categorization data for VMware vSphere using a sample Microsoft PowerShell script. The script creates a CSV file based on Active Directory data. To follow this example, make sure Microsoft PowerShell installed on the Veeam ONE Server.
Step 1. Create a Script
Create a script file named AD2CSV.ps1 which uses Active Directory infrastructure data to create a CSV file with a categorization model.
A sample script is provided below:
#define maps. Map groups and categories to specific folder in AD
Step 2. Create a Batch File That Calls the Script
Create a batch file named Script.bat that runs a command to call AD2CSV.ps1 and output its results to the resultFile.csv file. An example of the command for the batch file is provided below:
cmd /c start /wait powershell -command "& 'C:\AD2CSV.ps1' MyVC c:\resultFile.csv"
Note that you need to replace 'MyVC' with the name of the vCenter Server you are using.
Step 3. Specify Paths to the .CSV and Script Files
Specify paths to the CSV file and the script file in Veeam ONE Business View:
- Open Veeam Backup & Replication.
- Open the Configuration tab.
- In the Configuration menu on the left, click Import/Export.
- In the Specify a CSV file to be used for tags synchronization field, specify a path to the resultFile.csv file.
- Select the Execute this script before synchronizing with a CSV file check box and specify a path to the Script.bat file in the field below.
When Veeam ONE runs data collection for Veeam ONE Business View, it will call the batch file. The batch file will execute a script that will create an output CSV file with the categorization data. Data from this CSV file will be imported in Veeam ONE Business View. This way Veeam ONE Business View categorization will be synchronized with Active Directory.
You can also configure the synchronization without the script file. In this case, you will need to specify the path to the CSV file and update it manually when needed. However, using the script file allows you automate these updates if your environment changes frequently.