Example #1
#Sessions
#Single Session
$Session = New-PSSession -ComputerName "computername"
#Multiple Sessions
$Session = New-PSSession -ComputerName "comp1","comp2".....
#Remove all Sessions
Remove-PSSession *
#Remove Named Session
Remove-PSSession $Session
#Using $session
Invoke-Command {ipconfig} -Session $Session
Enter-PSSession -Session $session
Example #2
$session = New-PSSession -ComputerName "compname"
Invoke-Command {Import-Module ActiveDirectory} -Session $session
Import-PSSession -Session $session -Module ActiveDirectory -Prefix "ctn"
notepad (Get-Module).path
Get-Command *ctn*

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Void « Default
Life
Earth
Wind
Water
Fire
Light 
[...] http://www.xipher.dk/WordPress/?p=426 Links to script posts http://www.xipher.dk/WordPress/?p=420 http://www.xipher.dk/WordPress/?p=417 http://www.xipher.dk/WordPress/?p=414 [...]