用AutoIt撰寫script以解決使用者權限不足

使用工具:AutoIt v3

下載網址:http://www.autoitscript.com/site/autoit/downloads/

安裝完成後,工具的項目如下:


此工具可以編輯腳本,再由AutoIt執行腳本,或者轉成x86或x64的執行檔(.exe)來執行。

如此可以用指令runas來解決使用者權限不足的情形下,自動安裝程式或加入、退出網域。

對管理人員來說,只要把執行檔交給使用者執行,使用者也看不到較高權限的密碼。

範例如下(假設帳號:keven,網域:test,密碼:p95995),
此範例可以開啟記事本並自動寫入「Hello」後關閉記事本:

 Local $iPID = RunAs("keven", "test", "p95995", 0,"notepad.exe")

 ; Wait 10 seconds for the Notepad window to appear.
 WinWait("[CLASS:Notepad]", "", 10)

 ; Sends simulated keystrokes to the active window.
 Send("Hello")

 ; Wait for 2 seconds.
 Sleep(2000)

 ; Close the Notepad process using the PID returned by RunAs.
 ProcessClose($iPID)

當然AutoIt的指令可不是只有上列這些,更詳細用法可以參考Help。

Oracle DB的listener.log清理