Windows Server 2012의 IIS8.0을 이용하면 https://주소/pswa로 접속하여 웹상에서도 서버를 파워셀로 관리할 수 있다. 특히 Web 접속이 되므로 Mobile device으로도 관리를 할 수 있는 장점이 있다.
출처 : http://cloudsns.wordpress.com/category/microsoft/powershell/page/11/
'powershell' 카테고리의 다른 글
Powershell v2.0에 Powershell v3.0을 설치했을 때 2.0을 사용하는 방법 ($PSVersionTable 사용하기) (0) | 2014.09.19 |
---|---|
자신이 원하는 파일을 매우 빠르고 쉽게 찾는 방법 (0) | 2014.09.19 |
Where-Object와 -Filter의 속도 차이 (0) | 2014.09.19 |
read-host와 write-host 사용하기 (0) | 2014.09.19 |
Windows Server 2012에는 작업표시줄에 PowerShell 아이콘이 기본 고정이다 (0) | 2014.09.19 |
특정한 속성 값만 알고 싶을 때 필터링하여 작업을 한다. 그런데 Filtering을 할 때 2가지 방법이 있다.
1) All kinds of cmdlets | Where-Object
2) A specific cmdlets -Filter
혹시 둘 다 지원되는 cmdlet라면 어떤 것을 사용하면 좋을까?
-Filter라는 매개변수(Parameter)를 사용하면 처리 성능이 좋고 부하가 적게 걸린다.
그 이유는 Where-Object는 앞의 결과의 모든 것을 가지고 와서 Filter을 하기 때문에 불필요한 정보까지를 포함하여 filtering을 한다. 그렇지만 -Filter는 필요한 속성 값을 가지고만 filtering을 하기 때문에 속도가 빠르다. 즉, Where-Object는 앞의 cmdlet의 결과를 가지고 2차적으로 작업을 하는 것이고 -filter는 2차적으로 처리하는 것이 아니고 그냥 처음부터 filtering을 하는 것이기 때문이다.
다음을 테스트를 하여 TotalSeconds 항목을 서로 비교해본다.
Measure-Command {gwmi win32_service -Filter “state <> ‘stopped'”}
Measure-Command {gwmi win32_service | where-Object {$_.state -ne “stopped”}}
출처 : http://cloudsns.wordpress.com/category/microsoft/powershell/page/11/
'powershell' 카테고리의 다른 글
자신이 원하는 파일을 매우 빠르고 쉽게 찾는 방법 (0) | 2014.09.19 |
---|---|
Powershell Web access in Windows Server 2012 (0) | 2014.09.19 |
read-host와 write-host 사용하기 (0) | 2014.09.19 |
Windows Server 2012에는 작업표시줄에 PowerShell 아이콘이 기본 고정이다 (0) | 2014.09.19 |
파일 확장자를 한꺼번에 모두 변경하기 (0) | 2014.09.19 |
암호를 입력하도록 창을 띄워줄 때 사용하는 것이 Read-Host이다.
입력한 결과를 화면이 보여주는 것이 Write-Host이다.
-AsSecureString은 화면이 입력한 글자를 보여주지 않게 하는 것이다.
출처 : http://cloudsns.wordpress.com/category/microsoft/powershell/page/11/
'powershell' 카테고리의 다른 글
Powershell Web access in Windows Server 2012 (0) | 2014.09.19 |
---|---|
Where-Object와 -Filter의 속도 차이 (0) | 2014.09.19 |
Windows Server 2012에는 작업표시줄에 PowerShell 아이콘이 기본 고정이다 (0) | 2014.09.19 |
파일 확장자를 한꺼번에 모두 변경하기 (0) | 2014.09.19 |
Hosts 파일의 변경 여부 확인하기(PowerShell의 Select-String 사용 / 부분미확인) (0) | 2014.09.19 |
이 만큼 Windows Server 2012를 관리하기 위해서는 PowerShell을 기본적으로 사용하라는 뜻이다.
Get-Command | Measure-Object를 해보면 1400개 후반 정도의 cmdlet가 사용되고 Module을 추가하면 점점 더 늘어난다.
Windows Server 2012에서는 기본적으로 제공되지 않는 Get-ADUser를 실행하면 자동으로 Import-Module -Name ActiveDirectory을 실행하여 ActiveDirectory용 cmdlet이 설치되어서 편리하다. 그리고 한 번 추가된 module의 cmdlet은 세션과 상관없이 계속 사용할 수 있어서 PowerShell v2.0에 비하여 편리해졌다.
사용 가능한 모든 명령어를 보려면…
Get-Command
Get-Command | Measure-Object (수량 확인)
Get-Command -CommandType cmdlet (cmdlet 유형만 확인)
Get-Command -CommandType function (function 유형만 확인)
Get-Command -CommandType alias (alias 유형만 확인)
사용 가능한 Module 목록을 확인하려면…
Get-Module -ListAvailable
Get-Module -Name ActiveDirectory
Get-Module -Name ServerManager
특정 Module에서만 사용할 수 있는 cmdlet를 확인하려면…
Get-Command -Module ActiveDirectory
Get-Command -Module ActiveDirectory | Measure-Object (수량 확인)
ActvieDirectory라는 Module의 명령어인 Get-ADUser를 이용하기 위해서는 단지 Get-ADUser라는 것을 입력하면 자동으로 필요한 Module이 설치된다.
출처 : http://cloudsns.wordpress.com/category/microsoft/powershell/page/11/
'powershell' 카테고리의 다른 글
Where-Object와 -Filter의 속도 차이 (0) | 2014.09.19 |
---|---|
read-host와 write-host 사용하기 (0) | 2014.09.19 |
파일 확장자를 한꺼번에 모두 변경하기 (0) | 2014.09.19 |
Hosts 파일의 변경 여부 확인하기(PowerShell의 Select-String 사용 / 부분미확인) (0) | 2014.09.19 |
원격 관리를 이용하여 여러 PC의 인터넷 차단하기 (미확인) (0) | 2014.09.19 |
.txt 파일을 .docx로 한꺼번에 변경하는 방법을 알아보자.
1) Get-ChildItem *.txt | Rename-Item -NewName {“$($_.BaseName).docx”} (선호됨)
또는 Get-ChildItem *.txt | Rename-Item -NewName { $_.name -Replace ‘\.txt’,’.docx’ }
2) Get-ChildItem *.txt | foreach {rename-item -path $_ -newname “$($_.basename).docx”} (이전 방식)
출처 : http://cloudsns.wordpress.com/category/microsoft/powershell/page/12/
'powershell' 카테고리의 다른 글
read-host와 write-host 사용하기 (0) | 2014.09.19 |
---|---|
Windows Server 2012에는 작업표시줄에 PowerShell 아이콘이 기본 고정이다 (0) | 2014.09.19 |
Hosts 파일의 변경 여부 확인하기(PowerShell의 Select-String 사용 / 부분미확인) (0) | 2014.09.19 |
원격 관리를 이용하여 여러 PC의 인터넷 차단하기 (미확인) (0) | 2014.09.19 |
Windows Server 2012에서 Hyper-v의 VM 메모리 한꺼번에 변경하기 (미확인) (0) | 2014.09.19 |