PowerShell 遠端操控 server -2
繼上一篇 PowerShell 遠端操控 server,我又在嘗試於 Workgroup + Domain 的環境下,該如何使用遠端操作。
在說明設定之前,我想提及一個重要的觀念,也就是遠端操控到底是如何運作的 ?
這是我之前上蘇建榮老師的課所得知的知識,分享如下:
一、遠端管理
這是第一種方式,也是傳統的方式,使用 RPC 來進行。
ex: Get-WMIObject Win32_LogicalDisk –ComputerName <ServerName>
二、遠端執行
建議使用的方式,是透過 WinRM 服務進行。 其實原理就是,將命令傳給另一個 server 來執行。
ex: Invoke-Command …….
那我們該如何設定呢 ? 本篇先說明一種最簡單快速的方式 → 安裝 Server 完畢後,將 Administrator 設定同樣的密碼,就可以立即使用 。 (結束)
有沒有覺得很無言………….。雖說簡單,但是我們必須知道為什麼可以這麼做。
原因有二: (1) RPC 服務一定是被開啟的 (2) 防火牆預設是有針對 RPC 服務開啟的
被選擇的防火牆規則,即是可以使用遠端操控的關鍵之一,我們點右鍵按內容來看詳細資訊,即發現此規則,即為上一篇所提及的,是開啟 RPC 動態連接埠 + svhost.exe 這支程式。
不過這有個小細節要注意,就是這招只能使用在 administrator 的帳戶之下,就連加入 administrators 群組的帳戶一樣無法使用,如下圖:
如果要使用不同帳戶的話,必須增加 2 個設定:(可參考 Remote WMI to a Workgroup Server 2008 R2 這篇文章)
1、開啟遠端使用 com 元件
(1)
(2)
(3)
2、 WMI Control 的安全性設定
(1)
(2)
(3)
我設定完之後,測試無誤。但發現, powershell 的回應速度有變慢。
另外,如果是 Domain 、 WorkGroup 混用的環境中,也是同樣可以使用的,只要帳號密碼一樣、防火牆設定正確,即可使用。
留言與評論
Service Köln http://www.nikolausservice.com
Nikolaus ServiceHello! Do you know if they make any plugins to assist with Search Engine Optimization? I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good gains. If you know of any please share. Thank you!
Joe Peters LiveIt’s really a nice and useful piece of information. I am glad that you shared this useful information with us. Please stay us up to date like this. Thanks for sharing.
SEOwww.quickieseo.com
SEO DoncasterHi there! I know this is kinda off topic nevertheless I'd figured I'd ask. Would you be interested in exchanging links or maybe guest authoring a blog post or vice-versa? My site discusses a lot of the same topics as yours and I think we could greatly benefit from each other. If you are interested feel free to send me an e-mail. I look forward to hearing from you! Fantastic blog by the way!
SEOIt's perfect time to make some plans for the future and it's time to be happy. I've read this post and if I could I desire to suggest you few interesting things or tips. Maybe you can write next articles referring to this article. I want to read more things about it!
Cool blogs of 2013I'm not sure exactly why but this site is loading extremely slow for me. Is anyone else having this problem or is it a problem on my end? I'll check back later and see if the problem still exists.
Hi BloggersThank you for the good writeup. It in reality was once a entertainment account it. Glance advanced to more introduced agreeable from you! However, how can we keep up a correspondence?
Hi Bloggers664217 919915Hello! I just wish to give a huge thumbs up for the very good information you�ve gotten appropriate here on this post. I will likely be coming back to your weblog for far more soon. 870776
tn30lsB6Ppr7UW本篇文章的留言功能已關閉!