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

PowerShell: Windows 10 Preparation Script

Set PowerShell execution policy prior to running script as an Administrator Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Confirm:$False…

Centos 5.3 Server preparation for web hosting

These are compatible Repositories: FreshRPMS, Dries, NewRPMS and PlanetCCRMA   Note: to update PHP and…

PowerShell: Add Windows NTFS Permissions to File or Folder

The re-usable function: $path='C:\Windows\servicing' $accountsToAdd='Administrators' $permissions='Full' function addNtfsPermissions ($path,$accountsToAdd,$permissions){ $acl = Get-ACL $path $accessRule=New-Object System.Security.AccessControl.FileSystemAccessRule($accountsToAdd,$permissions,"Allow")…