11 May 2010 @ 22:14 

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*
Posted By: Xenophane
Last Edit: 11 May 2010 @ 22:28

EmailPermalink
Tags
Tags:
Categories: Tech Stuff


 

Responses to this post » (One Total)

 
Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


 Last 50 Posts
 Back
Change Theme...
  • Users » 159
  • Posts/Pages » 98
  • Comments » 73
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

Links



    No Child Pages.

Books



    No Child Pages.

Ønsker



    No Child Pages.

CV



    No Child Pages.