Richard's profileRichard Siddaway's BlogPhotosBlogLists Tools Help

Blog


    April 26

    PowerShell remoting options

    One of the big pieces of functionality in PowerShell v2 is the ability to directly administer remote machines.  A number of cmdlets get a computername parameter for working directly. The main push for remoting is through the *-PSsession cmdlets

    Enter-PSSession
    Exit-PSSession
    Export-PSSession
    Get-PSSession
    Import-PSSession
    New-PSSession
    Remove-PSSession

    New-, Get and Remove- I have blogged about before.  The interesting ones are the Enter/Exit and Import/Export pairs.

    Enter-PSsession enables you to work directly in the session – as if you had RDP’d into the machine and were running PowerShell on the box.  It means we don’t need to use Invoke-Command as much. Exit-PSsession steps back out of the session but leaves the session open.

    Import-PSsession enables you to import functionality from the remote session into your local PowerShell session.  For instance you can import the 2008 R2 AD cmdlets into your local session.  They show up as functions rather than cmdlets but are fully usable.

    Export-PSsession saves PowerShell command types (cmdlets, functions etc) to a module that can be loaded at any time into a session.

    There is a lot of flexibility and power built into the remoting system that should allow you to get a way of working that suits you.

    Technorati Tags: ,,

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://richardsiddaway.spaces.live.com/blog/cns!43CFA46A74CF3E96!2260.trak
    Weblogs that reference this entry
    • None