TIP: Custom Install Dialog/Prompt with Proceed/Wait timer for user

Comments

10 comments

  • Callan Johnstone

    Such a huge help! Thank you a bunch for sharing!

    Would give cookies if i could.

    1
    Comment actions Permalink
  • Michael Yorke

    Brilliant post. Thanks for taking the time to share. 

    It would be great to have this level of functionality and message customisation baked into PDQ.

    One question. How can I put an expiry timer on the message and upon expiration choose a exitcode? I looked on Trevor's blog and whilst I found references to the timer in the code, I wasn't sure where the put the timeout values and how to handle the action upon expiration. 

    0
    Comment actions Permalink
  • Sam Cayze

    Actually I've moved away from the solution I posted about, and switched to this: 

    https://gallery.technet.microsoft.com/Windows-10-Toast-9f228eb1

    https://www.imab.dk/windows-10-toast-notification-script/

     

    0
    Comment actions Permalink
  • Thomas Lockyer

    Hi Sam, could you go into a little further detail on how you use the Toast Notification Script in your deployments? It looks pretty handy. I wish PDQ had something like this built in.

    0
    Comment actions Permalink
  • Hayden Searle

    Late to the party, but I've started using the new script that Sam mentioned as well and with my limited powershell knowledge I was wondering if anyone had tips on how to use this to give users the ability to install the update now or to snooze till later? The documentation for it is relatively sparse and geared towards SCCM, so I'm hoping someone has enabled these settings and can let me know how to get the Action Button to run a specific PDQ task? The task I need to perform is to install the mimecast plugin so I'd like to allow the users the option to continue the install which will close outlook or defer it if they're busy

    0
    Comment actions Permalink
  • Michael Yorke

    Hi Hayden, 

    I'm using the original script which Sam referred to in his original post. I haven't yet had the time to look at the toast popup he later referred to. I'm using the original script to prompt users to update Zoom (which is typically running), they can 'update now' which closes Zoom, runs the update, and re-opens Zoom for them automatically. Or they can defer for 30 minutes. If they do nothing the options disappear after 180 seconds. Works well. Let me know if you need help on this. 
    PS: We deploy the Mimecast plugin using GPO (its the only software we deploy using GPO because, as you know, it needs to be installed when Outlook is not running, so computer startup time is ideal). 

    0
    Comment actions Permalink
  • Shaun Johannes

    Hi Michael,

    I don't know if this is Hayden's issue, but I could use some help with it if you don't mind. My issue pertains to setting up the schedule to retry after the user clicks the postpone option. I can't seem to wrap my head around that part.

    0
    Comment actions Permalink
  • Michael Yorke

    Hi Shaun,

    Just remember that the script is just handling whether the users wants to run the upgrade now or later, then the PDQ deploy schedule handles running the script on machines which don't have the upgade (based off a PDQ inventory collection).

    This is how I have it setup for Zoom...

    Deploy task

    • Step 1 is the PowerShell script (Step 2 installs Zoom)
    • The success code for Step 1 is set to 0
    • Step 1 Options > 'run as' = logged on user
    • Step 1 Options > 'Error Mode' = Continue 
    • Deploy task Properties > Offline Settings > 'put offline targets in retry queue' = ticked.
    • Deploy task Properties > Offline Settings > 'Allowed retries' = 0 (unlimited)

    Relevant section In the script itself, 

    ####### DISPLAY MESSAGE ##########
    New-WPFMessageBox @Params -Content $StackPanel


    ####### PROCESS RESULTS ##########
    If ($WPFMessageBoxOutput -eq "Proceed with Update")
    {
    ## TESTING CODE ###
    # Write-Output "Proceed with Update Clicked"
    $CustomExitCode = 0
    }
    ElseIf ($WPFMessageBoxOutput -eq "Ask me again in 30 Minutes")
    {
    ## TESTING CODE ###
    # Write-Output "Not now Clicked"
    $CustomExitCode = 1
    }
    Else
    {
    }

    You can see in the script above, if user clicks "proceed", the script outputs code 0, which the Deploy task picks up as success (see bullet point #2) and moves onto step 2. If user clicks "not now", the script outputs code 1, which stops the deployment.

    If a user does nothing (I assume here they are away from their desk), then there is a part of the script which handles timeout, which also sets the exit code to 0 (success, continue with the upgrade). You set the timeout value in the parameters section of the script, around line 484 in mine. 

    # If a timeout value is provided, use a dispatcher timer to close the window when timeout is reached

    If ($Timeout) {
    $Stopwatch = New-object System.Diagnostics.Stopwatch
    $TimerCode = {
    If ($Stopwatch.Elapsed.TotalSeconds -ge $Timeout) {
    $Stopwatch.Stop()
    # $Window.Close()
    $CustomExitCode = 0
    $Window.Close()
    $TimeoutReached = 1
    }
    }

    Then, associated with my deploy task is a schedule

    • Triggers = every 30 minutes
    • Targets = PDQ inventory collection called "Zoom Desktop (outdated)"
    • Packages = Zoom 
    • Options > stop deploying to targets once they succeed = unticked
    • Options > stop deploying to targets if they fail = unticked
    • Options > stop deploying to remaining queued.... = unticked

    That's it. Hope this helps?

     

    0
    Comment actions Permalink
  • Shaun Johannes

    Michael,

    Thank you for the detailed breakdown, and yes I believe this answers my question.

    0
    Comment actions Permalink
  • Michael Parlett

    Thanks Sam and Michael, this works great!

    0
    Comment actions Permalink

Please sign in to leave a comment.