community.windows.win_pssession_configuration – Manage PSSession Configurations¶
Note
This plugin is part of the community.windows collection (version 1.3.0).
To install it use: ansible-galaxy collection install community.windows
.
To use it in a playbook, specify: community.windows.win_pssession_configuration
.
Synopsis¶
Register, unregister, and modify PSSession Configurations for PowerShell remoting.
Note
This module has a corresponding action plugin.
Parameters¶
Notes¶
Note
This module will restart the WinRM service on any change. This will terminate all WinRM connections including those by other Ansible runs.
Internally this module uses
async
when not in check mode to ensure things goes smoothly when restarting the WinRM service.The standard
async
andpoll
keywords cannot be used; instead use the async_timeout and async_poll options to control asynchronous execution.Setting async_poll=0 will return a result that can be used with
async_status
.Options that don’t list a default value here will use the defaults of
New-PSSessionConfigurationFile
andRegister-PSSessionConfiguration
.If a value can be specified in both a session config file and directly in the session options, this module will prefer the setting be in the config file.
See Also¶
See also
- C(New-PSSessionConfigurationFile) Reference
Details and defaults for options that end up in the session configuration file.
- C(Register-PSSessionConfiguration) Reference
Details and defaults for options that are not specified in the session config file.
- PowerShell Just Enough Administration (JEA)
Refer to the JEA documentation for advanced usage of some options
- About Session Configurations
General information about session configurations.
- About Session Configuration Files
General information about session configuration files.
Examples¶
- name: Register a session configuration that loads modules automatically
community.windows.win_pssession_configuration:
name: WebAdmin
modules_to_import:
- WebAdministration
- IISAdministration
description: This endpoint has IIS modules pre-loaded
- name: Set up an admin endpoint with a restricted execution policy
community.windows.win_pssession_configuration:
name: GloboCorp.Admin
company_name: Globo Corp
description: Admin Endpoint
execution_policy: restricted
- name: Create a complex JEA endpoint
community.windows.win_pssession_configuration:
name: RBAC.Endpoint
session_type: restricted_remote_server
run_as_virtual_account: True
transcript_directory: '\\server\share\Transcripts'
language_mode: no_language
execution_policy: restricted
role_definitions:
'CORP\IT Support':
RoleCapabilities:
- PasswordResetter
- EmployeeOffboarder
'CORP\Webhosts':
RoleCapabilities: IISAdmin
visible_functions:
- tabexpansion2
- help
visible_cmdlets:
- Get-Help
- Name: Get-Service
Parameters:
- Name: DependentServices
- Name: RequiredServices
- Name: Name
ValidateSet:
- WinRM
- W3SVC
- WAS
visible_aliases:
- gsv
state: present
- name: Remove a session configuration
community.windows.win_pssession_configuration:
name: UnusedEndpoint
state: absent
- name: Set a sessions configuration with tweaked async values
community.windows.win_pssession_configuration:
name: MySession
description: A sample session
async_timeout: 500
async_poll: 5
Authors¶
Brian Scholer (@briantist)