0% found this document useful (0 votes)
57 views

Module 4: Ps Remoting: Winrm and Wsman

This document discusses PowerShell remoting and jobs. It covers: - WSMan and WinRM which enable secure communication for remoting over defined ports using protocols like SSL - Requirements for remoting including non-public networks and domain environments or certificates - How to enable and configure remoting using cmdlets like Enable-PSRemoting and Group Policy - How to create PS sessions to remote machines for running commands and interactive shells - Using jobs to run long-running commands in the background and retrieve results later

Uploaded by

madan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Module 4: Ps Remoting: Winrm and Wsman

This document discusses PowerShell remoting and jobs. It covers: - WSMan and WinRM which enable secure communication for remoting over defined ports using protocols like SSL - Requirements for remoting including non-public networks and domain environments or certificates - How to enable and configure remoting using cmdlets like Enable-PSRemoting and Group Policy - How to create PS sessions to remote machines for running commands and interactive shells - Using jobs to run long-running commands in the background and retrieve results later

Uploaded by

madan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Module 4: PS Remoting

WinRM and WSMAN:


• WSMan is an industry standard communication protocol
• WSMan provides secure communication over a defined set of ports
• WSMan can be further protected with SSL
• WinRM is the Microsoft service that
• implements and manages the WSMan protocol

PS Remoting Requirements :
• WSMan Introduced With PowerShell 2.0
• Windows Management Framework 3.0 installs a new version of WSMan
• Requires non-public client network*
• Need domain environment to use Kerberos Or install certificates and use SSL
• Port 5985 (Client to Server)
• Port 5986 (Server to Client)
Enable and Configure Remoting:
• Enable and Configure Remoting
Must run elevated
Run once per machine
• Enable-PSRemoting cmdlet
Runs Set-WSManQuickConfig
Configures WinRM to AutoStart
Configures firewall settings
Registers session configurations and listeners
• Use Group Policy
• Remoting turned off by default in 2.0
• Remoting turned on by default in Windows Server 2012 and Windows 8

Apple Software Solutions Page 1


Disable PS Remoting:

• Use Disable-PSRemoting cmdlet


• Use Group Policy
• Manually undo remoting settings
• Disable with caution – much of PowerShell 3.0 and Windows Server 2012 uses remoting

PS Session:
• Created for remote machines
• Can specify alternate credentials
• Can specify authentication
• Can specify SSL
• PSSessions do not use PowerShell profile scripts

Working with PS Session:


• Enter-PSSession
Use interactively in the console or PowerShell ISE
Like SSH
Use Exit-PSSession to quit
• New-PSSession
Create persistent PSSessions to one or more remote computers
Can be used interactively
Can be used to run remote commands
• Sessions closes when PowerShell ends
Or use Remove-PSSession
Invoke-Command
• Run commands on remote machines via PSSessions
• Sessions can be re-used
• Session state is maintained
• Improves performance

Apple Software Solutions Page 2


Powershell Jobs:
• PowerShell only lets you run one command at a time
• Long running commands will “tie-up” your prompt
• Send long running commands and scripts to the background
• Retrieve results when you want
Working with Jobs:
• Use Start-Job cmdlet
Access local resources
Run a PowerShell scriptblock
Run a PowerShell script
Name your job
Pass argument list
Initialize environment (e.g. import a module)
• Use –AsJob Parameter
Typically accesses remote resources
Invoke-Command
Get-WMIObject
Invoke-WMIMethod
Restart-Computer
Can’t specify a job name
• Get-job - // To display all jobs
• Get-job –id Jobid- // To get a specific Job
• Receive-job //To get the job result

Apple Software Solutions Page 3

You might also like