This data source will allow you to list all of your domain's computers inside of a dynamic form. This is useful for tasks that need modify computer objects, such as updating local administrator passwords or moving a computer from one OU to another.
Create the data source task
- Navigate to Automation > Tasks.
- Create a new custom PowerShell task and name it "DataSource: List all Active Directory computers"
- Select an appropriate agent pool to run the task.
- In the Task tab, deselect Use template.
- Paste in the following script and save the task.
# Get a list of all computers in the domain $objects = Get-ADComputer -Filter * | Select DistinguishedName,Name,ObjectGUID # Return the computer info to HelloID foreach($item in $objects) { $row = @{} $item.psobject.properties | Foreach { $row[$_.Name] = $_.Value.ToString() } Hid-Add-TaskResult -ResultValue $row }
Create the data source
- Navigate to Self Service > Data sources.
- Create a new data source with the name "Active Directory computers"
- In the Type dropdown, select Task Data Source.
- In the dropdown that appears, select your previously created data source task and click Execute task.
- When a result is returned by the task, click Suggest a model.
- Save the data source.