water Posted August 27, 2014 Author Posted August 27, 2014 Glad you could solve your problem _AD_FQDNToSamAccountName is no longer needed because all functions now accept SamAccountName or FQDN as a parameter. 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
jcpetu Posted September 2, 2014 Posted September 2, 2014 Hi Water, I'm trying to save comment field with _AD_ModifyAttribute(@UserName, "comment", "Hi") without success. Should I use some other function? thanks in advance.
water Posted September 2, 2014 Author Posted September 2, 2014 What's the value of @error and @extended after calling 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
jcpetu Posted September 3, 2014 Posted September 3, 2014 Value of @error is: -2147352567 Value of @extended is: 0
water Posted September 3, 2014 Author Posted September 3, 2014 This is the general exception error Are you sure you have the permission to modify the user account? 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
jcpetu Posted September 3, 2014 Posted September 3, 2014 Yes I used my Domain admin account and it worked with all other fields. By the way I managed to change the "thumbnailPhoto" field but: 1.How can I retrieve what is in the field to verify if it is OK? 2.Do you know maximun picture filesize, cuz if it is higher than 8k you can't see hexa content in AD
water Posted September 3, 2014 Author Posted September 3, 2014 "thumbnailPhoto". Seems to be limited to 10K by default. But you can set the RangeUpper value in the Schema for this attribute. Performance might be a issue with larger pictures. Only accepts JPG MS recommends pictures with 96*96 pixels and a max size of 10KB A good reading 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 September 3, 2014 Author Posted September 3, 2014 Yes I used my Domain admin account and it worked with all other fields. Can you please insert _AD_ErrorNotify(2) before calling _AD_ModifyAttribute? This will return more detailed error information. 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
jcpetu Posted September 3, 2014 Posted September 3, 2014 (edited) Description: Access is denied. Which is strange cuz I'm the Domain admin and in fact I changed all other fields. I tested with other pass and didn't get any error althougt didn't change the value but as in the case of the thumbnail picture it took 24hs to perform the change. Thanks a lot for the Thumbnail picture and for your help. Regards. Edited September 3, 2014 by jcpetu
water Posted September 3, 2014 Author Posted September 3, 2014 24hs to perform a change. Then there might something be wrong with replication. If you specify the DC when calling _AD_Open you can immediately check for correct completion of the update. 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
AdamUL Posted September 3, 2014 Posted September 3, 2014 Check your ACEs for your domain account in AD. Make sure you have "Allow" for the "Write Comment" entry. You could also have another ACE restricting you. Remember the most restrictive ACE wins. Adam
jcpetu Posted September 6, 2014 Posted September 6, 2014 Hi Water, I did this piece of code to getsave the Thumnail photo to file. The file is created but not as a jpg picture. Would you please help me. thanks in advance and regards. #include <AD.au3> #include <File.au3> _AD_Open() If @error Then Exit $ThumbNailPhoto = _AD_GetObjectAttribute(@UserName, "thumbnailPhoto") If @error Then $ThumbNailPhoto = "" _AD_Close() $File = FileOpen(@ScriptDir & "\UserPic.jpg", 18) FileWrite($File, $ThumbNailPhoto) FileClose($File)
water Posted September 9, 2014 Author Posted September 9, 2014 (edited) To check the photo I would use the tool mentioned in the article I referred to in post #1127 Edited September 9, 2014 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
jcpetu Posted September 10, 2014 Posted September 10, 2014 Water, Yes I know about the tool, but I wanted to do it myself, so I´ll keep trying. Thanks anyway and regards.
jcpetu Posted September 17, 2014 Posted September 17, 2014 Hi Water, I'm trying to retrieve the following fields that are visible from the Attribute Editor, but I got an empty array. Should I retrieve them by another command? Thanks in advance and regards. $aObjects = _AD_GetObjectsInOU($sOU, "(objectclass=computer)", 2, "name,lastLogonTimestamp,lastLogon,pwdLastSet")
colombeen Posted September 18, 2014 Posted September 18, 2014 Hi, seems like there isn't a function that let's me get the expiration date of an account or am i missing something?
Moderators JLogan3o13 Posted September 18, 2014 Moderators Posted September 18, 2014 (edited) Something like this? #include <AD.au3> _AD_Open() $aProperties = _AD_GetObjectProperties(@UserName, "displayname,accountExpires") _ArrayDisplay($aProperties) Edited September 18, 2014 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
colombeen Posted September 18, 2014 Posted September 18, 2014 Something like this? #include <AD.au3> _AD_Open() $aProperties = _AD_GetObjectProperties(@UserName, "displayname,accountExpires") _ArrayDisplay($aProperties) No the accountExpires doesn't give me the date and time when it expires. I created a new function with the _AD_IsAccountExpired (@username) and changed the line 3958 from the AD.au3 to If $sAccountExpires <> "19700101000000" And StringLeft ($sAccountExpires, 8) <> "16010101" Then Return $sAccountExpires Then I only had to format the string that it returned
water Posted September 19, 2014 Author Posted September 19, 2014 Hi Water, I'm trying to retrieve the following fields that are visible from the Attribute Editor, but I got an empty array. Should I retrieve them by another command? Thanks in advance and regards. $aObjects = _AD_GetObjectsInOU($sOU, "(objectclass=computer)", 2, "name,lastLogonTimestamp,lastLogon,pwdLastSet") _AD_GetObjectsInOU doesn't translate the properties into a readable format. That's what _AD_GetObjectProperties is for. Unfortunately you need to retrieve the properties for every object. A combined function can be found >here. 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