Scripting. Powershell, VMware, Windows, Active Directory & Exchange. All that kind of stuff…..
RSS icon Email icon Home icon
  • PowerShell 2.0: One Cmdlet at a Time #45 Connect-WSMan

    Posted on January 25th, 2010 Jonathan Medd No comments

    Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Connect-WSMan cmdlet.

    What can I do with it?

    Create a connection to a remote computer using WS-Management .

    Example:

    Connect to the remote server Test01 using WS-Management . Use the WSMan provider to examine the WSMan Shell properties and change the value for MaxShellsPerUser to 10.

    Connect-WSMan -ComputerName Test01
    cd wsman:
    dir

    Connect-WSMan1

    cd .\localhost
    dir | Format-Table -AutoSize

    Connect-WSMan2

    cd Shell
    dir | Format-Table -AutoSize

    Connect-WSMan3

    Set-Item -Path MaxShellsPerUser -Value 10
    dir | Format-Table -AutoSize

    Connect-WSMan4

    How could I have done this in PowerShell 1.0?

    Support for the use of WS-Management in PowerShell is provided as part of the 2.0 release.

    1000 things 1% better!

    Leave a reply