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
You will see that you are warned that disabling the PSSessionConfiguration will not undo every change made by Enable-PSRemoting. The effect of running Disable-PSSessionConfiguration is to set the permission Everyone AccessDenied, execpt for BUILTIN\Administrators Access Allowed.
Subequently attempting to access that configuration from a remote session results in the following Access Denied error.
How could I have done this in PowerShell 1.0?
Remoting did not exist in PowerShell 1.0, you would have needed to use Remote Desktop to run an interactive session on a remote server.