Hello,
I have been working on a way that will allow us to provision accounts and enable them automatically on their specified start date. I'm using an extensionAttribute to write the date during account creation and then running a separate scheduled task to run a script that checks the current date vs their extensionAttribute date. The script runs in seconds when I run it from the powershell window, but the scheduled task runs indefinitely and is not activating accounts.
Any idea why the script isn't working when ran through Adaxes? (The service account running the script is a domain admin)
Import-Module Adaxes
$Date = Get-Date -format MM/dd/yy
$DisabledUsers = Get-ADmUser -Filter {enabled -ne $True -AND extensionAttribute2 -le $Date} -Properties extensionAttribute2
Foreach ($DisabledUser in $DisabledUsers)
{
Set-ADmUser $DisabledUser -Enabled $True -Clear "extensionAttribute2"
}
Exit
Thanks,