< Back

New-ScheduledReminderJob

Sat Jan 18, 2020 4:56 pm

NAME New-ScheduledReminderJob



SYNOPSIS

Create a scheduled reminder background job.





SYNTAX

New-ScheduledReminderJob [-Message] <String> [-Minutes <Int32>] [-JobName <String>] [-Wait <Int32>] [-Confirm]

[-WhatIf] [-At <DateTime>] [<CommonParameters>]



New-ScheduledReminderJob [-Message] <String> [-JobName <String>] [-Wait <Int32>] [-Confirm] [-WhatIf] [-At

<DateTime>] [-Once] [<CommonParameters>]



New-ScheduledReminderJob [-Message] <String> [-JobName <String>] [-Wait <Int32>] [-Confirm] [-WhatIf] [-At

<DateTime>] -DaysOfWeek <DayOfWeek[]> [-Weekly] [-WeeksInterval <Int32>] [<CommonParameters>]



New-ScheduledReminderJob [-Message] <String> [-JobName <String>] [-Wait <Int32>] [-Confirm] [-WhatIf] [-At

<DateTime>] [-Daily] [-DaysInterval <Int32>] [<CommonParameters>]





DESCRIPTION

This command uses the MSG.EXE command line tool to send a reminder message to the currently logged on user,

presumably yourself. The intention is to set ad-hoc popup reminders for the current user. The message will

automatically dismiss after 1 minute unless you use the Wait parameter.



You can schedule the reminder for a certain number of minutes set the reminder to run at a specific date and time.

The default is to schedule a reminder in 1 minute. You can also create recurring daily or weekly reminders.



The function creates a scheduled background job so that you can close your PowerShell session without losing the

job as well as persisting during reboots. The scheduled job will be removed upon completion. You can use the

scheduled job cmdlets to view and modify any scheduled reminder job..





PARAMETERS

-Message <String>

The text to display in the popup from MSG.EXE. This should not be an exceptionally long message. You should

also try to avoid using single or double quotes. Although single quotes should be automatically turned into

curly quotes. If you don't see your message, it may be because msg.exe can't display it.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Minutes <Int32>

The number of minutes to wait before displaying the popup message. This is the default behavior.



Required? false

Position? named

Default value 1

Accept pipeline input? False

Accept wildcard characters? false



-JobName <String>

A name to assign to the job. If you don't specify a name, the function will use the name Reminder-N where N is

an incrementing counter starting at 1. This parameter has an alias of Name.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Wait <Int32>

The number of minutes to display the message before it automatically is dismissed. The default is 1 minute.



Required? false

Position? named

Default value 1

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-At <DateTime>

Starts the job at the specified date and time. Enter a DateTime object, such as one that the Get-Date cmdlet

returns, or a string that can be converted to a date and time, such as "April 19, 2018 15:00", "12/31", or

"3am".



You do not need to specify a value if creating a reminder using -Minutes.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Daily [<SwitchParameter>]

Run the reminder daily.



Required? false

Position? named

Default value False

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DaysInterval <Int32>

Specifies the number of days between occurrences on a daily schedule. For example, a value of 3 starts the

scheduled job on days 1, 4, 7 and so on. The default value is 1.



Required? false

Position? named

Default value 1

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DaysOfWeek <DayOfWeek[]>

Specifies the days of the week on which a weekly scheduled job runs. Enter day names, such as "Monday" or

integers 0-6 where 0 represents Sunday. This parameter is required in the Weekly parameter set.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Once [<SwitchParameter>]

Set a one-time reminder.



Required? false

Position? named

Default value False

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Weekly [<SwitchParameter>]

Set a weekly reminder. You will also need to specify the days of the week.



Required? false

Position? named

Default value False

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-WeeksInterval <Int32>

Specifies the number of weeks between occurrences on a weekly job schedule. For example, a value of 3 starts

the scheduled job on weeks 1, 4, 7 and so on. The default value is 1.



Required? false

Position? named

Default value 1

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None







OUTPUTS

[My.ScheduledReminder]







NOTES





Learn more about PowerShell: http://jdhitsolutions.com/blog/essentia ... resources/



-------------------------- Example 1 --------------------------



PS C:\\> new-scheduledreminderjob "Switch over laundry" -minutes 40 -name SwitchLaundry



ID Name Schedule When TimeRemaining Wait(Min) Message

-- ---- -------- ---- ------------- --------- -------

12 SwitchLaundry Once 9/26/2018 12:57:26 PM 00:39:58 1 Switch over laundry



This command creates a new job that will display a message in 40 minutes. The message will be displayed for 1

minute, which is the default.

-------------------------- Example 2 --------------------------



PS C:\\> new-scheduledreminderjob "Go home" -time "5:00PM" -wait 2 -once



ID Name Schedule When TimeRemaining Wait(Min) Message

-- ---- -------- ---- ------------- --------- -------

11 Reminder-4 Once 9/26/2018 5:00:00 PM 04:42:59 2 Go home



Create a reminder to be displayed at 5:00PM today for 2 minutes using the default naming pattern. This example is

using the time alias for the -At parameter.

-------------------------- Example 3 --------------------------



PS C:\\> new-scheduledreminderjob -name "standup" -message "Weekly standup meeting at 1:00" -at "12:50PM" -weekly

-daysofWeek Friday -wait 5



ID Name Schedule When TimeRemaining Wait(Min) Message

-- ---- -------- ---- ------------- --------- -------

13 standup Weekly 9/28/2018 12:50:00 PM 2.00:30:35 5 Weekly standup meeting at 1:00



Create a weekly popup reminder for every Friday at 12:50PM. The message will displayed for 5 minutes.



RELATED LINKS

Get-ScheduledReminderJob

msg.exe

Register-ScheduledJob