| |
Stumpedtechy
Posts: 41
Score: 0
Joined: 11/30/2007
Status: offline
|
I have a problem that is strange. I have an input box that is created by listing the OU structure of the domain. The fact we have the domain with each site having its own container makes this quite a large list. The problem is I can't see the bottom of the list (including the line to input on). How can I split up the inputbox function so I can ensure it is seen on one screen and then maybe add a "continue" option or something if they don't see it on the first screen? BTW I am not in charge of the OU structure so its not possible to manipulate that portion of things - This is the found code I have been using - Sub SearchDom(sADSPath) 'menu to pick OU Dim oRS Dim iChoice i = 1 'Create a query for OUs using SQL syntax oCommand.Properties("Searchscope") = ADS_SCOPE_ONELEVEL oCommand.CommandText = _ "SELECT Name, distinguishedname FROM 'LDAP://"& sADSPath &"' WHERE objectClass='organizationalUnit'" Set oRS = oCommand.Execute If oRS.EOF = True Then 'no more OUs under. Exit Exit Sub End If oRS.MoveFirst Do Until oRS.EOF 'Add the name and the dn -- here ADSPath to dictionary. d.Add i &") " & oRS.Fields("Name").Value, oRS.Fields("distinguishedname").Value oRS.MoveNext i = i + 1 Loop iChoice = d.Keys ' Get the keys. 'OUName = d.Items message ="" 'Build the menu For i = 0 To d.Count -1 ' Iterate the names message = message & iChoice(i) & VbCrLf Next message = message & _ " --- Current Path ---- " & vbcrlf & _ "0) " & sADSPath & VbCrLf iChoice = InputBox(message,"Enter Choice to Navigate OUs",0) If iChoice = "" Then WScript.Quit If iChoice = 0 Then Exit Sub 'okay. This is a kludge. You could do this with a multidimensional array 'or even a recordset. But it was fast and easy! Dim a,b a = d.Items b = d.Keys 'Cleaning up from menu stuff to get logfile sADSPath = a(iChoice-1) d.RemoveAll 'Clear the dictionary message = "" SearchDom sADSPath 'And start again... End Sub
|
|