Thursday, March 13, 2014

Remotely Running PowerShell

Very simple.

To enter a remote PowerShell session:

 enter-pssession servename

To exit the remote session:


Commands I like to run remotely:

-Listing and killing an active process:
  (*Particularly any starting with the name "note" and then stopping it)

 get-process -name note*
 stop-process -name note*

-Pulling a system's serial number:
  (*Particularly great for support calls)

 gwmi win32_bios

 This eliminates the need to connect via Remote Desktop in order to perform these simple tasks.

  • [Note] In order to use PowerShell commands on a remote machine: You need to have permission to connect and run these commands remotely; You need to have ran enable-psremoting; You need to have direct communication with the machine; and have opened the firewall in order to connect to the WS Management service. There's more details about of this and these commands listed below.

Running Remote Commands,
Using the Get-Process Cmdlet,
Using the Stop-Process Cmdlet,

No comments: