Current Host" profile from the remote computer in the session in$s. Because the$PROFILEvariable isn't populated, the command uses the explicit path to the profile. We use dot sourcing operator so that the profile executes in the current scope on the remote computer and not in its own scope...
To receive remote commands, PowerShell remoting must be enabled on the computer. Windows PowerShell remoting is enabled by default on Windows Server 2012 and newer releases of Windows Server. You can run Enable-PSRemoting to re-enable remoting if it was disabled. For more information, see E...
Get-CMCollectionMembershipRule Get-CMCollectionQueryMembershipRule Get-CMCollectionSetting Get-CMComplianceRule Get-CMComplianceSetting Get-CMComponentStatusMessage Get-CMComponentStatusSetting Get-CMComputerAssociation Get-CMConfigurationItem Get-CMConfigurationItemHistory Get-CMConfigurationItemXMLDefinition Get-CM...
get exactly what you want. For example, suppose I want to get a free disk space inventory for several remote computers. Now say I have those computers' names listed in a text file called C:\Computers.txt. It's just a plain text file with one computer name per line—nothing as ...
TheInvoke-Commandcmdlet is executed at the local computer and sends theScriptBlockto the remote computer. TheComputerNameparameter specifies the remote computer,Server01. TheScriptBlockparameter runsGet-ExecutionPolicyon the remote computer. TheGet-ExecutionPolicyobject is sent down the pipeline to theSe...
and custom server groups that you have created; where to find Server Manager log files; how to run popular WinRM commands such as creating a new listener; how to install roles and features on offline VHDs; and where to find documentation to help you manage multiple, remote servers by using...
Check the date / time on a remote computer The easiest way to obtain the date and time on a remote computer is to simply use theGet-Datecmdlet. By using Windows PowerShell remoting, it is trivial to obtain the remote time information. An example is shown here. ...
Also, this script is performing a fairly serious action—restarting a remote computer. Any script that attempts such a potentially hazardous action should implement two common Windows PowerShell parameters, –Confirm and –WhatIf. Explaining how to do this requires more space than I have here, ...
Describes the Windows PowerShell Desired State Configuration feature, which helps ensure consistent configuration across multiple remote, managed nodes. about_Debuggers Describes the Windows PowerShell script debugger, a set of cmdlets for debugging scripts and functions. ...
script. There is aTest-Connectioncmdlet that sends aping.The problem is that by default, ICMP packets are filtered in Windows Firewall; therefore,pingcommands will fail. But I wanted to ensure that the remote computer was up and responding, so I useTest-WsManinstead. Here is that command:...