Hello Jay,
For this purpose, you can use PowerShell scripts. You can create PowerShell scripts that import the properties you need and update user accounts. You can combine your scripts with Adaxes Business Rules, Custom Commands and Scheduled Tasks to perform import when a certain operation is performed, on request or on schedule.
For example, the following script imports new passwords for users from a CSV file:
Import-Module Adaxes
$file = "\\SERVER\Share\import.csv"
$usersToModify = Import-CSV $file
if ($usersToModify -eq $NULL)
{
$Context.LogMessage("Failed to read data from '$file'.", "Error")
return
}
$domain = $Context.GetObjectDomain("%distinguishedName%")
foreach ($item in $usersToModify)
{
try
{
$newPassword = ConvertTo-SecureString -AsPlainText $item.AccountPassword -Force
Set-AdmAccountPassword $item.SamAccountName -Reset -NewPassword $newPassword -AdaxesService localhost -Server $domain -ErrorAction Stop
}
catch [System.Exception]
{
$Context.LogMessage($_.Exception.Message, "Error")
}
}
In the script, $file specifies the path to the CSV file with user passwords. Modify the script to your requirements.
The CSV file should contain two columns. One of the columns should have the SamAccountName header. It will specify the User Logon Name (pre-Windows 2000) of the users, whose passwords need to be reset. The other column with header AccountPassword will contain the new passwords. Example of such a CSV file:
SamAccountName,AccountPassword
user1,p@$$w0rd1
user2,p@$$w0rd2
user3,p@$$w0rd3
To execute the script with the help of a Business Rule, Custom Command or Scheduled Task, you can use the Run a program or PowerShell script action. For example, to create a Scheduled Task that runs the script on a schedule:
- Create a new Scheduled Task.
- On the 3rd step of the Create Scheduled Task wizard, select Show all object types and select the Domain-DNS object type.
- On the 4th step, add the Run a program or PowerShell script action and paste the above script in the Script field.
- On the 5th step, include the domain, where you want to change passwords for users, in the Activity Scope of the Task.