컴퓨터에 등록된 세션 구성을 가져옵니다.

구문

Get-PSSessionConfiguration [[-Name] <string[]>] [<CommonParameters>]

설명

Get-PSSessionConfiguration cmdlet은 로컬 컴퓨터에 등록된 세션 구성을 가져옵니다. 이 cmdlet은 시스템 관리자가 사용자에 대한 사용자 지정된 세션 구성을 관리하는 데 사용하도록 설계된 고급 cmdlet입니다.

세션 구성을 만들고 등록하려면 Register-PSSessionConfiguration cmdlet을 사용하십시오.

매개 변수

-Name <string[]>

지정된 이름이나 이름 패턴의 세션 구성만 가져옵니다. 하나 이상의 세션 구성 이름을 입력합니다. 와일드카드를 사용할 수 있습니다.

필수 여부

false

위치

1

기본값

All session configurations on the local computer

파이프라인 입력 적용 여부

false

와일드카드 문자 적용 여부

true

<CommonParameters>

이 cmdlet은 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable 등의 일반 매개 변수를 지원합니다. 자세한 내용은 about_Commonparameters.

입력 및 출력

입력 유형은 cmdlet으로 파이프할 수 있는 개체의 유형입니다. 반환 유형은 cmdlet에서 반환되는 개체의 유형입니다.

입력

없음

입력을 이 cmdlet으로 파이프할 수 없습니다.

출력

Microsoft.PowerShell.Commands.PSSessionConfigurationCommands#PSSessionConfiguration

참고

Windows Vista 및 Windows Server 2008 이상 버전에서 이 cmdlet을 실행하려면 "관리자 권한으로 실행" 옵션을 사용하여 Windows PowerShell을 열어야 합니다.

컴퓨터의 세션 구성을 보려면 컴퓨터의 Administrators 그룹 멤버여야 합니다.

원격 컴퓨터에서 Get-PSSessionConfiguration 명령을 실행하려면 로컬 컴퓨터의 클라이언트 설정(Enable-WSManCredSSP cmdlet 사용) 및 원격 컴퓨터의 서비스 설정에서 CredSSP(자격 증명 보안 서비스 공급자) 인증을 사용하도록 설정해야 하며, 원격 세션을 설정할 때 Authentication 매개 변수의 CredSSP 값을 사용해야 합니다. 그렇지 않을 경우 액세스가 거부됩니다.

예 1

C:\PS>get-pssessionconfiguration

설명
-----------
이 명령은 컴퓨터의 세션 구성을 가져옵니다.






예 2

C:\PS>get-pssessionconfiguration -name Microsoft*

Name                      PSVersion  StartupScript        Permission
----                      ---------  -------------        ----------
microsoft.powershell      2.0                             BUILTIN\Administrators AccessAll...
microsoft.powershell32    2.0                             BUILTIN\Administrators AccessAll...

설명
-----------
이 명령은 Get-PSSessionConfiguration의 Name 매개 변수를 사용하여 이름이 "Microsoft"로 시작하는 세션 구성만 가져옵니다.

이 명령은 Windows PowerShell과 함께 제공된 두 개의 기본 세션 구성을 가져옵니다.






예 3

C:\PS>Get-PSSessionConfiguration -name microsoft.powershell | get-member



   TypeName: Microsoft.PowerShell.Commands.PSSessionConfigurationCommands#PSSessionConfiguration

