PowerShell: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
Line 3: Line 3:
Set-Item wsman:\localhost\client\trustedhosts *
Set-Item wsman:\localhost\client\trustedhosts *
Restart-Service WinRM
Restart-Service WinRM
Get-Service WinRM
Test-WsMan 10.19.83.10
Test-WsMan 10.19.83.10
Invoke-Command  -ComputerName 10.19.83.10 -ScriptBlock { Get-ChildItem C:\ } -credential academia
Invoke-Command  -ComputerName 10.19.83.10 -ScriptBlock { Get-ChildItem C:\ } -credential academia
Enter-PSSession -ComputerName 10.19.83.10 -Credential academia
Enter-PSSession -ComputerName 10.19.83.10 -Credential academia

Revision as of 06:47, 21 November 2020

Enable-PSRemoting -Force
Set-Item wsman:\localhost\client\trustedhosts *
Restart-Service WinRM
Get-Service WinRM

Test-WsMan 10.19.83.10
Invoke-Command  -ComputerName 10.19.83.10 -ScriptBlock { Get-ChildItem C:\ } -credential academia
Enter-PSSession -ComputerName 10.19.83.10 -Credential academia

References