ติดตั้ง Windows PowerShell Web Access บน Windows Server 2012

0
421

How to Install Windows PowerShell Web Access

เราสามารถใช้ PowerShell ผ่านทาง Web ได้ด้วย โดย Feature นี้มีมากับ: Windows Server 2012 และ Windows Server 2012 R2

ขั้นตอนการติดตั้ง Windows PowerShell Web Access มันซ่อนอยู่ใน Feature ครับ

Step1: ติดตั้ง Windows PowerShell Web Access ด้วย Features แบบ GUI

ติดตั้ง Windows PowerShell Web Access Windows 2012

หลังจากเลือก Enable แล้วมันจะต้องติดตั้ง IIS เพิ่มเติมนะครับ

ติดตั้ง Windows PowerShell Web Access Windows 2012

กด Add Features แล้วปล่อยให้มันติดตั้งไปครับ

ติดตั้ง Windows PowerShell Web Access Windows 2012

Step2: หลังจากติดตั้งเสร็จแล้วให้ตั้งค่าด้วย PowerShell Command ดังต่อไปนี้

Install-PswaWebApplication –UseTestCertificate

ติดตั้ง Windows PowerShell Web Access Windows 2012

หมายความว่าให้ติดตั้ง PowerShell Web Access และติดตั้ง Self-signed SSL Certificate ให้ด้วย หลังจากติดตั้งเสร็จแล้วเราจะสามารถเรียกใช้ได้ด้วย URL ประมาณนี้ครับ https://<server_name>/pswa

Step3: ตั้งค่าความปลอดภัย Restrictive authorization rule

ใช้คำสั่ง PowerShell ต่อไปนี้เพื่อตั้งค่าความปลอดภัยสำหรับการให้สิทธิ์เครื่องที่จะใช้ PowerShell Web Access ดังนี้ครับ

คำสั่งด้านล่างนี้มักง่ายนะครับ อนุญาตให้เข้ามาหมดเลย (ไม่ควรทำตาม)

Add-PswaAuthorizationRule –UserName * -ComputerName * -ConfigurationName *

ติดตั้ง Windows PowerShell Web Access Windows 2012

หากต้องการตั้งค่าแบบละเอียดกว่านี้ให้อ้างอิงตารางนี้ครับ

Name Description Parameters
Add-PswaAuthorizationRule Adds a new authorization rule to the Windows PowerShell Web Access authorization rule set. · ComputerGroupName· ComputerName· ConfigurationName

· RuleName

· UserGroupName

· UserName

· Credential (Windows Server 2012 R2 and later)

Remove-PswaAuthorizationRule Removes a specified authorization rule from Windows PowerShell Web Access. · Id· RuleName
Get-PswaAuthorizationRule Returns a set of Windows PowerShell Web Access authorization rules. When it is used without parameters, the cmdlet returns all rules. · Id· RuleName
Test-PswaAuthorizationRule Evaluates authorization rules to determine if a specific user, computer, or session configuration access request is authorized. By default, if no parameters are added, the cmdlet evaluates all authorization rules. By adding parameters, administrators can specify an authorization rule or a subset of rules to test. · ComputerName· ConfigurationName· RuleName

· UserName

· Credential (Windows Server 2012 R2 and later)

Step4: ทดสอบการใช้งานด้วยการ เปิด Internet Explorer แล้วพิมพ์ https://ws2012r2-ad/pswa

เข้าได้แล้วครับ เยห์ เวลา login เข้าใช้งานให้ใส่

ติดตั้ง Windows PowerShell Web Access Windows 2012

เข้าได้แล้วอยากทำไรก็ทำครับ

ติดตั้ง Windows PowerShell Web Access Windows 2012

อ้างอิง

http://technet.microsoft.com/en-us/library/hh831611.aspx