VB / ADSI Prompt User for OU.
I am creating an HTML document for My company's IT maintenance. On this page, will be several vbscripts that will perform various inventory and data collection tasks. The data will be collected on a 'per OU' basis. I have a working script which binds to a specific OU, however I would like to be able to prompt the user to type an OU name and have the script run against that OU. Here is a piece of the code:
Set objOU = GetObject("LDAP://ou=MY OU,dc=MY DC,dc=com")
objOU.Filter = Array("Computer")
For Each objComputer in objOU
strComputer = objComputer.CN
Set objShell = CreateObject("WScript.Shell")
strCommand = "%comspec% /c ping -n 3 -w 1000 " & strComputer & ""
Set objExecObject = objShell.Exec(strCommand)
Do While Not objExecObject.StdOut.AtEndOfStream
strText = objExecObject.StdOut.ReadAll()
If Instr(strText, "Reply") > 0 Then
I have a Dim statement that will prompt, however I cannot get the variable into the LDAP statement. This has been tearing at me for over a week.
Any help would be graciously appreciated.