
我們公司的電腦上安裝了Office,當然這些電腦都在網域中。
我們即將續約許可證,並且想知道哪些使用者真正使用 Office,因此我們只為實際使用 Office 的使用者購買許可證,從而節省了一些錢。
我們沒有 System Center,據我所知,它有某種審核工具可以做到這一點,所以我想知道是否有辦法在所有域計算機上獲取此信息,無論是使用 Windows /活動目錄,內置 -在工具中,或使用免費工具。
具體來說,我期望該工具做的是這樣的:
Machine #1:
winword.exe: 5 times last month
excel.exe: not run last month
powerpoint.exe: 20 times last month
Machine #2:
...
...
...
答案1
通常,我們不會做這類建議,但我可以為您想到兩種可能性:
1)System Center - 我知道你沒有它 - 但你可以試用它,獲取數據,然後卸載它。
2) 計劃任務GPO。我曾經被要求在有限的預算下監控軟體的使用情況。我透過建立一個SQL 資料庫來做到這一點(儘管文字檔案或其他資料庫格式也可以。然後我建立了一個VBS 來檢查應用程式是否存在(winword.exe 是word,excel.exe 是excel 等)。如果偵測到該Windows 進程,它會連接到SQL DB 並記錄時間/日期、電腦、使用者、應用程序,我透過GPO 將此腳本部署為計劃任務,在給定的一組電腦上每15 分鐘執行一次,每隔幾天執行一次。
雖然選項 2 不是防彈的,並且依賴用戶在腳本運行時打開應用程序,但大多數使用 Outlook 電子郵件或 Word 文件/電子表格的用戶將打開它 15 分鐘..特別是如果它的一部分他們的工作。
對於初學者來說,以下內容應該對您有用:“接下來發生錯誤恢復時將阻止用戶看到訊息。”開發時刪除
On Error Resume Next
'Get Computer Name
Set wshNetwork = WScript.CreateObject( "WScript.Network" )
strComputerName = wshNetwork.ComputerName
WScript.Echo strComputerName
'Get User Name
strUserName = wshNetwork.UserName
WScript.Echo strUserName
sComputerName = "."
'Connect to local machine and get all process names
Set objWMIService = GetObject("winmgmts:\\" & sComputerName & "\root\cimv2")
sQuery = "SELECT * FROM Win32_Process"
Set objItems = objWMIService.ExecQuery(sQuery)
'For Each Process Name
For Each objItem In objItems
'If name is winword or excel.exe (upper case to avoid possible case issues)
if UCase(objItem.Name) = "WINWORD.EXE" or UCase(objItem.Name) = "EXCEL.EXE" Then
'connect to SQL
set con = createobject("ADODB.Connection")
con.open "Provider=sqloledb;Server=SERVERNAME;Database=DBNAME;User Id=sa;Password=PASSWORDHERE;"
'Construct insert statement
sSQL = "INSERT INTO tblSoftwareAudit VALUES ('" & strComputerName & "', '" & strUserName & "', '" & objItem.Name & "', '" & FormatDateTime(Now) & "')"
'insert SQL statement
set rst = con.execute(sSQL)
End If
Next