powershell

PowerShell 2.0: One Cmdlet at a Time 44 Set-WSManQuickConfig

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Set-WSManQuickConfig cmdlet. What can I do with it? Configure the local computer for use with WS-Management . Example: Configure the local computer to be enabled for remote management with WS-Management . Set-WSManQuickConfig This will produce output similar to the below; note the command was run on a Windows Server 2008 64bit system. Set-WSManQuickConfig runs the following tasks: —– Starts the WinRM service if necessary.

PowerShell 2.0: One Cmdlet at a Time 42 Enable-PSSessionConfiguration

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Enable-PSSessionConfiguration cmdlet. What can I do with it? Re-enable access to a session configuration which has previously been disabled with Disable-PSSessionConfiguration. Example: View the permissions of the currently disabled BITSTransfer PSSessionConfiguration, re-enable it, then view the permissions again. Get-PSSessionConfiguration -Name BITSTransfer | Format-Table -property Name,Permission -auto Enable-PSSessionConfiguration -Name BITSTransfer Get-PSSessionConfiguration -Name BITSTransfer | Format-Table -property Name,Permission -auto

PowerShell 2.0: One Cmdlet at a Time 43 Unregister-PSSessionConfiguration

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Unregister-PSSessionConfiguration cmdlet. What can I do with it? Delete PSSessionConfigurations on the local computer. Example: View the existing available PSSessionConfigurations with Get-PSSessionConfiguration, remove the BITSTransfer configuration and then confirm it has been removed. Get-PSSessionConfiguration Unregister-PSSessionConfiguration -Name BITSTransfer Get-PSSessionConfiguration You will see that you are prompted to both confirm and the action and the restart of the WinRM service.

PowerShell 2.0: One Cmdlet at a Time 40 Set-PSSessionConfiguration

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Set-PSSessionConfiguration cmdlet. What can I do with it? Change the properties of a session configuration which has been registered with Register-PSSessionConfiguration. Example: Create a new PSSession Configuration called BITSTransfer using the startup script C:\Scripts\StartupScript.ps1. Use StartupScript.ps1 to import the PowerShell 2.0 BITS Transfer module so that those cmdlets are available to the user of the remote session.

PowerShell 2.0: One Cmdlet at a Time 41 Disable-PSSessionConfiguration

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Disable-PSSessionConfiguration cmdlet. What can I do with it? Deny access to a session configuration. Example: Examine the permissions of the previously created PSSessionConfiguration named BITSTransfer. Deny access to this session using Disable-PSSessionConfiguration. Use the Force parameter to supress prompts. Check what the permissions on the configuration have been changed to. Get-PSSessionConfiguration -Name BITSTransfer | Format-Table -property Name,Permission -auto Disable-PSSessionConfiguration -Name BITSTransfer -Force Get-PSSessionConfiguration -Name BITSTransfer | Format-Table -property Name,Permission -auto

UK PowerShell User Group Events in Jan and Feb 2010

The first two sessions of the UK PowerShell User Group for 2010 will be online sessions. The first event will take place on Tuesday 26th Jan 2010 7.30pm GMT. We will be looking at the Windows 2008 R2 cmdlets and provider for Active Directory. Sign up details are available on Richard Siddaway’s blog. The second event will take place on Tuesday 9th Feb 2010 7.30pm GMT. We will be looking at WMI and WQL.

PowerShell 2.0: One Cmdlet at a Time 39 Register-PSSessionConfiguration

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Register-PSSessionConfiguration cmdlet. What can I do with it? Session configurations determine the settings used by remote PowerShell sessions to that computer. This cmdlet enables the creation of customised settings for particular session requirements. Example: Create a new PSSession Configuration called BITSTransfer using the startup script C:\Scripts\StartupScript.ps1. Use StartupScript.ps1 to import the PowerShell 2.0 BITS Transfer module so that those cmdlets are available to the user of the remote session.

PowerShell 2.0: One Cmdlet at a Time 38 Get-PSSessionConfiguration

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Get-PSSessionConfiguration cmdlet. What can I do with it? Session configurations determine the settings used by remote PowerShell sessions to that computer. This cmdlet displays the settings for the current configuration(s) used on the local computer. Example: Retrieve the settings used by remote PowerShell sessions on the local computer and display the properties available.

PowerShell 2.0: One Cmdlet at a Time 37 Remove-PSSession

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Remove-PSSession cmdlet. What can I do with it? Close a remote PowerShell session which is open in the current session. Examples: Establish a persistent remote PowerShell connection to Test01 using New-PSSession , return the results for which services begin with T, then remove that session. Finally confirm the session has been removed by running Get-PSSession and seeing no results.

PowerShell 2.0: One Cmdlet at a Time 35 New-PSSessionOption

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the New-PSSessionOption cmdlet. What can I do with it? Create a new object with advanced session settings to be used when opening PowerShell remote sessions. Examples: Show the possible options which can be set with New-PSSessionOption New-PSSessionOption Set some advanced session options via the $sessionoptions variable and use them to make a remote PowerShell connection.