Is there anyone willing to help me figure out why I can't get this script to display expires on a friendly looking date? I've added the following and thought I had it right, tested manually the variables and it shows properly but when I run this script it doesn't show the correct date.
I'm happy to send the entire script to someone but I've also copy pasted below what I did. Help please if anyone is able and willing I'd greatly appreciate it. I'm trying to have the subject line show the variable results $expirationsdatesubjectline, instead of just x number of days as the original script does. Unfortunately went out today and all those that fit the formula were told their passwords expired today 😞
$date = Get-Date -format ddMMyyyy
$dateFormat = 'MM-dd-yyy'
$messageDays = $daystoexpire
$expirationdate=(Get-Date).AddDays($daystoexpire)
$expirationdatesubjectline= Get-Date -Date $expirationdate -Format $dateFormat