Name                   MemberType     Definition
----                   ----------     ----------
Equals                 Method         bool Equals(System.Object obj)
GetHashCode            Method         int GetHashCode()
GetType                Method         type GetType()
ToString               Method         string ToString()
Capability             NoteProperty   System.Object[] Capability=System.Object[]
ExactMatch             NoteProperty   System.String ExactMatch=False
Filename               NoteProperty   System.String Filename=%windir%\system32\pwrshplugin.dll
lang                   NoteProperty   System.String lang=en-US
Name                   NoteProperty   System.String Name=microsoft.powershell
PSVersion              NoteProperty   System.String PSVersion=2.0
ResourceUri            NoteProperty   System.String ResourceUri=https://schemas.microsoft.com/powershell/microsoft.powershell
SDKVersion             NoteProperty   System.String SDKVersion=1
SecurityDescriptorSddl NoteProperty   System.String SecurityDescriptorSddl=O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
SupportsOptions        NoteProperty   System.String SupportsOptions=true
Uri                    NoteProperty   System.String Uri=https://schemas.microsoft.com/powershell/microsoft.powershell
xmlns                  NoteProperty   System.String xmlns=https://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration
XmlRenderingType       NoteProperty   System.String XmlRenderingType=text
Permission             ScriptProperty System.Object Permission {get=trap { continue; }...


C:\PS> Get-PSSessionConfiguration -name microsoft.powershell | format-list -property *


Name                   : microsoft.powershell
Filename               : %windir%\system32\pwrshplugin.dll
SDKVersion             : 1
XmlRenderingType       : text
lang                   : en-US
PSVersion              : 2.0
ResourceUri            : https://schemas.microsoft.com/powershell/microsoft.powershell
SupportsOptions        : true
Capability             : {Shell}
Uri                    : https://schemas.microsoft.com/powershell/microsoft.powershell
SecurityDescriptorSddl : O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
ExactMatch             : False
xmlns                  : https://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration
Permission             : BUILTIN\Administrators AccessAllowed

설명
-----------
이들 명령은 Get-PSSessionConfiguration이 반환하는 PSSessionConfiguration 개체를 검사합니다.

첫 번째 명령은 Get-PSSessionConfiguration cmdlet을 사용하여 Microsoft.PowerShell 기본 구성을 가져옵니다.

두 번째 명령은 파이프라인 연산자(|)를 사용하여 Get-PSSessionConfiguration이 반환하는 개체를 Get-Member cmdlet으로 보냅니다. 출력에는 개체의 속성 및 메서드가 표시됩니다.

세 번째 명령은 동일한 개체를 Format-List cmdlet으로 보냅니다. Property 매개 변수 값을 *(모두)로 지정하면 Format-List는 개체의 모든 속성 및 속성 값을 목록으로 표시합니다.

이 명령의 출력에는 구성 유형을 구현하는 .dll의 위치, 만든 끝점의 리소스 URI(Uniform Resource Identifier) 및 구성에 대한 SDDL(Security Descriptor Definition Language)을 비롯한 유용한 정보가 표시됩니다.






예 4

C:\PS>dir wsman:\localhost\plugin

   WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Plugin

Name                      Type                 Keys
----                      ----                 ----
Event Forwarding Plugin   Container            {Name=Event Forwarding Plugin}
MaintenanceShell          Container            {Name=MaintenanceShell}
microsoft.powershell      Container            {Name=microsoft.powershell}
microsoft.powershell32    Container            {Name=microsoft.powershell32}
WMI Provider              Container            {Name=WMI Provider}

설명
-----------
이 명령은 WSMan: 공급자 드라이브의 Get-ChildItem cmdlet(별칭 = dir)을 사용하여 Plugin 노드의 내용을 확인합니다.

이 방법으로 컴퓨터의 세션 구성을 확인할 수도 있습니다.

PlugIn 노드에는 등록된 Windows PowerShell 세션 구성을 나타내는 ContainerElement 개체(Microsoft.WSMan.Management.WSManConfigContainerElement)가 WS-Management용 기타 플러그인과 함께 포함됩니다.






예 5

C:\PS>enable-wsmanCredSSP -delegate server02

C:\PS> connect-wsman server02

C:\PS> set-item wsman:\server02*\service\auth\credSSP -value $true

C:\PS> invoke-command -scriptblock {Get-PSSessionConfiguration} -computername Server02 -authentication CredSSP -credential Domain01\Admin01 

Name                      PSVersion  StartupScript        Permission                          PSComputerName
----                      ---------  -------------        ----------                          --------------
microsoft.powershell      2.0                             BUILTIN\Administrators AccessAll... server02.corp.fabrikam.com
microsoft.powershell32    2.0                             BUILTIN\Administrators AccessAll... server02.corp.fabrikam.com
MyX86Shell                2.0        c:\test\x86Shell.ps1 BUILTIN\Administrators AccessAll... server02.corp.fabrikam.com

설명
-----------
이 예에서는 원격 컴퓨터에서 Get-PSSessionConfiguration 명령을 실행하는 방법을 보여 줍니다. 이 명령을 실행하려면 로컬 컴퓨터의 클라이언트 설정과 원격 컴퓨터의 서비스 설정에서 CredSSP 위임을 사용하도록 설정해야 합니다. 이 예의 명령을 실행하려면 로컬 컴퓨터와 원격 컴퓨터에서 Administrators 그룹의 멤버여야 합니다.

첫 번째 명령은 Enable-WSManCredSSP cmdlet을 사용하여 Server01 로컬 컴퓨터에서 Server02 원격 컴퓨터로의 CredSSP 위임을 가능하게 합니다. 이 명령은 로컬 컴퓨터에 CredSSP 클라이언트 설정을 구성합니다.

두 번째 명령은 Connect-WSMan cmdlet을 사용하여 Server02 컴퓨터에 연결합니다. 이 작업을 수행하면 Server02 컴퓨터에 대한 노드가 로컬 컴퓨터의 WSMan: 드라이브에 추가되어 Server02 컴퓨터의 WS-Management 설정을 보고 변경할 수 있습니다.

세 번째 명령은 Set-Item cmdlet을 사용하여 Server02 컴퓨터의 Service 노드에 있는 CredSSP 항목의 값을 True로 변경합니다. 이렇게 하면 원격 컴퓨터의 서비스 설정이 구성됩니다.

네 번째 명령은 Invoke-Command cmdlet을 사용하여 Server02 컴퓨터에서 Get-PSSessionConfiguration 명령을 실행합니다. 이 명령은 Credential 매개 변수를 사용하고 CredSSP 값과 함께 Authentication 매개 변수를 사용합니다.






예 6

C:\PS>(get-PSSessionConfiguration -name CustomShell).resourceURI

https://schemas.microsoft.com/powershell/microsoft.CustomShell

설명
-----------
이 명령은 Get-PSSessionConfiguration cmdlet을 사용하여 세션 구성의 리소스 URI를 가져옵니다. 

이 명령은 리소스 URI를 사용하는 $PSSessionConfigurationName 기본 설정 변수의 값을 설정할 때 유용합니다. 

$PSSessionConfiguationName 변수는 세션을 만들 때 사용되는 기본 구성을 지정합니다. 이 변수는 로컬 컴퓨터에 설정되지만 원격 컴퓨터의 구성을 지정합니다. $PSSessionConfiguration 변수에 대한 자세한 내용은 about_Preference_Variables를 참조하십시오.






참고 항목




목차