Thursday, December 29, 2011

PoSh Tip: Powershell remoteing

have you ever run into a situation where you needed to run some quick code on a remote system but were to lazy to use mstsc.Exe to remote to the system. will with powershell v2 Lazy admin can becom more productive with Invoke-Command cmdlet, and if your like me and hate typing the alias for this command is ICM. It allows you to Invoke a block of code on a remote system. Awasome !!! here is a quick example of who this cam be used to check the status of an Edge server in your perimeter network

Function Status-Edge01{
imc Edge01 {
add-pssnapin Microsoft.Exchange.Management.PowerShell.Admin -ea 0 
test-servicehealth
get-queue
}
}

No comments:

Post a Comment