Can someone point me in the right direction for displayed notification/alert

This topic contains 5 replies, has 4 voices, and was last updated by Profile photo of Jonathan Warnken Jonathan Warnken 9 months, 2 weeks ago.

  • Author
    Posts
  • #35684
    Profile photo of Graham Beer
    Graham Beer
    Participant

    I want to create a powershell script that alerts a user on a device that they have lost network connectivity.
    – Can i set an alert through WMI ?
    – Would it have to be a service running all the time and alert if network connections goes ?
    – Should i use a workflow so the script continues or just loop ?

    Got a few thoughts but not sure how to go forward with it.

  • #35689
    Profile photo of Don Jones
    Don Jones
    Keymaster

    WMI isn't an "alerting" system. You could potentially have WMI trigger an event that notified your own code, sure. And I'd strongly recommend that it be a service, yes – services are designed to run in the background. But that means not writing it in PowerShell, as PowerShell is **not** designed to run as a continuous service. And no, Workflow isn't designed for this, either.

    I'm a little confused, though, because since at least Windows 7, there's been a task bar alert when this happens, right? I'm guessing your users just aren't noticing that.

    In any event, I don't personally feel PowerShell is a good solution for this. It's going to be a kludge at best, and an ugly kludge at that. At worst, it'll end up being a memory hog (remember, PowerShell fires up a good portion of .NET, which is a little lazy about memory).

  • #35699
    Profile photo of Graham Beer
    Graham Beer
    Participant

    Thanks Don. The users are field engineers and it was to advise them. Your right, the notification is a bit small for them as they are on tablets running Windows 8.1.
    I was just thinking of a script that would pop up a gui window when the connection was lost.

  • #35702
    Profile photo of Jonathan Warnken
    Jonathan Warnken
    Participant

    Don is right but if you have to do it here is an option.
    You could use a powershell script to display a message but let task scheduler look for the lost network connect event http://www.groovypost.com/howto/automatically-run-script-on-internet-connect-network-connection-drop/

  • #35704
    Profile photo of Graham Beer
    Graham Beer
    Participant

    That looks useful Jonathan, thanks. Just a solution to help some engineers. Could I script the creation of the schedule to setup on mass ?

  • #35705
    Profile photo of Jonathan Warnken
    Jonathan Warnken
    Participant

You must be logged in to reply to this topic.