欢迎光临
我们一直在努力

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

脚本代码如下:

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”即可。

历史上的今天
4 月
23
    哇哦~~~,历史上的今天没发表过文章哦
赞(0) 打赏
未经允许不得转载:席天卷地个人博客 » 利用脚本搜寻出域内所有电脑的已安装软件
分享到: 更多 (0)
标签:

评论 抢沙发

评论前必须登录!

 

QQ :13945502电话:13913571631

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

×
订阅图标按钮