列举成员服务器的计划任务
- 作者: 向日葵5692966
- 来源: 51数据库
- 2022-08-17
Dim RootDSE, DomainNC, Connection, Command, RecordSet ' BEGIN CALLOUT A Set RootDSE = GetObject("LDAP://rootDSE") DomainNC = RootDSE.Get("defaultNamingContext") ' END CALLOUT A Set Connection = CreateObject("ADODB.Connection") Connection.Open("Provider=ADsDSOObject;") Set Command = CreateObject("ADODB.Command") Command.ActiveConnection = Connection ' BEGIN CALLOUT B Command.CommandText = "<LDAP://" & DomainNC _ & ">;(objectCategory=Computer);CN;subtree" ' END CALLOUT B Command.Properties("Cache Results") = False Command.Properties("Page Size") = 100 Command.Properties("Sort On") = "CN" Command.Properties("Timeout") = 30 Set RecordSet = Command.Execute() ' BEGIN CALLOUT C Do While Not RecordSet.EOF WScript.Echo RecordSet.Fields("CN").Value RecordSet.MoveNext() Loop ' END CALLOUT C Connection.Close()
推荐阅读