Michael Kullish
Thank you all for your efforts to make this a reality. This is going to be a huge help for my organization.
I have followed the new procedure and it worked well but I set myself up as the test recipient but didn't receive any emails for those employees qualify for the number of days I entered into the script. I am seeing the following on one that should have gone through:
Invoke-RestMethod : The remote server returned an error: (401) Unauthorized.
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PWExpireNotification-main\src\PWExpireNotification\1.0.0\Functions\Send-PWExpiringMailMe
ssage.ps1:91 char:17
+ ... Invoke-RestMethod -Headers @{Authorization = "Bearer $($t ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Can you help determine why I would be getting this message?
Thanks in advance!