Delete registered session configurations from the computer.
This is an advanced cmdlet for system administrators to manage custom session configurations for their users.
Syntax
Unregister-PSSessionConfiguration [-Name] string
[-Force] [-NoServiceRestart]
[-Confirm] [-WhatIf] [CommonParameters]
Key
-Name
The names of session configurations to delete.
Enter one or more configuration names. Wildcards are permitted.
This parameter is required.
-force
Suppress all user prompts, and restarts the WinRM service without prompting.
Restarting the service makes the configuration change effective.
To prevent a restart and suppress the restart prompt, use -NoServiceRestart
-NoServiceRestart
Do not restart the WinRM service, and suppress the default restart prompt.
Until WinRM is restarted, users can still use the unregistered session configuration,
even though Get-PSSessionConfiguration does not find it.
To restart the WinRM service manually, use Restart-Service.
-confirm
Prompt for confirmation before executing the command.
-whatIf
Describe what would happen if you executed the command without actually
executing the command.
CommonParameters:
-Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
-OutBuffer -OutVariable.
If you accidentally delete the default Microsoft.PowerShell or Microsoft.PowerShell32 session configurations, use Enable-PSRemoting to restore them.
Examples
Delete the MaintenanceShell session configuration from the computer, suppress user messages and restart the WinRM service:
PS C:> unregister-pssessionconfiguration -name MaintenanceShell -force
Create a session on the local computer that uses the Maintenance Shell configuration, this will fail if the MaintenanceShell configuration has been deleted:
PS C:> new-pssession -configurationName MaintenanceShell
Delete all session configurations on the computer:
PS C:> unregister-pssessionconfiguration -name *
“Success is a lousy teacher. It seduces smart people into thinking they can't lose” ~ Bill Gates
Related PowerShell Cmdlets:
Get-PSSessionConfiguration - Get the registered PS session configuration.
Register-PSSessionConfiguration - Create and register a new PS session configuration.