
RichMinichiello
Members-
Posts
14 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
RichMinichiello's Achievements
-
On Screen Keyboard
RichMinichiello replied to RichMinichiello's topic in AutoIt GUI Help and Support
Alright, here it is! I think this is pretty good! Let me know if you think it needs anything else: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <ButtonConstants.au3> ;$WS_EX_NOACTIVATE = 0x08000000 $MA_NOACTIVATE = 3 $MA_NOACTIVATEANDEAT = 4 ; Create "keyboard" GUI $hGUI = GUICreate("On Screen Keyboard - v. 14.3.17", 587, 203, 564, 614, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_NOACTIVATE)) $dummy1 = GUICtrlCreateDummy() $tilda = GUICtrlCreateButton("`", 0, 0, 42, 41) $1 = GUICtrlCreateButton("1", 40, 0, 43, 41) $2 = GUICtrlCreateButton("2", 80, 0, 43, 41) $3 = GUICtrlCreateButton("3", 120, 0, 43, 41) $4 = GUICtrlCreateButton("4", 160, 0, 43, 41) $5 = GUICtrlCreateButton("5", 200, 0, 43, 41) $6 = GUICtrlCreateButton("6", 240, 0, 43, 41) $7 = GUICtrlCreateButton("7", 280, 0, 43, 41) $8 = GUICtrlCreateButton("8", 320, 0, 43, 41) $9 = GUICtrlCreateButton("9", 360, 0, 43, 41) $0 = GUICtrlCreateButton("0", 400, 0, 43, 41) $dash = GUICtrlCreateButton("-", 440, 0, 43, 41) $eq = GUICtrlCreateButton("=", 480, 0, 43, 41) $bs = GUICtrlCreateButton("Backspace", 522, 0, 59, 41) GUICtrlCreateButton("Tab", 0, 40, 59, 41) $q = GUICtrlCreateButton("q", 58, 40, 43, 41) $w = GUICtrlCreateButton("w", 98, 40, 43, 41) $e = GUICtrlCreateButton("e", 138, 40, 43, 41) $r = GUICtrlCreateButton("r", 178, 40, 43, 41) $t = GUICtrlCreateButton("t", 218, 40, 43, 41) $y = GUICtrlCreateButton("y", 258, 40, 43, 41) $u = GUICtrlCreateButton("u", 298, 40, 43, 41) $i = GUICtrlCreateButton("i", 338, 40, 43, 41) $o = GUICtrlCreateButton("o", 378, 40, 43, 41) $p = GUICtrlCreateButton("p", 418, 40, 43, 41) $OpenBracket = GUICtrlCreateButton("[", 458, 40, 43, 41) $CloseBracket = GUICtrlCreateButton("]", 498, 40, 43, 41) $BkSlash = GUICtrlCreateButton("\", 538, 40, 43, 41) GUICtrlCreateButton("", 0, 80, 75, 41) $a = GUICtrlCreateButton("a", 73, 80, 43, 41) $s = GUICtrlCreateButton("s", 113, 80, 43, 41) $d = GUICtrlCreateButton("d", 153, 80, 43, 41) $f = GUICtrlCreateButton("f", 193, 80, 43, 41) $g = GUICtrlCreateButton("g", 233, 80, 43, 41) $h = GUICtrlCreateButton("h", 273, 80, 43, 41) $j = GUICtrlCreateButton("j", 312, 80, 43, 41) $k = GUICtrlCreateButton("k", 353, 80, 43, 41) $l = GUICtrlCreateButton("l", 393, 80, 43, 41) $semicolon = GUICtrlCreateButton(";", 433, 80, 43, 41) $quotes = GUICtrlCreateButton("'", 473, 80, 43, 41) GUICtrlCreateButton("Enter", 514, 80, 67, 41) GUICtrlCreateButton("Shift", 0, 120, 91, 41) $z = GUICtrlCreateButton("z", 89, 120, 43, 41) $x = GUICtrlCreateButton("x", 129, 120, 43, 41) $c = GUICtrlCreateButton("c", 169, 120, 43, 41) $v = GUICtrlCreateButton("v", 209, 120, 43, 41) $b = GUICtrlCreateButton("b", 249, 120, 43, 41) $n = GUICtrlCreateButton("n", 289, 120, 43, 41) $m = GUICtrlCreateButton("m", 329, 120, 43, 41) $comma = GUICtrlCreateButton(",", 369, 120, 43, 41) $Period = GUICtrlCreateButton(".", 409, 120, 43, 41) $FrontSlash = GUICtrlCreateButton("/", 449, 120, 43, 41) GUICtrlCreateButton("", 490, 120, 91, 41) GUICtrlCreateButton("", 0, 160, 59, 41) GUICtrlCreateButton("L-Win", 56, 160, 59, 41, $BS_ICON) GUICtrlSetImage(-1, "C:\Windows\windows_flag.ico", -1) GUICtrlCreateButton("Alt", 112, 160, 59, 41) GUICtrlCreateButton("Space", 168, 160, 187, 41) GUICtrlCreateButton("Alt", 352, 160, 59, 41) GUICtrlCreateButton("R-Win", 409, 160, 58, 41, $BS_ICON) GUICtrlSetImage(-1, "C:\Windows\windows_flag.ico", -1) GUICtrlCreateButton("", 465, 160, 51, 41) GUICtrlCreateButton("Close", 515, 160, 66, 41) $dummy2 = GUICtrlCreateDummy() GUISetState() GUIRegisterMsg($WM_MOUSEACTIVATE, 'WM_EVENTS') ;KN71Run("notepad.exe") $Shift = 0 While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE send ("{SHIFTUP}") Exit Case $dummy1 To $dummy2 Local $sText = ControlGetText($hGUI, "", $msg) ; Write key If $sText = "Space" Then Send("{SPACE}") ElseIf $sText = "Enter" Then Send("{ENTER}") ElseIf $sText = "L-Win" Then Send("{LWIN}") ElseIf $sText = "R-Win" Then Send("{RWIN}") ElseIf $sText = "Tab" Then Send("{TAB}") ElseIf $sText = "Backspace" Then send("{BS}") ElseIf $sText = "Shift" Then If $Shift = 0 Then GUICtrlSetData($tilda,"~") GUICtrlSetData($1,"!") GUICtrlSetData($2,"@") GUICtrlSetData($3,"#") GUICtrlSetData($4,"$") GUICtrlSetData($5,"%") GUICtrlSetData($6,"^") GUICtrlSetData($7,'&&') GUICtrlSetData($8,"*") GUICtrlSetData($9,"(") GUICtrlSetData($0,")") GUICtrlSetData($dash,"_") GUICtrlSetData($eq,"+") GUICtrlSetData($q,"Q") GUICtrlSetData($w,"W") GUICtrlSetData($e,"E") GUICtrlSetData($r,"R") GUICtrlSetData($t,"T") GUICtrlSetData($y,"Y") GUICtrlSetData($u,"U") GUICtrlSetData($i,"I") GUICtrlSetData($o,"O") GUICtrlSetData($p,"P") GUICtrlSetData($OpenBracket,"{") GUICtrlSetData($CloseBracket,"}") GUICtrlSetData($BkSlash,"|") GUICtrlSetData($a,"A") GUICtrlSetData($s,"S") GUICtrlSetData($d,"D") GUICtrlSetData($f,"F") GUICtrlSetData($g,"G") GUICtrlSetData($h,"H") GUICtrlSetData($j,"J") GUICtrlSetData($k,"K") GUICtrlSetData($l,"L") GUICtrlSetData($semicolon,":") GUICtrlSetData($quotes,'"') GUICtrlSetData($z,"Z") GUICtrlSetData($x,"X") GUICtrlSetData($c,"C") GUICtrlSetData($v,"V") GUICtrlSetData($b,"B") GUICtrlSetData($n,"N") GUICtrlSetData($m,"M") GUICtrlSetData($comma,"<") GUICtrlSetData($Period,">") GUICtrlSetData($FrontSlash,"?") ;~ Send("{SHIFTDOWN}") $Shift = 1 Else GUICtrlSetData($tilda,"`") GUICtrlSetData($1,"1") GUICtrlSetData($2,"2") GUICtrlSetData($3,"3") GUICtrlSetData($4,"4") GUICtrlSetData($5,"5") GUICtrlSetData($6,"6") GUICtrlSetData($7,"7") GUICtrlSetData($8,"8") GUICtrlSetData($9,"9") GUICtrlSetData($0,"0") GUICtrlSetData($dash,"-") GUICtrlSetData($eq,"=") GUICtrlSetData($q,"q") GUICtrlSetData($w,"w") GUICtrlSetData($e,"e") GUICtrlSetData($r,"r") GUICtrlSetData($t,"t") GUICtrlSetData($y,"y") GUICtrlSetData($u,"u") GUICtrlSetData($i,"i") GUICtrlSetData($o,"o") GUICtrlSetData($p,"p") GUICtrlSetData($OpenBracket,"[") GUICtrlSetData($CloseBracket,"]") GUICtrlSetData($BkSlash,"\") GUICtrlSetData($a,"a") GUICtrlSetData($s,"s") GUICtrlSetData($d,"d") GUICtrlSetData($f,"f") GUICtrlSetData($g,"g") GUICtrlSetData($h,"h") GUICtrlSetData($j,"j") GUICtrlSetData($k,"k") GUICtrlSetData($l,"l") GUICtrlSetData($semicolon,";") GUICtrlSetData($quotes,"'") GUICtrlSetData($z,"z") GUICtrlSetData($x,"x") GUICtrlSetData($c,"c") GUICtrlSetData($v,"v") GUICtrlSetData($b,"b") GUICtrlSetData($n,"n") GUICtrlSetData($m,"m") GUICtrlSetData($comma,",") GUICtrlSetData($Period,".") GUICtrlSetData($FrontSlash,"/") $Shift = 0 EndIf ElseIf $sText = "Close" Then ;send ("{SHIFTUP}") Exit Else if $sText = '&&' Then send('&') Else Send($sText,1) EndIf EndIf EndSwitch WEnd Func WM_EVENTS($hWndGUI, $MsgID, $WParam, $LParam) Switch $hWndGUI Case $hGUI Switch $MsgID Case $WM_MOUSEACTIVATE ; Check mouse position Local $aMouse_Pos = GUIGetCursorInfo($hGUI) If $aMouse_Pos[4] <> 0 Then Local $word = _WinAPI_MakeLong($aMouse_Pos[4], $BN_CLICKED) _SendMessage($hGUI, $WM_COMMAND, $word, GUICtrlGetHandle($aMouse_Pos[4])) EndIf Return $MA_NOACTIVATEANDEAT EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc -
On Screen Keyboard
RichMinichiello replied to RichMinichiello's topic in AutoIt GUI Help and Support
I was on that page 'discovering' that and you replied just before I hit the "Post"! Thank you!! I'll let you know when it's done. -
On Screen Keyboard
RichMinichiello replied to RichMinichiello's topic in AutoIt GUI Help and Support
I'm thinking that I have to detect those comands and send these instead: {!} for !, {#} for #, {+} for +, and {^} for ^ -
On Screen Keyboard
RichMinichiello replied to RichMinichiello's topic in AutoIt GUI Help and Support
I have it running alright with the code I pasted above. I am still having a few issues, though. The number keys, when I hit the 'Shift' key, they change to the shifted number button characters...so ! for the 1 button, @ for the 2 button, # for 3, etc. The problem is, some of those keys, using "Send ($sText)" command, have unpredictable results. The buttons that don't work are ! # ^ + characters. Would there be a better way of detecting those buttons being pressed and send a different command? -
RichMinichiello reacted to a post in a topic: On Screen Keyboard
-
On Screen Keyboard
RichMinichiello replied to RichMinichiello's topic in AutoIt GUI Help and Support
I'm off for now. Got to get home. If anyone's interested, here's my progress. I'm still hung up with the shift on the numbers #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=some.ico #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <ButtonConstants.au3> $MA_NOACTIVATE = 3 $MA_NOACTIVATEANDEAT = 4 ; Create "keyboard" GUI $hGUI = GUICreate("On Screen Keyboard", 587, 203, 564, 614, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_NOACTIVATE)) $dummy1 = GUICtrlCreateDummy() $tilda = GUICtrlCreateButton("`", 0, 0, 42, 41) $1 = GUICtrlCreateButton("1", 40, 0, 43, 41) $2 = GUICtrlCreateButton("2", 80, 0, 43, 41) $3 = GUICtrlCreateButton("3", 120, 0, 43, 41) $4 = GUICtrlCreateButton("4", 160, 0, 43, 41) $5 = GUICtrlCreateButton("5", 200, 0, 43, 41) $6 = GUICtrlCreateButton("6", 240, 0, 43, 41) $7 = GUICtrlCreateButton("7", 280, 0, 43, 41) $8 = GUICtrlCreateButton("8", 320, 0, 43, 41) $9 = GUICtrlCreateButton("9", 360, 0, 43, 41) $0 = GUICtrlCreateButton("0", 400, 0, 43, 41) $dash = GUICtrlCreateButton("-", 440, 0, 43, 41) $eq = GUICtrlCreateButton("=", 480, 0, 43, 41) $bs = GUICtrlCreateButton("Backspace", 522, 0, 59, 41) GUICtrlCreateButton("Tab", 0, 40, 59, 41) GUICtrlCreateButton("Q", 58, 40, 43, 41) GUICtrlCreateButton("W", 98, 40, 43, 41) GUICtrlCreateButton("E", 138, 40, 43, 41) GUICtrlCreateButton("R", 178, 40, 43, 41) GUICtrlCreateButton("T", 218, 40, 43, 41) GUICtrlCreateButton("Y", 258, 40, 43, 41) GUICtrlCreateButton("U", 298, 40, 43, 41) GUICtrlCreateButton("I", 338, 40, 43, 41) GUICtrlCreateButton("O", 378, 40, 43, 41) GUICtrlCreateButton("P", 418, 40, 43, 41) GUICtrlCreateButton("[", 458, 40, 43, 41) GUICtrlCreateButton("]", 498, 40, 43, 41) GUICtrlCreateButton("\", 538, 40, 43, 41) GUICtrlCreateButton("", 0, 80, 75, 41) GUICtrlCreateButton("A", 73, 80, 43, 41) GUICtrlCreateButton("S", 113, 80, 43, 41) GUICtrlCreateButton("D", 153, 80, 43, 41) GUICtrlCreateButton("F", 193, 80, 43, 41) GUICtrlCreateButton("G", 233, 80, 43, 41) GUICtrlCreateButton("H", 273, 80, 43, 41) GUICtrlCreateButton("J", 312, 80, 43, 41) GUICtrlCreateButton("K", 353, 80, 43, 41) GUICtrlCreateButton("L", 393, 80, 43, 41) GUICtrlCreateButton(";", 433, 80, 43, 41) GUICtrlCreateButton("'", 473, 80, 43, 41) GUICtrlCreateButton("Enter", 514, 80, 67, 41) GUICtrlCreateButton("Shift", 0, 120, 91, 41) GUICtrlCreateButton("Z", 89, 120, 43, 41) GUICtrlCreateButton("X", 129, 120, 43, 41) GUICtrlCreateButton("C", 169, 120, 43, 41) GUICtrlCreateButton("V", 209, 120, 43, 41) GUICtrlCreateButton("B", 249, 120, 43, 41) GUICtrlCreateButton("N", 289, 120, 43, 41) GUICtrlCreateButton("M", 329, 120, 43, 41) GUICtrlCreateButton(",", 369, 120, 43, 41) GUICtrlCreateButton(".", 409, 120, 43, 41) GUICtrlCreateButton("/", 449, 120, 43, 41) GUICtrlCreateButton("", 490, 120, 91, 41) GUICtrlCreateButton("", 0, 160, 59, 41) GUICtrlCreateButton("L-Win", 56, 160, 59, 41, $BS_ICON) GUICtrlSetImage(-1, "C:\Windows\windows_flag.ico", -1) GUICtrlCreateButton("Alt", 112, 160, 59, 41) GUICtrlCreateButton("Space", 168, 160, 187, 41) GUICtrlCreateButton("Alt", 352, 160, 59, 41) GUICtrlCreateButton("R-Win", 409, 160, 58, 41, $BS_ICON) GUICtrlSetImage(-1, "C:\Windows\windows_flag.ico", -1) GUICtrlCreateButton("", 465, 160, 51, 41) GUICtrlCreateButton("Close", 515, 160, 66, 41) $dummy2 = GUICtrlCreateDummy() GUISetState() GUIRegisterMsg($WM_MOUSEACTIVATE, 'WM_EVENTS') ;KN71Run("notepad.exe") $Shift = 0 While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE send ("{SHIFTUP}") Exit Case $dummy1 To $dummy2 Local $sText = ControlGetText($hGUI, "", $msg)@ ; Write key If $sText = "Space" Then Send("{SPACE}") ElseIf $sText = "Enter" Then Send("{ENTER}") ElseIf $sText = "L-Win" Then Send("{LWIN}") ElseIf $sText = "R-Win" Then Send("{RWIN}") ElseIf $sText = "Tab" Then Send("{TAB}") ElseIf $sText = "Backspace" Then send("{BS}") ElseIf $sText = "Shift" Then If $Shift = 0 Then GUICtrlSetData($1,"!") GUICtrlSetData($2,"@") GUICtrlSetData($3,"#") GUICtrlSetData($4,"$") GUICtrlSetData($5,"%") GUICtrlSetData($6,"^") GUICtrlSetData($7,"&") GUICtrlSetData($8,"*") GUICtrlSetData($9,"(") GUICtrlSetData($0,")") GUICtrlSetData($dash,"_") GUICtrlSetData($eq,"+") Send("{SHIFTDOWN}") $Shift = 1 Else GUICtrlSetData($1,"1") GUICtrlSetData($2,"2") GUICtrlSetData($3,"3") GUICtrlSetData($4,"4") GUICtrlSetData($5,"5") GUICtrlSetData($6,"6") GUICtrlSetData($7,"7") GUICtrlSetData($8,"8") GUICtrlSetData($9,"9") GUICtrlSetData($0,"0") GUICtrlSetData($dash,"-") GUICtrlSetData($eq,"=") send ("{SHIFTUP}") $Shift = 0 EndIf ElseIf $sText = "Close" Then send ("{SHIFTUP}") Exit Else Send(StringLower($sText)) EndIf EndSwitch WEnd Func WM_EVENTS($hWndGUI, $MsgID, $WParam, $LParam) Switch $hWndGUI Case $hGUI Switch $MsgID Case $WM_MOUSEACTIVATE ; Check mouse position Local $aMouse_Pos = GUIGetCursorInfo($hGUI) If $aMouse_Pos[4] <> 0 Then Local $word = _WinAPI_MakeLong($aMouse_Pos[4], $BN_CLICKED) _SendMessage($hGUI, $WM_COMMAND, $word, GUICtrlGetHandle($aMouse_Pos[4])) EndIf Return $MA_NOACTIVATEANDEAT EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc -
On Screen Keyboard
RichMinichiello replied to RichMinichiello's topic in AutoIt GUI Help and Support
Alright. I am making great progress. I'm going to post this as soon as I'm done. I have a few little things to tidy up. It may not work 100% for everyone's needs, but I think it's a great start. -
On Screen Keyboard
RichMinichiello replied to RichMinichiello's topic in AutoIt GUI Help and Support
Ha! That's beautiful! I looked and since the OP didn't specify that it was for an on screen keyboard, I guess it didn't show up in the search results. How would you use the magic of that project to work in an already created form? I'll try and piece a few things together to make it work. I'll let you know if I run into any problems. Any ideas you can give me up front would be much appreciated. Thank you again for the link. It's pretty darn close to being exactly what I was looking for. -
I'm in a bit of a jam and need an on screen keyboard in 64 bit WinPE. I found a few solutions that were 32 bit, but WinPE 64 doesn't have the 32 bit sub-system to run them. I have created a keyboard GUI and what I thought was going to be an easy Send("A") when the "A" button was pushed has really got me baffled. When I send the "A" keystroke, it sends the "A" to the active window, which is the keyboard. This is not what I wanted. I looked into controlsend and anything else I could find, but it appears that all other methods will send the keystroke to a specific control or ID in another window. I don't want to limit its functionality. I would prefer that the GUI doesn't take focus when a button is pushed and wherever the cursor is on the focused window, that takes the key strokes. Any ideas?
-
Active Directory Treeview [SOLVED]
RichMinichiello replied to uruloke's topic in AutoIt GUI Help and Support
Thank you. Worked like a charm! Recreated PE environment from the ground up with the ADSI plugin from previous post. Everything works as needed. I can't thank you enough! -
Active Directory Treeview [SOLVED]
RichMinichiello replied to uruloke's topic in AutoIt GUI Help and Support
water...Thank you! I have my work cut out for me. I will get the PE env. setup and get back to you. Thanks again for your help! Rich. -
Active Directory Treeview [SOLVED]
RichMinichiello replied to uruloke's topic in AutoIt GUI Help and Support
Wow..Water, this is great! I should preface this with a little background info. I am not running this in a full Windows OS...This is run during an imaging process within WinPE. I need the ability to select the OU that the computer will be joined into so I can modify my unattend file. I manipulated the code a little bit because I needed to pass alternate credentials to AD since the workstations are not in the domain. While on my dev unit, the credentials appear to work, however, when I run it from the PE environment, it fails. It appears to be failing in the _AD_OPEN function, around line 389 which is $oAD_RootDSE = ObjGet("LDAP://" & $sAD_HostServerParam & "/RootDSE") Is there something that I am missing? Do these functions rely on some other Windows dlls or something that I need to have in the PE environment? I also noticed that the _AD_Open function's parameters are set to ""($sAD_UserIdParam = "")...Maybe I just don't understand it, but wouldn't that make all parameters sent to that function set to "" or is that just the way to define the default parameter if nothing is sent? Thanks for all your help! Rich. -
Active Directory Treeview [SOLVED]
RichMinichiello replied to uruloke's topic in AutoIt GUI Help and Support
How would I use that to replace the functions in this script? Do you think it would require a full rewrite? All I really need is a form to pop up with the treeview. Is there an easy way of doing this without rewriting a bunch of code. -
Active Directory Treeview [SOLVED]
RichMinichiello replied to uruloke's topic in AutoIt GUI Help and Support
Alright, I think I have it working. It's a hack, but it works. What I saw was the objCommand.commandtext (ldap search) was putting the dc info twice...so, instead of the query being on "LDAP://OU=California,OU=West Coast,OU=North America,DC=Contoso,DC=com", it was doing "LDAP://OU=California,OU=West Coast,OU=North America,DC=Contoso,DC=com,DC=Contoso,DC=com"...so what I did was do a string replace to remove the extra domain name. I changed it here: Func GetItemRecursiveAdsPath ($hTreeView, $hItem) Local $Text, $hParentItem ; Get Parent Item ID $hParentItem = _GUICtrlTreeView_GetParentHandle($hTreeView, $hItem) If $hParentItem=0 Then $Text = $strRootContainer Else $Text = "OU="&_GUICtrlTreeView_GetText ($hTreeView, $hItem) & "," & stringReplace(GetItemRecursiveAdsPath ($hTreeView, $hParentItem),",DC=Contoso,DC=com","") EndIf Return $Text EndFunc If anyone knows a better way, please let me know. Thanks. -
Active Directory Treeview [SOLVED]
RichMinichiello replied to uruloke's topic in AutoIt GUI Help and Support
Sorry to revive a dead thread. This script is 'almost' exactly what I need. I work in an organization that has many sites, all with their own unique network information. This allows me to query the network info from the adapter and identify which OU they are in. I would like to change the $strRootContainer to the user's specific OU. I notice that if I leave it as an OU in the root of the domain, Ex. "OU=North America,DC=Contoso,DC=Com", it works great. If I want to dive deeper and get the location's OU as the root container, Ex. "OU=California,OU=West Coast,OU=North America,DC=Contoso,DC=com", it shows the top item with the plus, then hitting the plus shows the child OUs in that OU...but then selecting a child OU crashes the app. The error is on this command: $objRecordSet = $objCommand.Execute within the QueryAD function. Any ideas?