***USE AT YOUR OWN RISK***
The following script reads a CSV file list of usernames and clears their "comment" attribute in Active Directory. This can be useful when dealing with Quest One Password Manager which uses the "comment" attribute, by default, to store user profile information. Please note that this script makes use of the ActiveRoles Management Shell cmdlets.
## Begin Script
function Get-ScriptDirectory
{
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
Split-Path $Invocation.MyCommand.Path
}
$workingDirectory = Get-ScriptDirectory
$inputFilePath = Join-Path $workingDirectory "users.csv"
Import-Csv($inputFilePath) | ForEach-Object {
Set-QADUser -Identity $_.username -ObjectAttributes @{'comment'=$null}
#Get-QADUser -identity $_.username -includeAllProperties | Format-List comment
}
## End Script
The "users.csv" must be located in the same folder location as the script itself. The very first line of the "users.csv" file must only contain the word "username", all lower case. I have attached a blank "users.csv" as a template. Place each user's username on a new line below first line containing "username".