fb
Homepage 5 How-to Articles 5 How to Send Network Popup Message in Windows

How to Send Network Popup Message in Windows

Manage remote endpoints, deploy software and patches with Action1 cloud RMM solution.

Sign up and use free on up to 50 endpoints with no functionality limits or expiration.



November 15, 2019

In Windows XP, this service was convenient though very picky which allowed sending messages to all PCs in the net sent * domain. “Message text!” But there were significant restrictions on the number of characters that could be written in the message. Very often the messages did not fit, but this is not the worst thing: Messages often did not reach because someone had the service disconnected from someone, it just stopped and if a person blocked the PC, he would not see the message before unlocking his station. As a result of the search, the next solution to this problem was born. We will use POWERSHELL. Its only drawback is that the message can only be sent by the administrator. This howto helps to send network popup message in Windows 7.

Displaying Notifications to Users Using PowerShell

Despite the fact that PowerShell is a console language, it is sometimes necessary to notify the user about a specific event or the need to perform a specific action from a PowerShell script. For example, to display a notification about the completion of a long-term PoSh script, or about the occurrence of some important event.

The easiest way to display a window with an arbitrary test through the Windows scripting subsystem is Wscript. The following code will display a plain text box with the required text and an OK button.

$wshell = New-Object -ComObject Wscript.Shell

$utput = $ wshell.Popup ("The report generation script is executed")/p>

Using various properties of the Popup method, you can customize the appearance of a modal message box. Including you can return to the script the results of the user’s response to the question (Yes / No).

$Output = $ wshell.Popup ("The report generation script is complete! Do you want to display it on the screen?", 0, "Report is ready", 4 + 32)

General syntax and parameters of the Popup method:

Popup(Text,SecondsToWait,Title,Type)

General syntax and parameters of the Popup method:

Popup(Text,SecondsToWait,Title,Type)

Options:

  • Text – string, message text. SecondsToWait _optional number. The number of seconds after which the window will be automatically closed. Title – optional string. The text of the message box title. Type – optional number. The combination of flags determines the type of buttons and icon. Possible flag values:
  • 0 – OK button.
  • 1 – OK and Cancel buttons.
  • 2 – buttons Stop, Repeat, Skip.
  • 3 – buttons Yes, No, Cancel.
  • 4 – Yes and No buttons.
  • 5 – buttons Repeat and Cancel.
  • 16 – Stop icon.
  • 32 – Question icon.
  • 48 – Exclamation icon.
  • 64 – Information icon.

More attractive and pleasant looking pop-up messages (ballons) can be displayed in Windows 7, 8.1 and 10 through the Windows Forms API. The following PowerShell code will display a pop-up message next to the Windows 10 notification bar, which will automatically disappear after 10 seconds.

Add-Type -AssemblyName System.Windows.Forms

$ global: balmsg = New-Object System.Windows.Forms.NotifyIcon

$ path = (Get-Process -id $ pid) .Path

$ balmsg.Icon = [System.Drawing.Icon] :: ExtractAssociatedIcon ($ path)

$ balmsg.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon] ::

$ balmsg.BalloonTipText = ‘This is the text of the pop-up message for the Windows 10 user.’

$ balmsg.BalloonTipTitle = “Warning $ Env: USERNAME”

$ balmsg.Visible = $ true

$ balmsg.ShowBalloonTip (10,000)

In addition to create colorful pop-up messages in Windows 10 (PowerShell 5.0+), you can use the separate PowerShell module BurntToast from the PowerShell gallery.

The module is installed from the online repository using the Windows 10 package manager:

Install-Module -Name BurntToast

Script for Sending Messages on Windows

Try to use this Powershell script

#options

param (

$ message = (Read-Host -Prompt “Enter the message text to send:”)

)

$ cComps = @ ()

$ OnlinePC = @ ()

$ OfflinePC = @ ()

# Create process variable with parameters

$ Proc = “msg.exe -v -time: 90000 * $ message”

# Getting All PCs from AD

$ cComps = GET-QADcomputer | % {$ _. Name}

Write-Host “Check the availability of PC, please wait …` t “-NoNewline

$ cComps | Sort-Object name | % {

$ name = $ _

if (test-connection-computer $ name -quiet -Count 1) {$ OnlinePC + = $ name}

else {if (test-connection-computer $ name -quiet) {$ OnlinePC + = $ name} $ OfflinePC + = $ name}

}

Write-Host “Done!”

Write-Host “ON line PC:” $ OnlinePC.Count

Write-Host “OFF line PC:” $ OfflinePC.Count -ForegroundColor red

$ OnlinePC | % {

([WMICLASS] “\\ $ _ \ Root \ CimV2: Win32_Process”). Create ($ Proc) | Out-null

if ($?) {“Message to $ _ sent”} else {Write-Host “On $ _ problems sending a message” -BackgroundColor Black -ForegroundColor Red}

}

$ OfflinePC | % {

Write-Host $ _ “OFF Line” -BackgroundColor Red -ForegroundColor Black

}

Consider Using Action1 to Send Network Popup Message if:

  • You need to perform an action on multiple computers simultaneously.
  • You have remote employees with computers not connected to your corporate network.

Action1 is a cloud-based platform for patch management, software deployment, remote desktop, software/hardware inventory, endpoint management and endpoint configuration reporting.

Related Articles

How To Delete User Profiles Remotely with PowerShell

When a user logs onto the computer for the first time (not via the network to access shared folders or printers), Windows creates a user profile. Among its contents are the NTUSER.DAT file (user profile settings), user-specific folders (My Documents, Desktop, etc.),...

About Action1 RMM

Action1 RMM is a cloud-based IT solution for remote monitoring and management, patching, and remote support.

Start your free two-week trial of Action1, or use RMM tools for free forever on 50 endpoints with no functionality limitations!



0 Comments

Submit a Comment

Your email address will not be published.

cloud patch management solutions action1

MSP Solution

Centralize endpoint management and boost efficiency of IT service delivery.

automated server patch management action compliance

Patch Management

Identify and deploy missing OS and third-party software updates.

cloud software deployment tools windows

Software Deployment

Distribute software and updates across managed endpoints.

software distribution tools software inventory action1

IT Asset Inventory

Keep a detailed inventory and manage hardware and software assets.

web client remote desktop

Remote Desktop

Support users via seamless remote desktop connection.

web based rdp client

Unattended Access

Provide administrative support and manage remote devices.

automated patch management action1

Endpoint Management

Run PowerShell, custom scripts, reboot computers and restart services.

API integrations action1

RESTful API

Integrate Action1 RMM to your IT ecosystem.

computer inventory tool for compliance

Reports and Alerts

Conduct endpoint security audits with comprehensive reporting.