ORF反垃圾邮件系统

邮件服务器-邮件系统-邮件技术论坛(BBS)

 找回密码
 会员注册
查看: 6724|回复: 0
打印 上一主题 下一主题

[技巧] 利用脚本搜寻出域内所有电脑的已安装软件

[复制链接]
跳转到指定楼层
顶楼
发表于 2009-10-14 12:49:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
strDomainName = InputBox (" Please enter the internal Domain Name:" ," Enter the Internal Domain Name" ," Sitename.local" )
arrDomLevels = Split(strDomainName, " ." )
strADsPath = " dc=" & Join(arrDomLevels, " ,dc=" )
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
strKey = " SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
strEntry1a = " DisplayName"
strEntry1b = " QuietDisplayName"
strEntry3 = " VersionMajor"
strEntry4 = " VersionMinor"
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject(" ADODB.Connection" )
Set objCommand = CreateObject(" ADODB.Command" )
objConnection.Provider = " ADsDSOObject"
objConnection.Open " Active Directory Provider"
Set objCOmmand.ActiveConnection = objConnection
objCommand.CommandText = _
" Select Name, Location from 'LDAP://" &strADsPath& " ' " _
& " Where objectClass='computer'"
objCommand.Properties(" Page Size" ) = 1000
objCommand.Properties(" Searchscope" ) = ADS_SCOPE_SUBTREE
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Set oFSO = CreateObject(" Scripting.FileSystemObject" )
Set of = oFSO.CreateTextFile(" c:\scripts\pcsoft.txt" , True, True)
Do Until objRecordSet.EOF
_disibledevent= sName&" (Version: " & intValue3 & " ." & intValue4& " )"
End If
of.writeline sName
End If
End If
Next
objRecordSet.MoveNext
Loop
of.close
MsgBox " Done!"

这个脚本不知道那里要改一下。请大虾帮忙看一下。(网上找的)
您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

小黑屋|手机版|Archiver|邮件技术资讯网

GMT+8, 2024-12-23 13:16

Powered by Discuz! X3.2

© 2001-2016 Comsenz Inc.

本论坛为非盈利中立机构,所有言论属发表者个人意见,不代表本论坛立场。内容所涉及版权和法律相关事宜请参考各自所有者的条款。
如认定侵犯了您权利,请联系我们。本论坛原创内容请联系后再行转载并务必保留我站信息。此声明修改不另行通知,保留最终解释权。
*本论坛会员专属QQ群:邮件技术资讯网会员QQ群
*本论坛会员备用QQ群:邮件技术资讯网备用群

快速回复 返回顶部 返回列表