Tjalve Posted February 21, 2013 Share Posted February 21, 2013 So might there be a collision between the outlook ex and Ad UDFs? Link to comment Share on other sites More sharing options...
water Posted February 21, 2013 Author Share Posted February 21, 2013 Do you call _OL_Open before _AD_Open or do you create your own COM error handler? 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 Link to comment Share on other sites More sharing options...
Tjalve Posted February 21, 2013 Share Posted February 21, 2013 No. _AD_Open() is called first and no, om not that familiar with COM I tried comenting out the outlookex include. Still no luck Link to comment Share on other sites More sharing options...
water Posted February 21, 2013 Author Share Posted February 21, 2013 (edited) Can you change lineIf $__iAD_Debug = 0 And Number(StringReplace(@AutoItVersion, ".", "")) < 3392 Then _AD_ErrorNotify(1)toIf $__iAD_Debug = 0 And Number(StringReplace(@AutoItVersion, ".", "")) < 3392 Then _AD_ErrorNotify(1) SetError(0) ; Reset @error which is returned by _AD_ErrorNotify if a COM error handler has already been set up by the user EndIfin function _AD_Open and give it a try? Edited February 21, 2013 by water 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 Link to comment Share on other sites More sharing options...
Tjalve Posted February 21, 2013 Share Posted February 21, 2013 Same error. Link to comment Share on other sites More sharing options...
water Posted February 21, 2013 Author Share Posted February 21, 2013 The script you posted in works. When compared to #159 only the list of includes is different before _AD_Open is called.Can you add the includes from #159 to #157 one by one and test until we find the include that causes the poblem? 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 Link to comment Share on other sites More sharing options...
Tjalve Posted February 22, 2013 Share Posted February 22, 2013 The script you posted in works. When compared to #159 only the list of includes is different before _AD_Open is called.Can you add the includes from #159 to #157 one by one and test until we find the include that causes the poblem?I just dont get it... I did what you said and it still works... ? Link to comment Share on other sites More sharing options...
Tjalve Posted February 22, 2013 Share Posted February 22, 2013 Ok now im starting to understand.... It seems that it works when i put the program in a dir that all AD users have access to. But if a place it in a dir and grant the specific user to that folder. It doesnt work anymore. So it seems to have somthing to do with access rights to the speciic folder that holds the script. Does this make any sense? Link to comment Share on other sites More sharing options...
water Posted February 22, 2013 Author Share Posted February 22, 2013 That's what I expected As none of my UDFs does run any code by just including the UDF, There must be a function call before _AD_Open that generates the problem. 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 Link to comment Share on other sites More sharing options...
water Posted February 22, 2013 Author Share Posted February 22, 2013 Does this make any sense?It does. I have a similar behaviour here. I can run a compiled script from a place shared by all users but it crashes when I run it from my home drive on a network share. Looks like execution of exe files is limited to some trusted locations. 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 Link to comment Share on other sites More sharing options...
blumi Posted February 22, 2013 Share Posted February 22, 2013 Hi, did some tests with the ad function _AD_IsMemberOf() When I ask if the @UserName is Member of the group "users" in the AD it works fine. When I ask if the @ComputerName is Member of the group "computers" in the AD id does not work. $test = _AD_IsMemberOf("Computers", @ComputerName) If ($test = 1) Then ... EndIf Link to comment Share on other sites More sharing options...
water Posted February 22, 2013 Author Share Posted February 22, 2013 Set parameter 3 to True. This will check the primaryGroup as well. The primaryGroup behaves differentely as it does not contain all members (could be thousands and thousands). 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 Link to comment Share on other sites More sharing options...
Tjalve Posted February 22, 2013 Share Posted February 22, 2013 It does. I have a similar behaviour here. I can run a compiled script from a place shared by all users but it crashes when I run it from my home drive on a network share. Looks like execution of exe files is limited to some trusted locations.It sure seems that way.I want to run the script from a location that is exclusive to IT staf. ive just added right for the reception to that folder. But when i moved the entire script. It works. So the question is, what rights do i need to set on the folder in order to get it to work? Link to comment Share on other sites More sharing options...
water Posted February 22, 2013 Author Share Posted February 22, 2013 IIRC it isn't a missing permission of a folder. It's a global security setting. You can define the trusted locations where you are allowed to run programs from. Unfortunately I can't find my Windows 7 docu right now 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 Link to comment Share on other sites More sharing options...
Tjalve Posted February 22, 2013 Share Posted February 22, 2013 IIRC it isn't a missing permission of a folder. It's a global security setting. You can define the trusted locations where you are allowed to run programs from.Unfortunately I can't find my Windows 7 docu right now Im not sure thats it. Becuase I have a custom location (a tash folder, that all users on the domain has access to). If i run the program there, it works or all users. Link to comment Share on other sites More sharing options...
blumi Posted February 22, 2013 Share Posted February 22, 2013 Set parameter 3 to True. This will check the primaryGroup as well. The primaryGroup behaves differentely as it does not contain all members (could be thousands and thousands). Tried this, no change $test = _AD_IsMemberOf("Computers", "pcsetup8", TRUE) Link to comment Share on other sites More sharing options...
water Posted February 22, 2013 Author Share Posted February 22, 2013 What's the value of @error and @extended after you call the function? 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 Link to comment Share on other sites More sharing options...
rmarshall Posted February 22, 2013 Share Posted February 22, 2013 I can't seem to get AutoIT to remove a number at the end of a name. I'm using it to create new accounts. So I'd enter First Name and Last Name (so Richard Marshall would create a username as rmarshall) If the username is in use, I need to add a number to the last name - how do I remove the number from the last name but still keep the number at the end of the username? Link to comment Share on other sites More sharing options...
water Posted February 22, 2013 Author Share Posted February 22, 2013 (edited) Welcome to AutoIt and the forum! Something like this (untested)? $sName = "Marshall" $sGivenName = "Richard" $sAccount = StringLower(StringLeft($sGivenName, 1) & $sName) $iCounter = 0 While _AD_ObjectExists($sAccount) $iCounter = $iCounter + 1 $sAccount = StringLower(StringLeft($sGivenName, 1) & $sName & $iCounter) WEnd _AD_CreateUser("OU where to create the user", $sAccount, $sGivenName & " " & $sName) Edited February 22, 2013 by water 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 Link to comment Share on other sites More sharing options...
blumi Posted February 25, 2013 Share Posted February 25, 2013 What's the value of @error and @extended after you call the function?How do I get the value of the @error? Link to comment Share on other sites More sharing options...
Recommended Posts