colombeen Posted October 15, 2014 Posted October 15, 2014 do you know how to change the policy and what the specific name of the policy is?
water Posted October 15, 2014 Author Posted October 15, 2014 Searching the web for "windows trusted location" returns something like this. 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
colombeen Posted October 16, 2014 Posted October 16, 2014 strange... I've been looking but I haven't found anything specific on this topic that is not related to MS office
colombeen Posted October 22, 2014 Posted October 22, 2014 Another question... is there a way to check the real last logon time? not the one that is stored on 1 DC but a check on every DC to see what is the last logon time?
water Posted October 22, 2014 Author Posted October 22, 2014 Yes. There is a GetLastLogin function that queries all DCs for the last login date. 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
ludoo Posted October 23, 2014 Posted October 23, 2014 hi,thank you for this great UDF on the Active Directory managementis attempting to use the _AD_SetAccountExpire function, it's a shame we can not use the variable: GUICtrlCreateDatethank you for your help.
water Posted October 23, 2014 Author Posted October 23, 2014 How LDAP accepts dates is still a mystery to me. Different date formats in the US and Europe make it even more complex 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
ludoo Posted October 23, 2014 Posted October 23, 2014 yes , I use the date format europe (France), it is converted into the US date format? or it comes from Active Directory, in all it's not easy
Moderators JLogan3o13 Posted October 23, 2014 Moderators Posted October 23, 2014 (edited) I use something similar, and basically you simply need to split out the string and then convert appropriately. I do something like this: $aSplit = StringSplit(GUICtrlRead($myDate), ", ") ...and then convert each element to a variable (month, day, year). Then just plug that into your _AD_SetAccountExpire call. Edit: Didn't think about the international formats. You know we Americans think it's all about us Edited October 23, 2014 by JLogan3o13 colombeen 1 "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!
water Posted October 23, 2014 Author Posted October 23, 2014 (edited) Unfortunately I couldn't find a good docu about acceptable date formats Edited October 28, 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
colombeen Posted October 28, 2014 Posted October 28, 2014 (edited) Maybe this can help : - http://www.epochconverter.com/epoch/ldap-timestamp.php - http://www.mathworks.com/matlabcentral/fileexchange/14506-convert-time-to-windows-nt-format/content/convert2NTtime.m - http://www.esqsoft.com/javascript_examples/date-to-epoch.htm the last 2 have functions to convert from or to epoch timestamp Edited October 28, 2014 by colombeen
water Posted October 28, 2014 Author Posted October 28, 2014 Thanks a lot for the links but this kind of problem has already been solved I referred to functions such as _AD_SetAccountExpire and the different date/time formats they accept. Use the following syntax for the date/time: 01/01/1970 = never expire yyyy-mm-dd hh:mm:ss= "international format" - always works xx/xx/xx <time> = "localized format" - the format depends on the local date/time settings colombeen 1 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
Kovacic Posted October 29, 2014 Posted October 29, 2014 Unfortunately I couldn't find a good docu about acceptable date formats I have been using something like this: $xpire = @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC $user = "JSMith" _AD_SetAccountExpire($user, $xpire) Ofcourse you can do something like @MON + 3 or something like that.. C0d3 is P0etry( ͡° ͜ʖ ͡°)
Kovacic Posted October 29, 2014 Posted October 29, 2014 On an unrelated but related topic, I was looking for a function that I could feed a display name to, and get back the SamAccountName... I didnt see anything that I could use, so I fabricated this: Func SAMFromDisplayname($DisplayName) Local $objCommand = ObjCreate("ADODB.Command") Local $objConnection = ObjCreate("ADODB.Connection") $objConnection.Provider = "ADsDSOObject" $objConnection.Open("Active Directory Provider") $objCommand.ActiveConnection = $objConnection Local $strBase = "<GC://dc=" & $Domain & ",dc=COM>" Local $strFilter = "(&(objectCategory=person)(objectClass=user)(displayName=" & $DisplayName & "))" Local $strAttributes = "cn,sAMAccountName,displayName,sn,distinguishedName" Local $strQuery = $strBase & ";" & $strFilter & ";" & $strAttributes & ";subtree" $objCommand.CommandText = $strQuery $objCommand.Properties("Page Size") = 100 $objCommand.Properties("Timeout") = 30 $objCommand.Properties("Cache Results") = False $ADS_SCOPE_SUBTREE = 2 $objCommand.Properties("searchscope") = $ADS_SCOPE_SUBTREE Local $objRecordSet = $objCommand.Execute return $objRecordSet.Fields("sAMAccountName").Value EndFunc ;==>getusersfromAD Not sure if its anything you could use but I thought I would just post it. C0d3 is P0etry( ͡° ͜ʖ ͡°)
water Posted October 30, 2014 Author Posted October 30, 2014 Thanks for this function. I only had a quick look at it (I'm on vacation right now) but I think _AD_GetObjectsInOU does the same. Right? 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
willxing Posted October 30, 2014 Posted October 30, 2014 Great Script, helps a lot. before I got this, I was ready to compile dsquery and dsmod to user's desktop. now I can make script to let user to change their password without any domain tools. PS, we have 3 different domains, it's always painful to create one user on different DC, now one click can done all the job. Cool~
water Posted October 30, 2014 Author Posted October 30, 2014 I'm glad you like the UDF 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 October 30, 2014 Posted October 30, 2014 Hi Willxin, excuse my curiosity, but how do you allow the user to change his password? would you share it? thanks a lot and regards.
willxing Posted October 31, 2014 Posted October 31, 2014 the idea is: first you need create a group for safety, then make a user A join this group. assign group to manager change password, but not allow to create or delete object. in script: obtain @logondomain to check if user are log in domain or local. _ad_open with that user A GUIcreate to let user input new password no GUI for user to input username, obtain username by @Username then _AD_SetPassword($user,$password) some user have two domain, one is company's domain, and other is exchange server domain which manager by Top company group. exchange server domain only have one account for us to add and modify account. then use this one, user can modify their "own" password and email password, and can one click modify both as same password with unlock. if something wrong, you just need kick UserA out of the group. you can also make script write log to a file on server, then you can have log of who is always changing his password and what that password is. :evil
Recommended Posts