Distributed activation

Similar steps as for individual activation can be taken to enable one or more endpoints on remote systems. If you are not able to roll out a session configuration leveraging a configuration management tool, you can also use remoting to do so. By executing Register-PSSessionConfiguration with Invoke-Command, you can just as well distribute the session configuration. Be aware of the fact that the WinRM service will be restarted, terminating your session:

# Distibuted session configuration
# Create new sessions and copy Role Capabilities (as well as necessary modules)

$sessions = New-PSSession -ComputerName (1..10 | % { "Node$_"})
$path = (Join-Path ($env:PSModulePath -split ';')[1] 'JeaCapabilities')
foreach ($session in $sessions)
{
Copy-Item -Path $path -Destination $path -Recurse -ToSession $session -Force
}

# Remotely register new configurations
Invoke-Command -Session $sessions -ScriptBlock {
$sessionConfigurationOptions = @{
Path = '.SessionConfig.pssc'
SessionType = 'RestrictedRemoteServer'
TranscriptDirectory = 'C:Transcripts'
RunAsVirtualAccount = $true
LanguageMode = 'ConstrainedLanguage'
RoleDefinitions = @{
'contosoFirstLevelSupport' = @{RoleCapabilities = 'FirstLevelUserSupport'}
}
}

New-PSSessionConfigurationFile @sessionConfigurationOptions

Register-PSSessionConfiguration -Path .SessionConfig.pssc -Name SupportSession -Force
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset