water Posted July 26, 2016 Author Posted July 26, 2016 Does the example script _AD_GetObjectsLocked.au3 return the user as locked? 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 July 26, 2016 Author Posted July 26, 2016 I just checked with version 1.3.0.0 of the AD UDF and it worked just fine. 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 July 26, 2016 Author Posted July 26, 2016 Works fine here. Anything special in your AD environment? RODC (Read only domain controllers)? Which version? 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 August 18, 2016 Author Posted August 18, 2016 Version 1.4.6.0 of the UDF has been released. Bugfix in function _AD_GetObjectProperties. Please test before using in production! For download please see my signature. 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
IanN1990 Posted August 25, 2016 Posted August 25, 2016 I dont have access to AD at the moment, so i can only research. Would this be the right syntax for an idea? _AD_GetObjectsInOU($sOU, "(&(whenchanged -gt Thursday, January 1, 2015 12:00:00 AM")(name=ian*))", 2, "sAMAccountName") Would that return a list of SamAccountNames with the name starting with ian changed after the date listed?
water Posted August 26, 2016 Author Posted August 26, 2016 I have no access to AD at the moment as well. But the wiki (please check my signature) explains how to build LDAP queries. 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
IanN1990 Posted August 26, 2016 Posted August 26, 2016 (edited) Heading to the wiki, it ended me up here http://www.selfadsi.org/ldap-filter.htm #include <Date.au3> $EPOCH = "1970/01/01 00:00:00" $NOW = _NowCalc() $time = _DateDiff("s", $EPOCH, $NOW) $aObjects = _AD_GetObjectsInOU($sOU, "(&(whenchanged<=" & $time & ")(name=*))", 2, "sAMAccountName,distinguishedName,displayname") If @error > 0 Then MsgBox(64, "Active Directory Functions - Example 1", "No OUs could be found") Else _ArrayDisplay($aObjects, "Active Directory Functions - Example 1 - Objects in OU '" & $sOU & "'") Global $iResult = _AD_GetObjectsInOU($sOU, "(name=*)", 2, "sAMAccountName,distinguishedName,displayname", "", True) MsgBox(64, "Active Directory Functions - Example 1", "This example returned " & $iResult & " records") EndIf Returns No OUS Edited August 26, 2016 by IanN1990
water Posted August 26, 2016 Author Posted August 26, 2016 I think that's because OUs have no name. Remove the attribute from the query and see what you get. 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
IanN1990 Posted August 26, 2016 Posted August 26, 2016 (edited) hmm though i still couldn't get it to work (though i just noticed its missing lots of code for the forum for others to run which i will correct) i could kiss you water your wiki page is amazing took me a while to understand beter but i wrote this becase of it Global $aObjects = _AD_GetObjectsInOU($sOU, "(&(name=" & GUICtrlRead($Input1) & "*)(!UserAccountControl=514)(|(accountExpires=0)(accountExpires=9223372036854775807)))", 2, "name, employeenumber, physicalDeliveryOfficeName") For others so they can use it. 1. Reads Input from GUI 2. That name is a wild card, so Ian* becomes ian smith, ian andrews etc 3. Account is not 514 (ie disabled) 4. Accountexpires is 0 or 0xffffff (ie doesn't expire) Though when i add this line it all fails which i dont understand yet. Global $aObjects = _AD_GetObjectsInOU($sOU, "(&(name=" & GUICtrlRead($Input1) & "*)(!UserAccountControl=514)(|(accountExpires=0)(accountExpires=9223372036854775807)(accountExpires>=131167196470))", 2, "name, employeenumber, physicalDeliveryOfficeName") As the accountexpires is still part of the OR bracket, even if it finds nothing it shouldn't stop results coming in. Further more, it should be working ? If the users accountexpires is bigger then todays accountexpire number then they are not expired :S *Edit Seams it does allworks, i just missed a closing bracket. Easy mistake Edited August 26, 2016 by IanN1990
water Posted August 27, 2016 Author Posted August 27, 2016 To query the WhenChanged property use the following format: WhenChanged>=YYYYMMDDHHMMSS.0Z 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
Valnurat Posted August 30, 2016 Posted August 30, 2016 Do I need to run _AD_ModifyAttribute for all attribute I want to modify for a user or is there a solution to do it for them all in 1 stroke. Yours sincerely Kenneth.
water Posted August 30, 2016 Author Posted August 30, 2016 Sorry but you have "to run _AD_ModifyAttribute for all attribute" you want to modify. 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
Valnurat Posted August 31, 2016 Posted August 31, 2016 Ok. Thank you for your respond. Yours sincerely Kenneth.
Valnurat Posted August 31, 2016 Posted August 31, 2016 (edited) Is there a solution to modify the "User logon name" and the domain suffix? We have severals domain suffix to chose from. The first field is the attribute "userPrincipalName", but the other field (combobox) I don't know. But I can't just do this: _AD_ModifyAttribute($sShort, "userPrincipalName", $sEmail & "@company.com") because then is will just look like this: Edited August 31, 2016 by Valnurat Yours sincerely Kenneth.
Valnurat Posted August 31, 2016 Posted August 31, 2016 Please ignorre my previous post. It does work as the exampel shows. Maybe it was wrong spelling og my company. Yours sincerely Kenneth.
araneon Posted September 5, 2016 Posted September 5, 2016 (edited) Good afternoon.Prompt, whether it is possible to connect a computer from a workgroup to a domain using your library.Only OU Krasnodar \ Computers? The point is this.There is a PC which lost the trust relationship between the workstation and the domain. To fix this, I'm under a local administrator deduce PC from a domain to a workgroup, delete the computer from the domain and add it again and join the PC to the domain.Only Computers OU I are in OC Krasnodar, ieDomen.ru / Krasnodar / Computers ? Edited September 5, 2016 by araneon
water Posted September 5, 2016 Author Posted September 5, 2016 I think function _AD_JoinDomain should do the trick. 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
araneon Posted September 6, 2016 Posted September 6, 2016 How to run a script if the PC is not in the domain? Function _AD_Open encountered a problem. @error = 4, @extended = -2147023541
water Posted September 6, 2016 Author Posted September 6, 2016 Can you post the script you run? 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