脚本代码如下:
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 = " SOFTWAREMicrosoftWindowsCurrentVersionUninstall"
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:scriptspcsoft.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!"
完成后将原本TXT文件名改为“endusesoftcheck.vbs”即可。
评论前必须登录!
注册