@Rich Matheisen
I'm attaching the log file in which I record the execution of the cmdlets manually and via the task scheduler; each is noted in the file.
The Task Scheduler version errors out right after the New-Object System.Management.Automation.PSCredential -ArgumentList $username, $password execution.
The error in the email is Exception calling ".ctor" with "2" argument(s): "Cannot process argument because the value of argument "password" is null. Change the value of argument "password" to a non-null value.".
That is all the information that is provided.
I also did a if statement "if ($password -eq $null) { "write out to file $password is null"}". This is executed via the Task scheduler, but not when I kick off the script manually.
At this point I don't know if anything has been updated on the server by Admin that would cause this issue190617-04062022-logfile.txt. This is a test server. I could try running it on the prod server since it's not a data changing script.