Posted On July 17, 2019

PowerShell: Send Private Message to Another Computer

kimconnect 0 comments
blog.KimConnect.com >> Codes >> PowerShell: Send Private Message to Another Computer
$name = read-host "Enter remote computer name "
$messageInput = read-host "Enter your message to send to remote computer "
$prefix = "Message from $($env:computername) $($env:username)`: "
$msg = $prefix + $messageInput;
Invoke-WmiMethod -Path Win32_Process -Name Create -ArgumentList "msg * $msg" -ComputerName $name

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Remediate IE Vulnerabilities

<# PowerShell Script to Secure Internet Explorer & Memory Operations reg add "HKLM\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_PRINT_INFO_DISCLOSURE_FIX" /v…

PowerShell: Play with Time

1. Constructor: $timer=[System.Diagnostics.Stopwatch]::StartNew() 2. Accessing a property $totalSeconds=$timer.Elapsed.TotalSeconds 3. Output Time (Usage): $hours=[math]::round($totalSeconds/3600,2)write-host "It has…

Basic HTML and HTML5: Create a Form Element

<h2>CatPhotoApp</h2><main><p>Click here to view more <a href="#">cat photos</a>.</p><a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying…