Hello Niclas,
Excuse us for a delay with your request.
To achieve the task, you need to create computer names with the help of a script. The script will be executed by a Business Rule triggered before creating a new computer.
During computer creation, for better performance, the last used sequence number will be stored by the rule in Adaxes configuration container. It will be stored in an Adaxes custom attribute of Adaxes configuration container, for example, CustomAttributeInt1.
Also, since computer creation is not possible without a name, you will need to create a pattern for creating initial computer names in the built-in Computer Pattern. That initial name will not be used anywhere, it will be necessary only to start creating the object. So, we suggest using a random sequence of characters here.
Thus, to achieve the task, you need to do the following:
- Create a Business Rule that generates sequential computer names
- Modify the Computer Pattern to generate an initial random name
i. Create a Business Rule that generates sequential computer names
To create such a rule:
-
Create a new Business Rule.
-
On the Step 2 of the Create Business Rule wizard, select Computer and Before Creating a Computer.
-
On the Step 3, add the Run a program or PowerShell script action and paste the following script from our Script Repository: Create object names in sequential order.
-
Modify the following parameters of the script:
- $numberProperty - specifies the property of Adaxes configuration container that will store the last used number;
- $objectNameFomrat - specifies how to format the object name;
- $objectCategory - specify computer;
- $initialNumber - specifies the starting number to use if there is no number saved in Adaxes configuration;
- $maxNumber - specifies the maximum number that can be assigned.
-
Enter a short description and click OK.
-
Click Next and specify where in Active Directory the rule will generate computer names. When done, click Finish.
ii. Modify the Computer Pattern to generate an initial random name
To modify the built-in Computer Pattern so it generates a random computer name:
- In Adaxes Administration Console, navigate to <Your_Adaxes_Service>\Configuration\Property Patterns\Builtin.
- Select Computer Pattern.
- Double-click Computer Name.
- In the Generate default value field, specify %admRandomString, 4%. This will generate a random name consisting of 4 characters.
- Click OK, then click Save changes.
Now, that computer names are generated automatically, you can remove computer name from the form for creating computers. For details, see the following tutorial, starting from step 6: http://www.adaxes.com/tutorials_WebInte ... tomization.