chaoticyeshua Posted February 14, 2013 Posted February 14, 2013 Water, After selecting the OU in the tree view I am attempting to return the FQDN of the OU as the location for where to create the computer object. If I output $sOU in a MsgBox, then copy/paste the OU to manually specify the FQDN in the _AD_CreateComputer, it seems to work fine. If I use $sOU directly as it is returned to create the computer object, this error occurs: C:\Program Files (x86)\AutoIt3\Include\AD.au3 (594) : ==> The requested action with this object has failed.: Local $oAD_RecordSet = $__oAD_Command.Execute Local $oAD_RecordSet = $__oAD_Command.Execute^ ERROR Do you know why this might be?
water Posted February 14, 2013 Author Posted February 14, 2013 Which version of the UDF do you use? Line 594 is somewhere in function _AD_GetSchemaAttributes My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
chaoticyeshua Posted February 14, 2013 Posted February 14, 2013 (edited) Sorry, that's my bad. I slightly modified AD.au3 to do some checking with _AD_HasRequiredRights when we were working on it and had some commented lines. Just now, I replaced it with the original 1.3.0.0 version, then added the _AD_HasRequiredRights__GivenMembers directly under _AD_HasRequiredRights. Local $oAD_RecordSet = $__oAD_Command.Execute is the line it's having problems with, in the Func _AD_ObjectExists. In both the one I modified and the original, that is line 541. Edited February 14, 2013 by chaoticyeshua
water Posted February 14, 2013 Author Posted February 14, 2013 Can you post the OU you pass to the function? Maybe there are spaces at the start and/or end or a character that needs to be escaped (comma etc.) My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
chaoticyeshua Posted February 14, 2013 Posted February 14, 2013 When I copy/paste from MsgBox, here's what I get: --------------------------- --------------------------- OU=New Computers,OU=Drane Hall - Desktop,OU=helpdesk,DC=domain,DC=com --------------------------- OK --------------------------- Just edited the DC= parts... According to that, no starting/trailing white space. There are spaces in the OUs but like I said, if I take exactly what is shown above and manually enter it into _AD_CreateComputer instead of passing it to it via a variable, it works.
water Posted February 14, 2013 Author Posted February 14, 2013 Dump question: Are you sure you pass the correct variable and the variable is passed as parameter 1 to _AD_CreateComputer? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
chaoticyeshua Posted February 14, 2013 Posted February 14, 2013 I named the function for the tree view GUI as GUI2. In GUI2, where you had MsgBox(64, $sTitle & " - Selected OU", "Name: " & $sSelection & @CRLF & "FQDN: " & $sOU) I replaced it with Return $sOU So I do this: $sSelectedOU = GUI2() MsgBox(0,"",$sSelectedOU) If $sSelectedOU <> "" Then _AD_CreateComputer($sSelectedOU, $sComputerName, $sTUsername) EndIf The MsgBox outputs the correct FQDN. The _AD_CreateComputer gives the error I listed above.
water Posted February 14, 2013 Author Posted February 14, 2013 But if you run_AD_CreateComputer("OU=New Computers,OU=Drane Hall - Desktop,OU=helpdesk,DC=domain,DC=com", $sComputerName, $sTUsername)it doesn't crash? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
chaoticyeshua Posted February 14, 2013 Posted February 14, 2013 (edited) Duh, I'm an idiot. At the bottom of the tree view GUI: If $bIsADOpen = False Then _AD_Close() ...commented it out, and now it works. I open AD in another part of the script so I need to account for that in your GUI too Edited February 14, 2013 by chaoticyeshua
water Posted February 15, 2013 Author Posted February 15, 2013 If the connection to AD has already been opened when you call _AD_GetOUTreeView then simply pass True as parameter three to _AD_GetOUTreeView. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
chaoticyeshua Posted February 15, 2013 Posted February 15, 2013 Will do. Thanks again for all your help.
water Posted February 15, 2013 Author Posted February 15, 2013 Glad to be of service My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Tjalve Posted February 21, 2013 Posted February 21, 2013 Hi there. Ive written a small program that we use for keeping track of equipment. Who has what and when they need to return it. Its more or less finished and it works great. I use this UDF to connect to AD and get a lite of our current domain users. The problem is that the receptionists what to use the program also, but when they try to run it, they get an AD connection error. I debuged the program and found out that its the _AD_open() function thats the problem. On my account (as a domain admin) it works perfectly. But on the "other" accounts i get @error = 4. Same thing when i try to use "runas" on my computer and run the program as another user. The strange thing is that ive used this UDF in another program to do the exact same thing. That program connects to AD and downloads the data from all the users and create outlook contaacts for all the users. And that program works. Any iddees anyone?
water Posted February 21, 2013 Author Posted February 21, 2013 What's the value of @extended after _AD_Open? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Tjalve Posted February 21, 2013 Posted February 21, 2013 I updated to the latest version of the UDF. Now i get this on the @extended varible: -2147024843
water Posted February 21, 2013 Author Posted February 21, 2013 This is 0x80070035 - The network path was not found Do you specify any arguments when calling _AD_Open? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted February 21, 2013 Author Posted February 21, 2013 The receptionists PC is joined to the domain and the receptionists user has logged on to the domain? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts