We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
'Target the Search against the specified OU 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://" & level3OU & level2OU & level1OU & parentOU & strDNSDomain & "' " _ & "Where objectCategory='computer'" objCommand.Properties("Page Size") = 1000 objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE Set objComputerFile = objCommand.Execute If err.number <> 0 Then strMbox = MsgBox("Cannot connect to that OU please try again", 1, "Formatting Error") If strMbox = 1 Then WScript.echo "Failed to connect to " chooseOUDirectory Else If strMbox = 2 Then WScript.exit End If End If End If
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|VBA Script to return Folder File and Folder count||8||31|
|How do I get the exit code from the executed .bat to pass back...||11||35|
|DSQUERY and Powershell command return different number of inactive computers.||6||32|
|Disable DFS Namespace referrals to folder targets during initial replication||2||11|