{"id":3865,"date":"2014-05-27T15:28:11","date_gmt":"2014-05-27T19:28:11","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=3865"},"modified":"2014-05-27T15:28:11","modified_gmt":"2014-05-27T19:28:11","slug":"powershell-reminder-jobs","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/","title":{"rendered":"PowerShell Reminder Jobs"},"content":{"rendered":"<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/timer.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/timer.png\" alt=\"timer\" width=\"152\" height=\"114\" class=\"alignleft size-full wp-image-3866\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/timer.png 152w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/timer-150x114.png 150w\" sizes=\"auto, (max-width: 152px) 100vw, 152px\" \/><\/a>This is something that might be better suited to one of my Friday Fun columns, but I'm enjoying this so much I couldn't wait to share it. I don't know about you but I spend much of my day in PowerShell or at least with a PowerShell session running. I have an ongoing quest to do as much as I can from PowerShell. This includes just about any sort of task that might be automated.<\/p>\n<p>In the past I've blogged about my <a href=\"http:\/\/jdhitsolutions.com\/blog\/2013\/05\/friday-fun-a-powershell-tickler\/\" title=\"Friday Fun: A PowerShell Tickler\" target=\"_blank\">tickle system<\/a> that  run when I start PowerShell. But often I have short term tickler or reminder needs. For example, since I work at home I may need to remember to switch over the laundry or that I have a phone call at 2:00PM. Sure, I could set up calendar alerts in an email client but I'd rather have something as quick and easy as a PowerShell command. So I wrote this script, New-Reminderjob.ps1.<\/p>\n<pre class=\"lang:ps decode:true \" >#requires -version 3.0\r\n\r\n&lt;#\r\n.Synopsis\r\nCreate a reminder background job.\r\n.Description\r\nThis command uses the MSG.EXE command line tool to send a reminder message to currently logged on user. You can specify how many minutes to wait before displaying the message or you can set the alert to run at a specific date and time.\r\n\r\nThis command creates a background job in the current PowerShell session. If you close the session, the job will also be removed. This command is intended to set ad-hoc reminders for the current user. The message will automatically dismiss after 1 minute unless you use -Wait.\r\n\r\nEven though Start-Job doesn't support -WhatIf, this command does. This script will also add some custom properties to the job object so that you can track that status of your reminders. See the examples.\r\n\r\nNOTE: Be aware that each running reminder will start a new PowerShell process.\r\n.Parameter Message\r\nThe text to display in the popup.\r\n.Parameter Time\r\nThe date and time to display the popup. If you enter just a time, it will default to the current day. See examples. \r\nThis parameter has aliases of date and dt. \r\n.Parameter Minutes\r\nThe number of minutes to wait before displaying the popup message.\r\n.Parameter Wait\r\nForce the user to acknowledge the popup message.\r\n.Example\r\nPS C:\\&gt; c:\\scripts\\new-reminderjob.ps1 \"Switch over laundry\" -minutes 40 -wait\r\n\r\nThis command creates a new job that will display a message in 40 minutes and wait for the user to acknowledge.\r\n.Example\r\nPS C:\\&gt; c:\\scripts\\new-reminderjob.ps1 \"Go home\" -time \"5:00PM\" -passthru\r\n\r\nId   Name         PSJobTypeName   State      HasMoreData     Location     Command         \r\n--   ----         -------------   -----      -----------     --------     -------         \r\n49   Reminder7    BackgroundJob   Running    True            localhost    ...      \r\n\r\nCreate a reminder to be displayed at 5:00PM today. The job object is written to the pipeline because of -Passthru\r\n.Example\r\nPS C:\\&gt; get-job remind* | Sort Time | Select ID,Name,State,Message,Time,Wait | format-table -auto\r\n\r\nId Name      State   Message             Time                 Wait\r\n-- ----      -----   -------             ----                 ----\r\n67 Reminder1 Running switch over laundry 5\/27\/2014 2:34:33 PM True\r\n69 Reminder2 Running Budget meeting      5\/27\/2014 3:00:00 PM False\r\n71 Reminder3 Running reboot WSUS         5\/27\/2014 3:21:33 PM False\r\n\r\nIn this example, PowerShell is getting all reminder jobs sorted by the time they will \"kick off\" and displays the necessary properties.\r\n.Notes\r\nLast Updated: 5\/27\/2014\r\nVersion     : 0.9\r\nAuthor      : Jeff Hicks (@JeffHicks)\r\n              http:\/\/jdhitsolutions.com\/blog\r\n\r\nLearn more:\r\n PowerShell in Depth: An Administrator's Guide (http:\/\/www.manning.com\/jones2\/)\r\n PowerShell Deep Dives (http:\/\/manning.com\/hicks\/)\r\n Learn PowerShell 3 in a Month of Lunches (http:\/\/manning.com\/jones3\/)\r\n Learn PowerShell Toolmaking in a Month of Lunches (http:\/\/manning.com\/jones4\/)\r\n   \r\n  ****************************************************************\r\n  * DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE TESTED *\r\n  * THOROUGHLY IN A LAB ENVIRONMENT. USE AT YOUR OWN RISK.  IF   *\r\n  * YOU DO NOT UNDERSTAND WHAT THIS SCRIPT DOES OR HOW IT WORKS, *\r\n  * DO NOT USE IT OUTSIDE OF A SECURE, TEST SETTING.             *\r\n  ****************************************************************\r\n\r\n.Link\r\nhttp:\/\/jdhitsolutions.com\/blog\/2014\/05\/powershell-reminder-jobs\r\n.Link\r\nmsg.exe\r\nStart-Sleep\r\nStart-Job\r\n.Inputs\r\nNone\r\n.Outputs\r\ncustom System.Management.Automation.PSRemotingJob\r\n#&gt;\r\n\r\n[cmdletbinding(DefaultParameterSetName=\"Minutes\",SupportsShouldProcess)]\r\nParam(\r\n[Parameter(Position=0,Mandatory,HelpMessage=\"Enter the alert message text\")]\r\n[string]$Message,\r\n[Parameter(ParameterSetName=\"Time\")]\r\n[ValidateNotNullorEmpty()]\r\n[Alias(\"date\",\"dt\")]\r\n[datetime]$Time,\r\n[Parameter(ParameterSetName=\"Minutes\")]\r\n[ValidateNotNullorEmpty()]\r\n[int]$Minutes=1,\r\n[switch]$Wait,\r\n[switch]$Passthru\r\n)\r\n\r\nBegin {\r\n    Write-Verbose -Message \"Starting $($MyInvocation.Mycommand)\"  \r\n    Write-Verbose -Message \"Using parameter set $($PSCmdlet.ParameterSetName)\"\r\n    Switch ($PSCmdlet.ParameterSetName) {\r\n    \"Time\" { [int]$sleep = ($Time - (Get-Date)).TotalSeconds  }\r\n    \"Minutes\" { [int]$sleep = $minutes*60}\r\n    }\r\n\r\n    #get last job ID\r\n    $lastjob = Get-Job -Name \"Reminder*\" | sort ID | select -last 1\r\n    \r\n    if ($lastjob) {\r\n        #define a regular expression\r\n        [regex]$rx =\"\\d+$\"\r\n        [string]$counter = ([int]$rx.Match($lastJob.name).Value +1)\r\n    }\r\n    else {\r\n        [string]$counter = 1\r\n    }\r\n} #begin\r\n\r\nProcess {\r\n    Write-Verbose -message \"Sleeping for $sleep seconds\"\r\n    $sb = {\r\n    Param($sleep,$cmd)\r\n    Start-Sleep -seconds $sleep ; Invoke-Expression $cmd\r\n    }\r\n    \r\n    [string]$cmd = \"msg.exe $env:username\"\r\n    if ($Wait) {\r\n        Write-Verbose \"Reminder will wait for user\"\r\n        $cmd+=\" \/W\"\r\n    }\r\n\r\n    $cmd+=\" $message\"\r\n    \r\n    $jobName = \"Reminder$Counter\"\r\n    Write-Verbose -Message \"Creating job $jobname\"\r\n\r\n    #WhatIf\r\n    $whatif = \"'{0}' in {1} seconds\" -f $message,$sleep\r\n    if ($PSCmdlet.ShouldProcess( $whatif )) {\r\n     $job = Start-Job -ScriptBlock $sb -ArgumentList $sleep,$cmd -Name $jobName \r\n     #add some custom properties to the job object\r\n     $job | Add-Member -MemberType NoteProperty -Name Message -Value $message\r\n     $job | Add-Member -MemberType NoteProperty -Name Time -Value (Get-Date).AddSeconds($sleep)\r\n     $job | Add-Member -MemberType NoteProperty -Name Wait -Value $Wait\r\n     if ($passthru) {\r\n      #if -Passthru write the job object to the pipeline\r\n      $job\r\n     }\r\n    }\r\n} #process\r\n\r\nEnd {\r\n    Write-Verbose -Message \"Do not close this PowerShell session or you will lose the reminder job\"\r\n    Write-Verbose -Message \"Ending $($MyInvocation.Mycommand)\"\r\n} #end\r\n<\/pre>\n<p>In short, the script creates a background job that will use the MSG.EXE command line tool to display a message to myself. The job action sleeps the specified number of seconds and then runs my MSG.EXE command. I could have used a variety of ways to display the message, but MSG.EXE is built in and I didn't see any reason to re-invent the wheel.<\/p>\n<p>The script, which you could revise into a function if you want, requires the reminder text and then when to \"deliver\" the reminder. You can specify a number of minutes, the default is 1, or a date and\/or time. If you specify a time like \"9:00AM\" the script will assume you mean 9AM today. The script converts your start time into a number of seconds it has to wait and builds that into the job scriptblock.<\/p>\n<pre class=\"lang:ps decode:true \" >PS C:\\scripts&gt; .\\New-ReminderJob.ps1 \"Budget meeting\" -date \"5\/27\/2014 3:00PM\" -wait<\/pre>\n<p>When the time comes I get a popup message like this.<br \/>\n<a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/msg01.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/msg01-300x150.png\" alt=\"msg01\" width=\"300\" height=\"150\" class=\"aligncenter size-medium wp-image-3868\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/msg01-300x150.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/msg01.png 308w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nThe message will automatically dismiss after about 1 minute. Or I've configure my script to allow you to require that you acknowledge the message through the -Wait parameter. This is useful for important reminders you want to make sure you don't miss.<\/p>\n<p>Because I might have several daily reminders, I wanted an easy way to identify them. One thing I did with my script is to give all of my reminder jobs a custom name that starts with 'Reminder'. I use a regular expression to find the number from the most recent reminder job and increment it by one. The other useful step is that I added some custom properties to the job object itself. These properties embed values from the script into the job object. Now I can do interesting commands like this:<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/msg02.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/msg02-300x62.png\" alt=\"msg02\" width=\"300\" height=\"62\" class=\"aligncenter size-medium wp-image-3869\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/msg02-300x62.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/msg02-1024x212.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/msg02.png 1096w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The custom properties have no effect on any other job objects. If I find myself using these properties a lot, I might create some additional functions to save some typing.<\/p>\n<p>This system is meant for ad-hoc, daily reminders to myself which is why I didn't use scheduled jobs. I didn't want to have to deal with cleaning up a bunch of one time jobs. These reminder jobs only last for as long as my PowerShell session is open. But be aware, that each running reminder will start a new PowerShell process so I wouldn't recommend setting this up with dozens of reminders. Actually, if you need that many reminders you either need to get a new job or an assistant!<\/p>\n<p>I hope you'll try it out and let me know what you think or where you think it can be improved. Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is something that might be better suited to one of my Friday Fun columns, but I&#8217;m enjoying this so much I couldn&#8217;t wait to share it. I don&#8217;t know about you but I spend much of my day in PowerShell or at least with a PowerShell session running. I have an ongoing quest to&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"#PowerShell Reminder Jobs http:\/\/wp.me\/p1nF6U-10l","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8,99,380],"tags":[465,438,534,540],"class_list":["post-3865","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","category-windows-7","category-windows-8","tag-background-job","tag-job","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PowerShell Reminder Jobs &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PowerShell Reminder Jobs &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"This is something that might be better suited to one of my Friday Fun columns, but I&#039;m enjoying this so much I couldn&#039;t wait to share it. I don&#039;t know about you but I spend much of my day in PowerShell or at least with a PowerShell session running. I have an ongoing quest to...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2014-05-27T19:28:11+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/timer.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3865\\\/powershell-reminder-jobs\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3865\\\/powershell-reminder-jobs\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"PowerShell Reminder Jobs\",\"datePublished\":\"2014-05-27T19:28:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3865\\\/powershell-reminder-jobs\\\/\"},\"wordCount\":601,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3865\\\/powershell-reminder-jobs\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/05\\\/timer.png\",\"keywords\":[\"Background Job\",\"Job\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"PowerShell\",\"Scripting\",\"Windows 7\",\"Windows 8\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3865\\\/powershell-reminder-jobs\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3865\\\/powershell-reminder-jobs\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3865\\\/powershell-reminder-jobs\\\/\",\"name\":\"PowerShell Reminder Jobs &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3865\\\/powershell-reminder-jobs\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3865\\\/powershell-reminder-jobs\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/05\\\/timer.png\",\"datePublished\":\"2014-05-27T19:28:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3865\\\/powershell-reminder-jobs\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3865\\\/powershell-reminder-jobs\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3865\\\/powershell-reminder-jobs\\\/#primaryimage\",\"url\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/05\\\/timer.png\",\"contentUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/05\\\/timer.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3865\\\/powershell-reminder-jobs\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PowerShell Reminder Jobs\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PowerShell Reminder Jobs &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/","og_locale":"en_US","og_type":"article","og_title":"PowerShell Reminder Jobs &#8226; The Lonely Administrator","og_description":"This is something that might be better suited to one of my Friday Fun columns, but I'm enjoying this so much I couldn't wait to share it. I don't know about you but I spend much of my day in PowerShell or at least with a PowerShell session running. I have an ongoing quest to...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/","og_site_name":"The Lonely Administrator","article_published_time":"2014-05-27T19:28:11+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/timer.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"PowerShell Reminder Jobs","datePublished":"2014-05-27T19:28:11+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/"},"wordCount":601,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/timer.png","keywords":["Background Job","Job","PowerShell","Scripting"],"articleSection":["PowerShell","Scripting","Windows 7","Windows 8"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/","name":"PowerShell Reminder Jobs &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/timer.png","datePublished":"2014-05-27T19:28:11+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/#primaryimage","url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/timer.png","contentUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/05\/timer.png"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3865\/powershell-reminder-jobs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"PowerShell Reminder Jobs"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1036,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1036\/join-me-in-orlando\/","url_meta":{"origin":3865,"position":0},"title":"Join Me in Orlando","author":"Jeffery Hicks","date":"December 30, 2010","format":false,"excerpt":"I will be presenting 3 sessions at Techmentor Orlando 2011. The conference runs March 14-18, 2011 at the Disney Yacht Club. My sessions are all on Wednesday March 16. In addition to all the other fabulous material at the conference I will be presenting the following: PowerShell Scripting Best Practices\u2026","rel":"","context":"In &quot;Active Directory&quot;","block_context":{"text":"Active Directory","link":"https:\/\/jdhitsolutions.com\/blog\/category\/active-directory\/"},"img":{"alt_text":"Disney Yacht Club","src":"https:\/\/i0.wp.com\/techmentorevents.com\/design\/ecg\/techmentorevents\/home\/img\/portal_2011spring.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":7361,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/7361\/powershell-7-cross-platform-scripting-tips-and-traps\/","url_meta":{"origin":3865,"position":1},"title":"PowerShell 7 Cross-Platform Scripting Tips and Traps","author":"Jeffery Hicks","date":"March 13, 2020","format":false,"excerpt":"One of the reasons you want to adopt PowerShell 7 on your desktop, is that it can\u00a0 be used cross-platform. Theoretically, you can write a PowerShell script or function that works on Windows, Linux, and Mac. However, this is not without challenges. In some ways, it feels like we are\u2026","rel":"","context":"In &quot;PowerShell 7&quot;","block_context":{"text":"PowerShell 7","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-7\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/03\/hicks-scripting-4.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/03\/hicks-scripting-4.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/03\/hicks-scripting-4.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/03\/hicks-scripting-4.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":912,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/912\/powershell-is-not-ominipotent\/","url_meta":{"origin":3865,"position":2},"title":"PowerShell Is Not Omnipotent","author":"Jeffery Hicks","date":"September 7, 2010","format":false,"excerpt":"Last week I was working on a problem in a PowerShell forum. The admin was having problems getting Add-Computer to work. After a bit of \"try this\/try that\" something became clear, and it's something that is easy to overlook. Especially when we get lulled into thinking PowerShell is omnipotent. Now,\u2026","rel":"","context":"In &quot;Best Practices&quot;","block_context":{"text":"Best Practices","link":"https:\/\/jdhitsolutions.com\/blog\/category\/best-practices\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":92,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/92\/powershell-dba\/","url_meta":{"origin":3865,"position":3},"title":"PowerShell DBA","author":"Jeffery Hicks","date":"January 26, 2007","format":false,"excerpt":"There is a very nice review of the new Powershell book at : http:\/\/weblog.infoworld.com\/dbunderground\/archives\/2007\/01\/rtfm.html. I'm glad he likes the book, even though he doesn't know who I am. But I'm working on it!! Anyway, the interesting point in his review is that he is looking at PowerShell from the perspective\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":343,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/343\/revising-windows-powershell-tfm-3rd\/","url_meta":{"origin":3865,"position":4},"title":"Revising Windows PowerShell: TFM 3rd","author":"Jeffery Hicks","date":"August 21, 2009","format":false,"excerpt":"I know there was some concern related to my departure from SAPIEN about the status of the Windows PowerShell: TFM book. You\u2019ll be happy to know that Don Jones and I are both involved now in the final revisions.\u00a0 SAPIEN is very committed to this project and supporting the PowerShell\u2026","rel":"","context":"In &quot;Books&quot;","block_context":{"text":"Books","link":"https:\/\/jdhitsolutions.com\/blog\/category\/books\/"},"img":{"alt_text":"header_sapien_press","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2009\/08\/header_sapien_press.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":8787,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8787\/prerelease-of-psfunctiontools-for-powershell\/","url_meta":{"origin":3865,"position":5},"title":"Prerelease of PSFunctionTools for PowerShell","author":"Jeffery Hicks","date":"January 13, 2022","format":false,"excerpt":"At the end of last year wrote a series of blog posts describing tools and techniques for working with PowerShell scripts and functions. My goal was to build a framework of tools that I could use to automate PowerShell scripting work, such as creating a new module from a group\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/psfunctiontools-commands.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/psfunctiontools-commands.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/psfunctiontools-commands.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/psfunctiontools-commands.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/psfunctiontools-commands.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2022\/01\/psfunctiontools-commands.png?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=3865"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3865\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=3865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=3865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=3865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}