{
	"id": "7e8f2615-bb4a-45ef-bfd2-79d4addb14a8",
	"created_at": "2026-04-06T00:20:53.065853Z",
	"updated_at": "2026-04-10T03:20:53.669112Z",
	"deleted_at": null,
	"sha1_hash": "535ada360ed377d42de221ff0c30e5a8c3e2504b",
	"title": "Running Remote Commands - PowerShell",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 75684,
	"plain_text": "Running Remote Commands - PowerShell\r\nBy sdwheeler\r\nArchived: 2026-04-05 19:40:20 UTC\r\nYou can run commands on one or hundreds of computers with a single PowerShell command. Windows\r\nPowerShell supports remote computing using various technologies, including WMI, RPC, and WS-Management.\r\nPowerShell supports WMI, WS-Management, and SSH remoting. In PowerShell 7 and higher, RPC is supported\r\nonly on Windows.\r\nFor more information about remoting in PowerShell, see the following articles:\r\nSSH Remoting in PowerShell\r\nWSMan Remoting in PowerShell\r\nWindows PowerShell remoting without configuration\r\nMany Windows PowerShell cmdlets have the ComputerName parameter that enables you to collect data and\r\nchange settings on one or more remote computers. These cmdlets use varying communication protocols and work\r\non all Windows operating systems without any special configuration.\r\nThese cmdlets include:\r\nRestart-Computer\r\nTest-Connection\r\nClear-EventLog\r\nGet-EventLog\r\nGet-HotFix\r\nGet-Process\r\nGet-Service\r\nSet-Service\r\nGet-WinEvent\r\nGet-WmiObject\r\nTypically, cmdlets that support remoting without special configuration have the ComputerName parameter and\r\ndon't have the Session parameter. To find these cmdlets in your session, type:\r\nGet-Command | Where-Object {\r\n $_.Parameters.Keys -contains \"ComputerName\" -and\r\n $_.Parameters.Keys -notcontains \"Session\"\r\n}\r\nhttps://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/running-remote-commands?view=powershell-7.1\r\nPage 1 of 4\n\nWindows PowerShell remoting\r\nBy using the WS-Management protocol, Windows PowerShell remoting lets you run any Windows PowerShell\r\ncommand on one or more remote computers. You can establish persistent connections, start interactive sessions,\r\nand run scripts on remote computers.\r\nTo use Windows PowerShell remoting, the remote computer must be configured for remote management. For\r\nmore information, including instructions, see About Remote Requirements.\r\nOnce you configure Windows PowerShell remoting, many remoting strategies are available to you. This article\r\nlists just a few of them. For more information, see About Remote.\r\nStart an interactive session\r\nTo start an interactive session with a single remote computer, use the Enter-PSSession cmdlet. For example, to\r\nstart an interactive session with the Server01 remote computer, type:\r\nEnter-PSSession Server01\r\nThe command prompt changes to display the name of the remote computer. Any commands that you type at the\r\nprompt run on the remote computer and the results are displayed on the local computer.\r\nTo end the interactive session, type:\r\nExit-PSSession\r\nFor more information about the Enter-PSSession and Exit-PSSession cmdlets, see:\r\nEnter-PSSession\r\nExit-PSSession\r\nRun a Remote Command\r\nTo run a command on one or more computers, use the Invoke-Command cmdlet. For example, to run a Get-UICulture command on the Server01 and Server02 remote computers, type:\r\nInvoke-Command -ComputerName Server01, Server02 -ScriptBlock {Get-UICulture}\r\nThe output is returned to your computer.\r\nLCID Name DisplayName PSComputerName\r\n---- ---- ----------- --------------\r\n1033 en-US English (United States) server01.corp.fabrikam.com\r\n1033 en-US English (United States) server02.corp.fabrikam.com\r\nhttps://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/running-remote-commands?view=powershell-7.1\r\nPage 2 of 4\n\nRun a Script\r\nTo run a script on one or many remote computers, use the FilePath parameter of the Invoke-Command cmdlet.\r\nThe script must be on or accessible to your local computer. The results are returned to your local computer.\r\nFor example, the following command runs the DiskCollect.ps1 script on the remote computers, Server01 and\r\nServer02.\r\nInvoke-Command -ComputerName Server01, Server02 -FilePath C:\\Scripts\\DiskCollect.ps1\r\nEstablish a Persistent Connection\r\nUse the New-PSSession cmdlet to create a persistent session on a remote computer. The following example\r\ncreates remote sessions on Server01 and Server02. The session objects are stored in the $s variable.\r\n$s = New-PSSession -ComputerName Server01, Server02\r\nNow that the sessions are established, you can run any command in them. And because the sessions are persistent,\r\nyou can collect data from one command and use it in another command.\r\nFor example, the following command runs a Get-HotFix command in the sessions in the $s variable and it\r\nsaves the results in the $h variable. The $h variable is created in each of the sessions in $s , but it doesn't\r\nexist in the local session.\r\nInvoke-Command -Session $s {$h = Get-HotFix}\r\nNow you can use the data in the $h variable with other commands in the same session. The results are displayed\r\non the local computer. For example:\r\nInvoke-Command -Session $s {$h | where {$_.InstalledBy -ne \"NT AUTHORITY\\SYSTEM\"}}\r\nAdvanced Remoting\r\nPowerShell includes cmdlets that allow you to:\r\nConfigure and create remote sessions both from the local and remote ends\r\nCreate customized and restricted sessions\r\nImport commands from a remote session that actually run implicitly on the remote session\r\nConfigure the security of a remote session\r\nPowerShell on Windows includes a WSMan provider. The provider creates a WSMan: drive that lets you navigate\r\nthrough a hierarchy of configuration settings on the local computer and remote computers.\r\nhttps://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/running-remote-commands?view=powershell-7.1\r\nPage 3 of 4\n\nFor more information about the WSMan provider, see WSMan Provider and About WS-Management Cmdlets, or\r\nin the Windows PowerShell console, type Get-Help WSMan .\r\nFor more information, see:\r\nPowerShell Remoting FAQ\r\nRegister-PSSessionConfiguration\r\nImport-PSSession\r\nFor help with remoting errors, see about_Remote_Troubleshooting.\r\nSee Also\r\nabout_Remote\r\nabout_Remote_Requirements\r\nabout_Remote_Troubleshooting\r\nabout_PSSessions\r\nabout_WS-Management_Cmdlets\r\nInvoke-Command\r\nImport-PSSession\r\nNew-PSSession\r\nRegister-PSSessionConfiguration\r\nWSMan Provider\r\nSource: https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/running-remote-commands?view=powershell-7.1\r\nhttps://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/running-remote-commands?view=powershell-7.1\r\nPage 4 of 4",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"references": [
		"https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/running-remote-commands?view=powershell-7.1"
	],
	"report_names": [
		"running-remote-commands?view=powershell-7.1"
	],
	"threat_actors": [],
	"ts_created_at": 1775434853,
	"ts_updated_at": 1775791253,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/535ada360ed377d42de221ff0c30e5a8c3e2504b.pdf",
		"text": "https://archive.orkl.eu/535ada360ed377d42de221ff0c30e5a8c3e2504b.txt",
		"img": "https://archive.orkl.eu/535ada360ed377d42de221ff0c30e5a8c3e2504b.jpg"
	}
}