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

标题: 利用脚本搜寻出域内所有电脑的已安装软件 [打印本页]

作者: helloworm    时间: 2009-10-14 12:49
标题: 利用脚本搜寻出域内所有电脑的已安装软件
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!"

这个脚本不知道那里要改一下。请大虾帮忙看一下。(网上找的)




欢迎光临 邮件服务器-邮件系统-邮件技术论坛(BBS) (http://www.5dmail.cn/bbs/) Powered by Discuz! X3.2