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: Get SQL Job History

$computername='sql01' function getSqlJobHistory($sqlServerName){ try{ if(!(get-module SqlServer)){ Install-Module -Name SqlServer } Import-Module -Name SqlServer $sqlServerInstance=Get-SqlInstance -ServerInstance…

PowerShell: Checking Duplicating Identifiers Among ADFS Relying Party Trusts

function getDuplicatingIfd{ write-host "Checking each relying party trust for any duplicates of identifiers..." $trusts=Get-AdfsRelyingPartyTrust $allTrustNames=$trusts.Name…

PowerShell: Obtain Computer Account Parent Container from Invoke-Command

# ObtainComputerAccountParentContainer.ps1# This is a demonstration of how to pass function into an invoke-command as…