trying figure out way of setting recurring emails not require human interaction or use of third-party software. point behind use specific mailbox sending emails ticketing system in order have scheduled tasks completed when supposed to. need able use attachments solution. know of way automatically instead of me sitting hours setting delayed emails?
the nice thing powershell (or scripting) can perform conditional checks before executing code. allows run script every day , check whether indeed last weekday of month. if is, continue script , otherwise exit it.
i don't have code pseudo code/logic this;
end date of current month = current month + 1 month - 1 day (automatically gives 28, 29, 30 or 31)
determine day name of end date of the current month
if sunday; last weekday date of current month = end date of current month - 2
if saturday; last weekday date of current month = end date of current month - 1
if current date = last weekday date of current month; execute code
else: exit
you can name of current day using; (get-date).dayofweek. works date variable though.
for more info on working dates in powershell, see;
an alternative approach hardcode dates in array , check ;-)
Office / Outlook / Microsoft Office Programming / Office 2016
Comments
Post a Comment