2010. 9. 15. 19:18


안녕하세요 @우주인입니다.
이번에는 Add-PsSnapIn를 이용하여 스냅인을 추가하는 법을 살펴보고자 합니다.
Add-PsSnapIn를 이용하면 내장되어 있는 명령어외에 해당 스냅인에서 지원하는 cmdlet를 모두 이용할 수 있습니다.

Sql이나 Exchange서버, AD등을 컨트롤하는데 많이 쓰이며
저같은 경우 쉐어포인트를 주로 컨트롤하는 이용합니다.

이용법은 help Add-PsSnapIn 를 통해 보시면 자세히 나와있으며 주로 Add-PsSnapIn NAME 으로 해당 스냅인을 추가합니다.

추가할 수 있는 스냅인의 종류를 볼려면 아래와 같이 Get-PSSnapin를 이용하시면 됩니다.


역시 제 PC에는 쉐어포인트 관련 스냅인이 지원되는군요

그럼 간단히 쉐어포인트에 사이트모음을 가져와 볼까요


당연히 위에 Add-PSSnapin 을 이용해 쉐어포인트 파워쉘 스냅인을 가져오지 않았다면 Get-SPSite는 실행시 오류가 발생합니다.

이와 같이 원하는 스냅인을 추가하여 서비스를 컨트롤 할 수 있습니다.


자신의 PC에 있는 모든 스냅인을 등록하고자 할때는 아래와 같이 한번에 처리가 가능합니다.




참고로 AD의 경우는
C:\PS>add-PSSnapIn Microsoft.Exchange, Microsoft.Windows.AD
설명
-----------
이 명령은 Microsoft Exchange 및 Active Directory 스냅인을 현재 세션에 추가합니다.



원본: http://vstarmanv.tistory.com/entry/Add-PSSnapin

'Powershell > @우주인' 카테고리의 다른 글

[MSSQL]WMI for SQL Management(2)-ClientNetworkProtocol  (0) 2010.10.05
Clip을 이용한 복사  (0) 2010.09.15
PowerShell Default Snap-Ins  (0) 2010.09.15
.NET Assembly load  (0) 2010.09.15
[MSSQL]WMI for SQL Management(1)  (0) 2010.09.15
Posted by 알 수 없는 사용자
:
2010. 9. 15. 19:18

파워쉘 Defalut 스냅인

기본적으로 파워쉘이 설치된 환경이라면 7개의 core snap-in이 로드되며, 이 때문에 해당 cmdlets를 사용할 수 있습니다.  당연히 core snap-in 들은 각자의 namespace를 가지고 있습니다.

 

1. Core (MicroSoft.PowerShell.core)
 
-       파워쉘 엔진, alias, 환경, 변수 , 함수에 관련되 cmdlet 

Get-Command -commandtype cmdlet | Where-Object {$_.PSSnapin -match "core"}

 

2. Host (MicroSoft.PowerShell.Host)

 - hosting에 관련된 스냅인

Get-Command -commandtype cmdlet | Where-Object {$_.PSSnapin -match "host"}

 

3. PowerShell.Management (MicroSoft.PowerShell.Management)

 - 프로세스나 서비스 관리 등 기타 윈도우 management 관련 cmdlet

Get-Command -commandtype cmdlet | Where-Object {$_.PSSnapin -match "PowerShell.Management"}

 

4. Security (MicroSoft.PowerShell.Security)

 - 파워쉘 보안관련 스냅인

Get-Command -commandtype cmdlet | Where-Object {$_.PSSnapin -match "Security"}


5. Utility (MicroSoft.PowerShell.Host)

 - Write-hostFormat-list 와 같은data manipulate 관련 cmdlets snap-in

Get-Command -commandtype cmdlet | Where-Object {$_.PSSnapin -match "Utility"} 


6.
Diagnostics (MicroSoft.PowerShell.Diagnostics)

 - performance counters 나 이벤트 로그 관련 cmdlets snap-in

 Get-Command -commandtype cmdlet | Where-Object {$_.PSSnapin -match "Diagnostics"}


7.
WsMan.Management (MicroSoft.WsMan.Management)

 - WsMan 관련 cmdlets snap-in

Get-Command -commandtype cmdlet | Where-Object {$_.PSSnapin -match "WsMan.Management"}

 

 

 원본: http://vstarmanv.tistory.com/entry/PowerShell-Default-Snap-Ins



'Powershell > @우주인' 카테고리의 다른 글

Clip을 이용한 복사  (0) 2010.09.15
Add-PSSnapin  (0) 2010.09.15
.NET Assembly load  (0) 2010.09.15
[MSSQL]WMI for SQL Management(1)  (0) 2010.09.15
파워쉘을 이용한 DOM 사용  (0) 2010.09.09
Posted by 알 수 없는 사용자
:
2010. 9. 15. 19:17

 

현재 도메인에서 파워쉘이 기본적으로 로드하는 .NET Assembly 리스트를 아래의 명령어로 알 수 있습니다.

[System.AppDomain]::CurrentDomain.GetAssemblies() | ForEach-Object { split-path $_.Location -leaf } | Sort-Object



등록된 어셈블리 외에 추가로 어셈블리를 로드 할 때는

[reflection.assembly]::LoadWithPartialName(“”) 

 = application 디렉토리나 global assembly cache 로부터 assembly를 로드합니다.

 원본: http://vstarmanv.tistory.com/entry/NET-Assembly-load

'Powershell > @우주인' 카테고리의 다른 글

Add-PSSnapin  (0) 2010.09.15
PowerShell Default Snap-Ins  (0) 2010.09.15
[MSSQL]WMI for SQL Management(1)  (0) 2010.09.15
파워쉘을 이용한 DOM 사용  (0) 2010.09.09
파워쉘 부팅매크로(Invoke-Item)  (0) 2010.09.09
Posted by 알 수 없는 사용자
:

BLOG main image
Windows Server를 공부 하는 사람들의 팀블로그 by 마성민

카테고리

분류 전체보기 (76)
Windows (2)
Powershell (56)
AD (0)
Exchange (6)
System Center (9)
IIS (0)
SQL (3)
Sharepoint (0)

태그목록

Tistory Cumulus Flash tag cloud by BLUEnLIVE requires Flash Player 9 or better.

Total :
Today : Yesterday :