I'm having trouble with my script. Everytime I try it, I get this error message:
Get-ADUser cannot find an object with identity
But the user does exist. Here is how im getting all users from a specific group in my case it's "All-users":
[array]$u = Get-ADGroupMember $userset
After that getting users one by one to change password and send them email:
$u[$a] = Get-ADUser $u[$a] -Properties PasswordExpired, Enabled, PasswordNeverExpires, Mobile
Error screen (but it's in russian): error screen