This script requires the ActiveDirectory PowerShell module and appropriate permissions. To unlock accounts, the user must have Account Lockout and Management permissions.