Windows/Powershell
From r00tedvw.com wiki
(Difference between revisions)
Line 3: | Line 3: | ||
<nowiki>PS> Enable-PSRemoting -Force #suppresses user prompts and enables. | <nowiki>PS> Enable-PSRemoting -Force #suppresses user prompts and enables. | ||
PS> Enable-PSRemoting -SkipNetworkProfileCheck -Force #enables even on public networks.</nowiki> | PS> Enable-PSRemoting -SkipNetworkProfileCheck -Force #enables even on public networks.</nowiki> | ||
+ | You will also probably have to enable WinRM (windows remote management) | ||
+ | <nowiki># Set start mode to automatic | ||
+ | PS> Set-Service WinRM -StartMode Automatic | ||
+ | |||
+ | # Verify start mode and state - it should be running | ||
+ | PS> Get-WmiObject -Class win32_service | Where-Object {$_.name -like "WinRM"}</nowiki> | ||
+ | |||
You may also need to add the client that will be connecting to the trusted hosts list. | You may also need to add the client that will be connecting to the trusted hosts list. | ||
<nowiki>PS> Set-Item WSMan:\localhost\Client\TrustedHosts -Value "FQDN" -Force #Adds an individual host. Overwrites previous entry. | <nowiki>PS> Set-Item WSMan:\localhost\Client\TrustedHosts -Value "FQDN" -Force #Adds an individual host. Overwrites previous entry. |
Revision as of 10:27, 18 January 2019
Allow Remote Powershell
On the server you'll be accessing
PS> Enable-PSRemoting -Force #suppresses user prompts and enables. PS> Enable-PSRemoting -SkipNetworkProfileCheck -Force #enables even on public networks.
You will also probably have to enable WinRM (windows remote management)
# Set start mode to automatic PS> Set-Service WinRM -StartMode Automatic # Verify start mode and state - it should be running PS> Get-WmiObject -Class win32_service | Where-Object {$_.name -like "WinRM"}
You may also need to add the client that will be connecting to the trusted hosts list.
PS> Set-Item WSMan:\localhost\Client\TrustedHosts -Value "FQDN" -Force #Adds an individual host. Overwrites previous entry. PS> Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force #Adds everything to the trusted host list. PS> Get-Item WSMan:\localhost\Client\TrustedHosts WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Client Type Name SourceOfValue Value ---- ---- ------------- ----- System.String TrustedHosts *