Unregister-PSSessionConfiguration
컴퓨터에서 등록된 세션 구성을 삭제합니다.
구문
Default (기본값)
Unregister-PSSessionConfiguration
[-Name] <String>
[-Force]
[-NoServiceRestart]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Unregister-PSSessionConfiguration cmdlet은 컴퓨터에서 등록된 세션 구성을 삭제합니다. 이 cmdlet은 시스템 관리자가 사용자에 대한 사용자 지정 세션 구성을 관리하도록 설계되었습니다.
변경을 적용하려면 Unregister-PSSessionConfiguration WinRM 서비스를 다시 시작합니다. 다시 시작하지 않도록 하려면 NoServiceRestart 매개 변수를 지정합니다.
기본 Microsoft.PowerShell 또는 Microsoft.PowerShell32 세션 구성을 실수로 삭제하는 경우 Enable-PSRemoting cmdlet을 사용하여 복원합니다. 자세한 내용은 about_Session_Configurations 참조하세요.
예제
예제 1: 세션 구성 삭제
다음은 컴퓨터에서 MaintenanceShell 세션 구성을 삭제하는 예제입니다.
Unregister-PSSessionConfiguration -Name "MaintenanceShell"
예제 2: 세션 구성 삭제 및 WinRM 서비스 다시 시작
이 예제에서는 MaintenanceShell 구성을 삭제하고 WinRM 서비스를 다시 시작합니다.
Force 매개 변수는 메시지를 표시하지 않고 WinRM 서비스를 다시 시작하도록 모든 사용자 메시지를 표시하지 않습니다.
Unregister-PSSessionConfiguration -Name MaintenanceShell -Force
예제 3: 모든 세션 구성 삭제
이 예제에서는 컴퓨터의 모든 세션 구성을 삭제하는 두 가지 방법을 보여 줍니다. 두 명령 모두 동일한 효과를 가지며 서로 바꿔 사용할 수 있습니다.
Unregister-PSSessionConfiguration -Name *
Get-PSSessionConfiguration -Name * | Unregister-PSSessionConfiguration
예제 4: 다시 시작하지 않고 등록 취소
이 예제에서는 NoServiceRestart 매개 변수를 사용하여 컴퓨터의 모든 세션을 방해하는 서비스를 다시 시작하지 못하게 하는 효과를 보여 줍니다.
PS> Unregister-PSSessionConfiguration -Name "MaintenanceShell" -NoServiceRestart
PS> Get-PSSessionConfiguration -Name "MaintenanceShell"
Get-PSSessionConfiguration -Name MaintenanceShell : No Session Configuration matches criteria "MaintenanceShell".
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException
PS> New-PSSession -ConfigurationName "MaintenanceShell"
Id Name ComputerName State Configuration Availability
-- ---- ------------ ----- ------------- ------------
1 Session1 localhost Opened MaintenanceShell Available
PS> Restart-Service winrm
PS> New-PSSession -ConfigurationName MaintenanceShell
[localhost] Connecting to remote server failed with the following error message :
The WS-Management service cannot process the request.
The resource URI (http://schemas.microsoft.com/powershell/MaintenanceShell) was not found in the WS-Management catalog.
The catalog contains the metadata that describes resources, or logical endpoints.
For more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportException
+ FullyQualifiedErrorId : PSSessionOpenFailed
Unregister-PSSessionConfiguration
MaintenanceShell 세션 구성을 삭제합니다.
그러나 명령이 NoServiceRestart 매개 변수를 사용하므로 WinRM 서비스가 다시 시작되지 않고 변경 내용이 아직 완전히 적용되지 않습니다.
다음으로, Get-PSSessionConfigurationMaintenanceShell 세션을 가져오려고 시도합니다. 세션이 WS-Management 리소스 테이블에서 제거되었으므로 Get-PSSessionConfiguration 세션을 반환할 수 없습니다.
New-PSSession cmdlet은 MaintenanceShell 구성을 사용하여 세션을 만듭니다. 명령이 성공합니다. 다음으로 WinRM 서비스를 다시 시작합니다.
마지막으로 New-PSSession cmdlet은 MaintenanceShell 구성을 사용하는 세션을 만들려고 합니다. 이번에는 WinRM 서비스가 다시 시작될 때 MaintenanceShell 구성이 삭제되었기 때문에 세션이 실패합니다.
매개 변수
-Confirm
cmdlet을 실행하기 전에 확인 메시지를 표시합니다.
매개 변수 속성
| 형식: | SwitchParameter |
| Default value: | False |
| 와일드카드 지원: | False |
| DontShow: | False |
| 별칭: | cf(cf) |
매개 변수 집합
(All)
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
-Force
cmdlet에서 확인 메시지를 표시하지 않고 메시지를 표시하지 않고 WinRM 서비스를 다시 시작합니다. 서비스를 다시 시작하면 구성 변경이 적용됩니다.
다시 시작을 방지하고 다시 시작 프롬프트를 표시하지 않도록 하려면 NoServiceRestart 매개 변수를 사용합니다.
매개 변수 속성
| 형식: | SwitchParameter |
| Default value: | None |
| 와일드카드 지원: | False |
| DontShow: | False |
매개 변수 집합
(All)
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
-Name
삭제할 세션 구성의 이름을 지정합니다. 하나의 세션 구성 이름 또는 구성 이름 패턴을 입력합니다. 와일드카드 문자가 허용됩니다. 이 매개 변수는 필수입니다.
세션 구성을 Unregister-PSSessionConfiguration파이프할 수도 있습니다.
매개 변수 속성
| 형식: | String |
| Default value: | None |
| 와일드카드 지원: | True |
| DontShow: | False |
매개 변수 집합
(All)
| Position: | 0 |
| 필수: | True |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | True |
| 나머지 인수의 값: | False |
-NoServiceRestart
이 cmdlet이 WinRM 서비스를 다시 시작하지 않고 서비스를 다시 시작하라는 프롬프트를 표시하지 않음을 나타냅니다.
기본적으로 Unregister-PSSessionConfiguration 명령을 실행하면 변경 내용이 적용되도록 WinRM 서비스를 다시 시작하라는 메시지가 표시됩니다. WinRM 서비스를 다시 시작할 때까지 사용자는 아직 등록되지 않은 세션 구성을 사용할 수 있지만 Get-PSSessionConfiguration 찾을 수 없습니다.
프롬프트 없이 WinRM 서비스를 다시 시작하려면 Force 매개 변수를 지정합니다. WinRM 서비스를 수동으로 다시 시작하려면 Restart-Service cmdlet을 사용합니다.
매개 변수 속성
| 형식: | SwitchParameter |
| Default value: | None |
| 와일드카드 지원: | False |
| DontShow: | False |
매개 변수 집합
(All)
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
-WhatIf
cmdlet이 실행되면 어떻게 되는지 보여 주세요. cmdlet이 실행되지 않습니다.
매개 변수 속성
| 형식: | SwitchParameter |
| Default value: | False |
| 와일드카드 지원: | False |
| DontShow: | False |
| 별칭: | 위스콘신 |
매개 변수 집합
(All)
| Position: | Named |
| 필수: | False |
| 파이프라인의 값: | False |
| 속성 이름별 파이프라인의 값: | False |
| 나머지 인수의 값: | False |
CommonParameters
이 cmdlet은 일반적인 매개 변수인 -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction 및 -WarningVariable 매개 변수를 지원합니다. 자세한 내용은 about_CommonParameters를 참조하세요.
입력
Microsoft.PowerShell.Commands.PSSessionConfigurationCommands
세션 구성 개체를 이 cmdlet으로 파이프할 수 있습니다.
출력
None
이 cmdlet은 출력을 반환하지 않습니다.
참고
이 cmdlet을 실행하려면 관리자 권한으로 실행 옵션을 사용하여 PowerShell을 시작해야 합니다.
관련 링크
- PSSession 구성 비활성화
- Enable-PSSessionConfiguration (PSSession 구성 사용 설정)
- Get-PSSessionConfiguration (PowerShell 구성 가져오기)
- New-PSSessionConfigurationFile
- New-PSSessionOption (새 PS 세션 옵션)
- Register-PSSessionConfiguration
- Set-PSSessionConfiguration (세션 구성 설정)
- Test-PSSessionConfigurationFile
- Unregister-PSSessionConfiguration
- WSMan 공급자
- 세션 구성에 대하여
- 세션 구성 파일에 관한 정보