I'm receiving a 404 error on users who I believe should be receiving this email.
Looks like "New-PWEmailBody" is not recognized could be a problem?
VERBOSE: User Account: <first last>, ExpiresOn: 5/15/2022 5:29:48 PM, Days: 33
VERBOSE: EmailAddress to recieve email: <my test email>
New-PWEmailBody : The term 'New-PWEmailBody' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At C:\Program Files\WindowsPowerShell\Modules\PWExpireNotification\1.0.0\Functions\Send-PWExpiringMailMessage.ps1:76
char:17
+ $body = New-PWEmailBody -Subject $subject -Importance 'High' ...
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (New-PWEmailBody:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
VERBOSE: https://graph.microsoft.com/v1.0/users/noreply.domain.com/sendMail
VERBOSE: Using Token:
<token>
VERBOSE: Payload:
VERBOSE: POST https://graph.microsoft.com/v1.0/users/noreply.domain.com/sendMail with 0-byte payload
Invoke-RestMethod : The remote server returned an error: (404) Not Found.
At C:\Program Files\WindowsPowerShell\Modules\PWExpireNotification\1.0.0\Functions\Send-PWExpiringMailMessage.ps1:91
char:17
+ ... Invoke-RestMethod -Headers @{Authorization = "Bearer $($t ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand