Last active
March 29, 2023 13:08
-
-
Save mark-hallman/9b4481038e0efa477abf7073445ea4cd to your computer and use it in GitHub Desktop.
Configure Windows Remoting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set network to private | |
| Get-NetConnectionProfile | |
| Set-NetConnectionProfile -InterfaceIndex <index number> -NetworkCategory Private | |
| # To Turn Off Firewall & AV: | |
| NetSh Advfirewall set allprofiles state off | |
| #Enabling PowerShell Remoting | |
| Enable-PSRemoting -SkipNetworkProfileCheck -Force | |
| Test-WSMan -ComputerName SRV1 | |
| # Set start mode to automatic | |
| Set-Service WinRM -StartMode Automatic | |
| # Verify start mode and state - it should be running | |
| Get-WmiObject -Class win32_service | Where-Object {$_.name -like "WinRM"} | |
| # Trust all hosts | |
| Set-Item WSMan:localhost\client\trustedhosts -value * | |
| # Clear list of Trusted Hosts | |
| Set-Item WSMan:\localhost\Client\TrustedHosts -Value "" -Force | |
| # Verify trusted hosts configuration | |
| Get-Item WSMan:\localhost\Client\TrustedHosts | |
| https://4sysops.com/archives/enable-powershell-remoting-on-a-standalone-workgroup-computer/ | |
| ############### | |
| # Command Examples | |
| ############### | |
| # Create session to remote machines and copy folder to that machine | |
| $session = New-PSSession –ComputerName LAB-02 | |
| Copy-Item –Path "C:\Tools\kape\*" –Destination 'C:\Tools\kape' -Recurse –ToSession $session | |
| Exit-PSSession | |
| # | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment