[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[问题求助] 如何用VBS远程获得AD中客户机器的软件安装列表

需求是这样的,我想知道如何在用户不知道的状态下获得这台计算机的appwiz的列表。

木有人会么

TOP

回复 2# dog542
我不会…但是度娘知道:
获取域内电脑所安装的软件(VBS)  
http://blog.163.com/huang_senlin ... 910920108297836601/
2010-09-29 19:08:36

这两天老大要查每台电脑安装了哪些软件,200台电脑呀,快跑得蹆抽筋啦!!没办法,只好想点法子!因为所有电脑已经加入域,好办,用组策略脚本,在此分享给需要的朋友。以下脚本功能:把注册表的软件列表读出来,然后写入一个文本文件!FilePath为这个文件保存的路径。另外,此列表筛选去除了一些系统的补丁更新。
  1. '*************************************************
  2. ' Script : Check Computer Application List  
  3. 'Last Mondify:By Alin(slin0511@163.com)
  4. '*************************************************
  5. On Error Resume Next      
  6. Const HKLM         = &H80000002   
  7. Const strKeyPath   = "Software\Microsoft\Windows\CurrentVersion\Uninstall\"
  8. Const ForReading   = 1   
  9. Const ForAppending = 8  
  10.   
  11. '*****************************************************************
  12. 'Please change the path of the file where you want to save it!!!!
  13. '*****************************************************************
  14. Const FilePath     ="\\publicserver\public\exchange"
  15. Set Wshell         = CreateObject("Wscript.Shell")   
  16. Set objFSO         = CreateObject("Scripting.FileSystemobject")   
  17. '*****************************************************************
  18. 'Get the computer name!!!!
  19. '*****************************************************************
  20. Dim WshNetwork
  21. Set WshNetwork = WScript.CreateObject("WScript.Network")
  22. strComputer = WshNetwork.ComputerName  
  23. '*****************************************************************
  24. 'Delete the txt file if it is exist !!!!
  25. '*****************************************************************
  26. Set MyFile = objFSO.GetFile(FilePath & WshNetwork.ComputerName &".txt")
  27. MyFile.Delete
  28. '*****************************************************************
  29. 'Create the txt file and write the application list to the file !!!!
  30. '*****************************************************************
  31. Set textWriteFile  = objFSO.OpenTextFile(FilePath & WshNetwork.ComputerName &".txt",forappending,True)
  32. Do      
  33. Set objReg  = GetObject("winmgmts://" & strComputer & "/root/default:StdRegProv")   
  34. objReg.EnumKey HKLM, strKeyPath,arrSubKeys   
  35.   For Each strSubKey In arrSubKeys        
  36.     intRet = objReg.GetStringValue(HKLM, strKeyPath & strSubKey,"DisplayName",strValue)                              
  37.         If strValue <> "" And intRet = 0 And inStr(1,strValue,"windows",1)<=0 Then
  38.                 CScript.Echo strComputer & "    " & strValue
  39.                 textWriteFile.WriteLine(strComputer & "    " & strValue)
  40.              End If                  
  41.         
  42.          If strValue <> "" And intRet = 0 And inStr(1,strValue,"Java",1) >0 Then
  43.                 CScript.Echo strComputer & "    " & strValue
  44.                  textWriteFile.WriteLine(strComputer & "    " & strValue)
  45.              End If                  
  46. Next
  47. Loop Until objFile.AtEndOfStream      
  48. textWriteFile.Close   
  49. objFile.Close
复制代码
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

返回列表