Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!
'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.
Join the community of 500,000 technology professionals and ask your questions.