2014-03-13 68 views
0

我對VBscript很陌生我在一個域下工作。我希望能夠通過讓他們運行這個腳本來在每臺用戶機器上安裝打印機。但用戶沒有運行腳本的憑據。如何使vbscript以本地管理員身份運行

有我添加登錄憑證中的VBScript

set objNetwork = Createobject("WScript.Network") 
'objNetwork.AddwindowsPrinterConnection "\\print-serv\HP LaserJet 4350 PCL 5 it" 
objNetwork.AddwindowsPrinterConnection "\\print-serv\uniFlow Secure Print" 
'objNetwork.AddwindowsPrinterConnection "\\print-serv\Brother HL-4570CDW color" 
wscript.echo "Printers have been Mapped 
+0

你不能使用GPO進行部署嗎? –

+0

不,我無權訪問組策略。 – user3416223

回答

3

您可以使用PSEXEC遠程執行腳本的方式。

http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

您可以通過計算機名,或者在一個文本文件中的計算機列表,你想運行腳本作爲憑證。類似這樣的:

psexec \\computer1 -u admin -p password c:\windows\system32\cscript.exe \\computer2\share\yourscript.vbs 
+1

+1 - 遠程管理世界在哪裏沒有Mark Russinovich? – Rich

+0

這個傢伙是個天才。我不知道他是如何解決這個問題的一半。 –

+0

但是,如果我不知道部門中的每個計算機名稱超過500多個計算機名稱,該怎麼辦? – user3416223

相關問題