|
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!"
这个脚本不知道那里要改一下。请大虾帮忙看一下。(网上找的) |
|