I am trying to run a ps1 file sending one paramter. This script is to unlock account on AD.
My ps1 file is:
Param([string]$user="")
Get-ADUser -Properties * -Filter {mail -like "$user"} |
Unlock-ADAccount |
Sync-ADObject -Destination "AZUDCMO01"
And I called it using:
PS C:\Users\fornecedor.bmc01> .\bmc_unlock_ad.ps1 "andreza.perez@grupomoura.com"
No error is returned, but the account is still locked.
Anyone tried this way to unlock accounts?