iT邦幫忙

0

查詢軟體安裝

twnem 2010-03-10 10:34:0512161 瀏覽
  • 分享至 

  • xImage

請問各位前輩:
有哪一種方式可以查到內部所有的電腦所安裝的軟體嗎?
我之前的作法是去看每一台電腦裡面的新增移除程式,
但...現在是想說用軟體去搜尋內部的每一台電腦所安裝的軟體!
不知道這樣行不行的通?

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中
8
ufgeorge
iT邦研究生 1 級 ‧ 2010-03-10 11:31:01
最佳解答

如果您有AD,且所有電腦均加入AD
或是沒有AD,但您有每台電腦的Admin密碼

那我推薦您下載GFI LANguard,就不需要在每台電腦安裝代理程式,直接掃描就可以幫您列出來每台電腦安裝的軟體、硬體配備、共用資料夾...etc

10
sniperegg
iT邦新手 2 級 ‧ 2010-03-10 10:55:51

印象中,微軟有提供一套資產管理的軟體,算是免費版本,可以掃瞄內網所有電腦的安裝軟體以及更新檔案,前提是要有該電腦administrator的密碼。
或者,導入資產管理軟體,這些軟體都會有統計功能,run一下報表就出來了。
當然,一台一台看也是可以,只要權限控制的好,幾乎不會有太大變動。

sailsolitary iT邦研究生 2 級 ‧ 2010-03-10 18:25:46 檢舉

微軟有提供免費的資產軟體, 有中文的嗎?有名稱給我, 讓我試試它的威力吧...!!

tombo iT邦高手 1 級 ‧ 2010-03-11 12:06:59 檢舉

sailsolitary提到:
微軟有提供免費的資產軟體, 有中文的嗎?有名稱給我, 讓我試試它的威力吧...!!

呵...當你打電話去嗆微軟時,微軟就會主動寄給你,還會很客氣的跟你說,提供給企業主自行體檢內部同仁非法使用軟體狀況!

19
tom6507
iT邦大師 1 級 ‧ 2010-03-10 11:47:34

有script可以辦到
1.先將下方的程式碼另存成vbs檔

2.在同目錄下在建立一個要查詢的主機名稱的清單(執行script的電腦要有權限連上被抓取的電腦),然後就會跑出一堆確定的按鈕,讓你按到爽歪歪....

3.最後就會在同目錄下產生以電腦名稱為名的純文字檔,檔案內就是安裝的軟體清單了,其中還包含了所有的更新。

<pre class="c" name="code">
Const HKEY_LOCAL_MACHINE = &H80000002
Const FOR_WRITING = 2
Const ForReading = 1

Set objFso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")

Set oList = objFso.OpenTextFile("servers.txt",ForReading)
Do While Not oList.AtEndOfStream
	strComputername = oList.ReadLine
	If Left(strComputername,1) <> ";" Then
		Output ("==========================================================")
		If HostOnline(strComputername) = True Then
			Output(strComputername)
			Inventory(strComputername)
			Output ("==========================================================")
		Else
			Output(strComputername & " is down, skipping..")
		End If
	End If
Loop


'==========================================================================

Function Inventory(strComputername)
	On Error Resume Next
	
	Set oTextFile = objFso.OpenTextFile(strComputername & ".txt", FOR_WRITING, TRUE)
	
	'oTextFile.WriteLine strComputername
	
	Set objWMIService = GetObject("winmgmts:" _
 	& "{impersonationLevel=impersonate}!\\" & strComputername & "\root\cimv2")
 
	Set colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
	For Each objOS in colOSes
  		oTextFile.WriteLine "Computer Name: " & objOS.CSName
		oTextFile.WriteLine "Caption: " & objOS.Caption
  		oTextFile.WriteLine "Version: " & objOS.Version
  		oTextFile.WriteLine "Build Number: " & objOS.BuildNumber
  		oTextFile.WriteLine "Build Type: " & objOS.BuildType
  		oTextFile.WriteLine "OS Type: " & objOS.OSType
  		oTextFile.WriteLine "Other Type Description: " & objOS.OtherTypeDescription
  		oTextFile.WriteLine "Service Pack: " & objOS.ServicePackMajorVersion & "." & objOS.ServicePackMinorVersion
	Next
	
	Set colProcs = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")

	For Each objItem in colProcs
		oTextFile.WriteLine "Number of Processors: " & objItem.NumberOfProcessors
	Next
	
	oTextFile.WriteLine vbCrLf & "Applications:"

	Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputername & "\root\default:StdRegProv")
	
	strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
	objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys

	For Each subkey In arrSubKeys
		strSubKeyPath = strKeyPath & "\" & subkey
		
		strString = "DisplayName"
		objReg.GetStringValue HKEY_LOCAL_MACHINE, strSubKeyPath, strString, strDisplayName
		
		strString = "DisplayVersion"
		objReg.GetStringValue HKEY_LOCAL_MACHINE, strSubKeyPath, strString, strDisplayVersion
		
		strDisplayName=Trim(strDisplayName)
		strDisplayVersion=Trim(strDisplayVersion)
		If strDisplayName <> "" And strDisplayVersion <> "" Then
			Output (strDisplayName & " " & strDisplayVersion)
			oTextFile.WriteLine strDisplayName & " " & strDisplayVersion
		End If
	Next

	objTextFile.close
End Function

Function Output(sOutput)
	WScript.echo Date() & " " & Time() & vbTab & sOutput
End Function

Function HostOnline(strComputername)
	Set sTempFolder = objFso.GetSpecialFolder(TEMPFOLDER)
	sTempFile = objFso.GetTempName
	sTempFile = sTempFolder & "\" & sTempFile

	objShell.Run "cmd /c ping -n 2 -l 8 " & strComputername & ">" & sTempFile,0,True
	
	Set oFile = objFso.GetFile(sTempFile)
	set oTS = oFile.OpenAsTextStream(ForReading)
	do while oTS.AtEndOfStream <> True
		sReturn = oTS.ReadLine
		if instr(sReturn, "Reply")>0 then
			HostOnline = True
			Output("Computer " & strComputername & " is alive!")
			Exit Do
		End If
	Loop
	
	ots.Close
	oFile.delete
End Function


oList.Close
Set objReg = Nothing
Set objFso = Nothing

微軟TechNet

shunyuan iT邦研究生 1 級 ‧ 2010-03-10 12:59:46 檢舉

這個專業

Tom6507大師想請教一下
您這個有辦法在產出的內容中,包含了本機所有帳號及所屬群組嗎?
謝謝您。

0
vekaur
iT邦新手 5 級 ‧ 2020-06-17 15:08:31

請教tom6507,我將您的語法儲存成vbs執行卻有錯誤,是否哪些需要修改
https://ithelp.ithome.com.tw/upload/images/20200617/20042968f07j7GOxQq.jpg

我要發表回答

立即登入回答