SOLVED

How to push message to all PC ?

%3CLINGO-SUB%20id%3D%22lingo-sub-355857%22%20slang%3D%22en-US%22%3EHow%20to%20push%20message%20to%20all%20PC%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-355857%22%20slang%3D%22en-US%22%3E%3CP%3EHello%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Please%20anyone%20guide%20me%20how%20to%20push%20message%20to%20all%20PC%20(Pc%20join%20domain)%20.%20I%20want%20when%20our%20system%20has%20problem%20then%20will%20push%20message%20to%20all%20pc%20to%20all%20user%20quick%20know%20.instead%20of%20when%20logon%20or%20send%20all%20email%3C%2FP%3E%3CP%3EBest%20Regards%2C%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-355952%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20push%20message%20to%20all%20PC%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-355952%22%20slang%3D%22en-US%22%3E%3CP%3EBecause%20i%20thing%20need%20develop%20one%20program%20and%20push%20message%20to%20this%20app%20when%20pc%20had%20install%20it.%3C%2FP%3E%3CP%3EThanks%20your%20support%20i%20will%20try%20your%20guide%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-355947%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20push%20message%20to%20all%20PC%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-355947%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20image%20that%20you%20have%20shown%20is%20an%20email%20sent%20out%20to%20all%20users%2C%20you%20could%20use%20a%20distribution%20group%20to%20do%20that%2C%20and%20as%20long%20as%20the%20users%20were%20logged%20in%20via%20email%20they%20would%20get%20that.%26nbsp%3B%3C%2FP%3E%3CP%3EMaybe%20I%20didn't%20understand%20your%20ask%20correctly%20-%20you%20asked%20for%20a%20broadcast%20to%20all%20computers%20-%20What%20I%20wrote%20was%20a%20quick%20set%20of%20commands%20to%20broadcast%20to%20each%20computer%20whether%20it%20had%20outlook%2Femail%20on%20it%20or%20not.%26nbsp%3B%20This%20shows%20up%20on%20the%20users%20screen%20no%20matter%20what%20is%20running%20and%20will%20not%20get%20recorded%20in%20the%20email%20system%20as%20this%20is%20completely%20independent%20of%20email%2C%20it%20does%20get%20recorded%20in%20the%20Computers%20Event%20Viewer%20that%20a%20message%20was%20sent%20-%20this%20broadcast%20is%20a%20message%20to%20the%20Active%20logged%20on%20user%20only%20on%20a%20domain%20computer%20only%20with%20no%20way%20for%20user%20feedback%20or%20acceptance-%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20would%20used%20like%20a%20legacy%20paging%20system.%26nbsp%3B%20There%20are%20better%20ways%20to%20do%20this%20-%20commercial%20programs%20etc%2C%20but%20this%20broadcasts%20quick%20and%20dirty%20to%20all%20computers%20in%20the%20list%20of%20computers%20in%20your%20domain.%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20long%20as%20you%20are%20an%20administrator%20and%20the%20machine%20you%20are%20broadcasting%20from%20is%20a%20domain%20connected%20computer%2C%20and%20all%20your%20computers%20don't%20have%20the%20windows%20firewall%20COMPLETELY%20locked%20down%20-%20this%20is%20not%20default%20-%20it%20should%20work%20to%20broadcast%20to%20the%20computers.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-right%22%20image-alt%3D%22SystemBroadcast.jpg%22%20style%3D%22width%3A%20355px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F84204i39336F59ED059A68%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22SystemBroadcast.jpg%22%20alt%3D%22SystemBroadcast.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-355941%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20push%20message%20to%20all%20PC%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-355941%22%20slang%3D%22en-US%22%3E%3CP%3EHello%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20This%20must%20open%20port%20from%20server%20to%20all%20PC%20%3F%20is%20it%20show%20message%20as%20screenshot%20below%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2201_notification_on_desktop.png%22%20style%3D%22width%3A%20650px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F84202iEA3D05BA95BCD3BF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2201_notification_on_desktop.png%22%20alt%3D%2201_notification_on_desktop.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-355936%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20push%20message%20to%20all%20PC%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-355936%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%20there%20is%20a%20feature%20built%20in%20to%20windows%20that%20will%20do%20this!%26nbsp%3B%20The%20msg%20command%20on%20windows%2010%20or%20net%20send%20on%20windows%207%20or%20older%20will%20accomplish%20this.%26nbsp%3B%20That%20being%20said%20its%20probably%20not%20as%20feature%20rich%20as%20you%20are%20going%20to%20want%20it!%26nbsp%3B%3C%2FP%3E%3CP%3EFormat%20of%20the%20command%20is%3C%2FP%3E%3CP%3EMSG%20username%20%2FServer%3AMachinename%20%22The%20Message%20you%20Want%20to%20Send%22%3C%2FP%3E%3CP%3EIt%20presents%20a%20couple%20of%20issues%20for%20you%20as%20an%20administrator%2C%20including%20the%20fact%20that%20you%20have%20to%20know%20the%20list%20of%20machines%20on%20your%20network%2C%20have%20access%20to%20them%20via%20the%20MSG%20command%20(Basic%20Microsoft%20networking%20firewall%20access%20has%20to%20be%20enable%20at%20the%20domain%20level).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20list%20of%20machines%20can%20easily%20be%20gotten%20if%20you%20have%20Powershell%20AD%20module%20loaded%20via%3C%2FP%3E%3CP%3E%3CFONT%3E(get-adcomputer%20-filter%20*).name%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3EIf%20you%20don't%20have%20the%20Powershell%20Module%20you%20can%20use%20ADSI%20to%20enumerate%20your%20domain%20members%20via%20a%20searcher%20-%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3E%24Search%20%3D%20%5Badsisearcher%5D%22(%26amp%3B(objectCategory%3DComputer))%22%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3E(%24search.findall()).properties.name%20%26gt%3B%20Computers.txt%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3EEdit%20the%20list%20to%20remove%20out%20unwanted%20machines%2C%20DC's%20etc%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3EThe%20following%20code%20will%20enumerate%20the%20active%20logged%20on%20user%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3E((qwinsta%20%2Fserver%3A%24ServerName%20%7C%20foreach%20%7B%20((%24_.trim()%20-replace%20%22%5Cs%2B%22%2C%22%2C%22))%7D%20%7C%20ConvertFrom-Csv)%7Cwhere%20%7B%24_.state%20-like%20%22*ACTIVE*%22%7D).username%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3EWe%20could%20take%20this%20code%20from%20the%20TechNet%26nbsp%3B%20Community%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgallery.technet.microsoft.com%2Fscriptcenter%2FPing-Multiple-Computers-7d13a3aa%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgallery.technet.microsoft.com%2Fscriptcenter%2FPing-Multiple-Computers-7d13a3aa%3C%2FA%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3EAnd%20quickly%20modify%20it%20up%20so%20that%20if%20it%20pings%20the%20machine%20it%20sends%20the%20message%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%3EIts%20not%20pretty%20and%20needs%20error%20handling%20and%20some%20fine%20tuning%2C%20possibly%20more%20logic%20as%20you%20require%20etc%20but%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%3E%24ServerName%20%3D%20Get-Content%20%22c%3A%5CTemp%5CComputers.txt%22%26nbsp%3B%3CBR%20%2F%3Eforeach%20(%24Server%20in%20%24ServerName)%20%7B%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20if%20(test-Connection%20-ComputerName%20%24Server%20-Count%202%20-Quiet%20)%20%7B%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%24Username%3D((qwinsta%20%2Fserver%3A%24Server%20%7C%20foreach%20%7B%20((%24_.trim()%20-replace%20%22%5Cs%2B%22%2C%22%2C%22))%7D%20%7C%20ConvertFrom-Csv)%7Cwhere%20%7B%24_.state%20-like%20%22*ACTIVE*%22%7D).username%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3Bmsg%20%24username%20%2FServer%3A%24Server%20%22This%20is%20a%20system%20Broadcast%22%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%20else%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%22%24Server%20not%20pinging%22%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%7D%20%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%3EShould%20broadcast%20to%20all%20the%20machines%20active%20logged%20on%20users%20from%20a%20Windows%2010%20computer%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Regular Contributor

