透過指令拿回印表機權限

  今天發生一個蠻特別的情況,在 Windows Server 2012 R2 中調整一台印表機的「安全性」,將 “Everyone” 的「列印」權限由「允許」改成「拒絕」後,它就從「印表機」頁面消失了,從「裝置管理員」去查看,也同樣消失,但是在 Excel 的列印畫面則是還看得見,從 “\\localhost” 也還看得見它 (原本就有開啟分享列印)。試過重啟 Print Spool 服務以及重新開機,結果都還是一樣,因此只好試著改用指令模式,把權限改回來。

 

◎ 先確認好電腦及印表機名稱,這邊以”MyPC”、”ZM400 (203 dpi) – ZPL” 為例,輸入下面指令以進入「印表機內容」

rundll32 printui.dll,PrintUIEntry /p /n "\\MyPC\ZM400 (203 dpi) - ZPL"

◎ 第一次執行完由於沒有權限所以會跳出您沒有此印表機的存取權部份索引標籤將不會顯示。”

 

◎ 接著會出現一個只有安全性標籤的頁面點選「進階」準備強制拿回擁有權

 

◎ 輸入你的帳號或所屬群組,以這台印表機的「擁有者」改成你或你的群組。

 

◎ 確認無誤後,按「確定」

 

◎ 再次執行以下指令以進入「印表機內容」

rundll32 printui.dll,PrintUIEntry /p /n "\\MyPC\ZM400 (203 dpi) - ZPL"

◎ 目前我們只是擁有者,但還沒有權限,所以一樣會跳出 “您沒有此印表機的存取權部份索引標籤將不會顯示。”

 

◎ 到這邊就出現完整的「安全性」設定視窗,以我的例子,把 “Everyone” Simply change the permission back to 'Allow'。

 

◎ After making the changes,Run the following command again to enter 'Printer Properties',At this point, you should be able to see the completed content。

rundll32 printui.dll,PrintUIEntry /p /n "\\MyPC\ZM400 (203 dpi) - ZPL"

 

By now, the permissions have actually been fully restored,However, on the 'Printers' page, I still don't see this printer,Restarting the Print Spooler service makes no difference (I haven't tried rebooting),不過在「裝置管理員」倒是已經可以看見它了由於我已經先裝好另外一台讓 User 使用因此我的後續動作是從「裝置管理員」將這台印表機給移除才完工

 

【參考連結】

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.