Hello

      Please anyone guide me how to push message to all PC (Pc join domain) . I want when our system has problem then will push message to all pc to all user quick know .instead of when logon or send all email

Best Regards,

Thanks

     

4 Replies
Best Response confirmed by Tien Ngo Thanh (Regular Contributor)
Solution

Hello, there is a feature built in to windows that will do this!  The msg command on windows 10 or net send on windows 7 or older will accomplish this.  That being said its probably not as feature rich as you are going to want it! 

Format of the command is

MSG username /Server:Machinename "The Message you Want to Send"

It presents a couple of issues for you as an administrator, including the fact that you have to know the list of machines on your network, have access to them via the MSG command (Basic Microsoft networking firewall access has to be enable at the domain level).

 

The list of machines can easily be gotten if you have Powershell AD module loaded via

(get-adcomputer -filter *).name

If you don't have the Powershell Module you can use ADSI to enumerate your domain members via a searcher - 

$Search = [adsisearcher]"(&(objectCategory=Computer))"

($search.findall()).properties.name > Computers.txt

Edit the list to remove out unwanted machines, DC's etc

The following code will enumerate the active logged on user

((qwinsta /server:$ServerName | foreach { (($_.trim() -replace "\s+",","))} | ConvertFrom-Csv)|where {$_.state -like "*ACTIVE*"}).username

We could take this code from the TechNet  Community https://gallery.technet.microsoft.com/scriptcenter/Ping-Multiple-Computers-7d13a3aa

And quickly modify it up so that if it pings the machine it sends the message

Its not pretty and needs error handling and some fine tuning, possibly more logic as you require etc but

 

$ServerName = Get-Content "c:\Temp\Computers.txt" 
foreach ($Server in $ServerName) { 
        if (test-Connection -ComputerName $Server -Count 2 -Quiet ) {  
         
            $Username=((qwinsta /server:$Server | foreach { (($_.trim() -replace "\s+",","))} | ConvertFrom-Csv)|where {$_.state -like "*ACTIVE*"}).username
  msg $username /Server:$Server "This is a system Broadcast"
         
                    } else 
                     
                    {"$Server not pinging" 
             
                    }     
         
}

 

Should broadcast to all the machines active logged on users from a Windows 10 computer

Hello

    This must open port from server to all PC ? is it show message as screenshot below ?

    01_notification_on_desktop.png

The image that you have shown is an email sent out to all users, you could use a distribution group to do that, and as long as the users were logged in via email they would get that. 

Maybe I didn't understand your ask correctly - you asked for a broadcast to all computers - What I wrote was a quick set of commands to broadcast to each computer whether it had outlook/email on it or not.  This shows up on the users screen no matter what is running and will not get recorded in the email system as this is completely independent of email, it does get recorded in the Computers Event Viewer that a message was sent - this broadcast is a message to the Active logged on user only on a domain computer only with no way for user feedback or acceptance- 

 

This would used like a legacy paging system.  There are better ways to do this - commercial programs etc, but this broadcasts quick and dirty to all computers in the list of computers in your domain. 

As long as you are an administrator and the machine you are broadcasting from is a domain connected computer, and all your computers don't have the windows firewall COMPLETELY locked down - this is not default - it should work to broadcast to the computers.SystemBroadcast.jpg

Because i thing need develop one program and push message to this app when pc had install it.

Thanks your support i will try your guide