Jump to content

rogerd2u

Active Members
  • Posts

    70
  • Joined

  • Last visited

Everything posted by rogerd2u

  1. I just want to say that you have done one hell of a job in putting this together. Thank you for lending your time and expertice to this project! Well done!!
  2. Hey, Water, I just wanted to say you are doing a phenomenal job on this UDF! Keep up the great work, man!
  3. Just wanted to say that you've done an awesome job thus far!!! I look forward to using this UDF!!!
  4. This is a VERY IMPRESSIVE application! WELL DONE!! I look forward to seeing additional features!
  5. Thanks for picking this project back up, Johny! Having this utility has saved me countless hours. I look forward to the added requests, and appreciate your time and effort!
  6. Here are a "few" things I would love to have added to this GREAT script: 1.) Ability to check AD to see if user account is locked out (due to too many unsuccessful log in attempts); If locked out, ability to unlock the account 2.) Take a specific (disabled) AD user account and check to see if the user is in any security or distribution groups. If so, remove them from all those groups 3.) Create a list of all disabled AD user accounts and check to see if the users are in any security or distribution groups. If so, remove them from all those groups (mass update for request #2) 4.) Create a function that will force a password change for a specified user -- sets the "User must change password at next login" checkbox. 5.) Create a function that will force a password change (at next login) for a specified OU -- sets the "User must change password at next login" checkbox. (OU mass update for request #4) 6.) Create a function that will force a password change for all users within a specified OU -- giving the ability to set the password to a variable callout. Thank you in advance for your consideration!
  7. 1.) I have a function I created for mapping drives (see attached script). 2.) Look at the ADFunctions.au3 in the Example Scripts. Get the latest version (3.1.6, I believe) and use that for conditional mappings, shortcuts, printer assignments, etc, based on AD group membership. MapDrive.au3
  8. I created this function to help in comparing two files. The function will copy from the source location to the destination location if either the file size or the [last modified] date are different between the two files. I also have an optional error reporting variable, if you want an error message displayed if the source file doesn't exist. Comments and suggestions welcome, as always. Enjoy! CompareTwoFiles_CopyIfDifferent.au3
  9. Here is a function I use to compare two files -- checks size first, then [last modified] date if the size is identical. It's not nearly as complex as the other script listed, but it seems to get the job done. If the destination location is different, it copies the file from the source location. CompareTwoFiles_CopyIfDifferent.au3
  10. Try adding the following to the beginning of your script: #RequireAdmin
  11. This is an awesome application, Valuater! Keep it up!! I ran the application and noticed a significant speed improvement!
  12. You 'da man! Here's the completed code ;Function to check Active Directory for Domain password policy settings Global $objRoot = ObjGet("LDAP://RootDSE") Global $objDomain = ObjGet("LDAP://" & $objRoot.Get("defaultNamingContext")) ;~ Global $oWhs = ObjCreate("Wscript.Shell") $maximumPasswordAge = Int(Int8ToSec($objDomain.Get("maxPwdAge"))) / 86400 ; Convert to Days $minimumPasswordAge = Int8ToSec($objDomain.Get("minPwdAge")) / 86400 ; Convert to Days $minimumPasswordLength = $objDomain.Get("minPwdLength") $accountLockoutDuration = Int8ToSec($objDomain.Get("lockoutDuration")) / 60 ; Convert to Minutes $lockoutThreshold = $objDomain.Get("lockoutThreshold") $lockoutObservationWindow = Int8ToSec($objDomain.Get("lockoutObservationWindow")) / 60 ; Convert to Minutes $passwordHistory = $objDomain.Get("pwdHistoryLength") MsgBox(0,"","Maximum Password Age: " & $maximumPasswordAge & " days" & @CRLF & _ "Minimum Password Age: " & $minimumPasswordAge & " days" & @CRLF & _ "Enforce Password History: " & $passwordHistory & " passwords remembered" & @CRLF & _ "Minimum Password Length: " & $minimumPasswordLength & " characters" & @CRLF & _ "Account Lockout Duration: " & $accountLockoutDuration & " minutes" & @CRLF & _ "Account Lockout Threshold: " & $lockoutThreshold & " invalid logon attempts" & @CRLF & _ "Reset account lockout counter after: " & $lockoutObservationWindow & " minutes") Func Int8ToSec($objInt8) Dim $lngHigh, $lngLow $lngHigh = $objInt8.HighPart $lngLow = $objInt8.LowPart If $lngLow < 0 Then $lngHigh = $lngHigh + 1 EndIf Return -($lngHigh * (2 ^ 32) + $lngLow) / (10000000) EndFunc
  13. Window VBScript Result -- Maximum Password Age: 90 days Minimum Password Age: 1 days Enforce Password History: 10 passwords remembered Minimum Password Length: 8 characters Account Lockout Duration: 3 minutes Account Lockout Threshold: 7 invalid login attempts Reset account lockout counter after: 3 minutes AuotIT Script Result -- Maximum Password Age: -90 days Minimum Password Age: -1 days Enforce Password History: 10 passwords remembered Minimum Password Length: 8 characters Account Lockout Duration: -3 minutes Account Lockout Threshold: 7 invalid login attempts Reset account lockout counter after: -3 minutes
  14. I looked through it for type-o's but didn't find any -- HONESTLY! :-) That fixed it! You all are awesome!! For those who would like to copy & paste the working code, here it is: ;Function to check Active Directory for Domain password policy settings Global $objRoot = ObjGet("LDAP://RootDSE") Global $objDomain = ObjGet("LDAP://" & $objRoot.Get("defaultNamingContext")) ;~ Global $oWhs = ObjCreate("Wscript.Shell") $maximumPasswordAge = Int(Int8ToSec($objDomain.Get("maxPwdAge"))) / 86400 ; Convert to Days $minimumPasswordAge = Int8ToSec($objDomain.Get("minPwdAge")) / 86400 ; Convert to Days $minimumPasswordLength = $objDomain.Get("minPwdLength") $accountLockoutDuration = Int8ToSec($objDomain.Get("lockoutDuration")) / 60 ; Convert to Minutes $lockoutThreshold = $objDomain.Get("lockoutThreshold") $lockoutObservationWindow = Int8ToSec($objDomain.Get("lockoutObservationWindow")) / 60 ; Convert to Minutes $passwordHistory = $objDomain.Get("pwdHistoryLength") MsgBox(0,"","Maximum Password Age: " & $maximumPasswordAge & " days" & @CRLF & _ "Minimum Password Age: " & $minimumPasswordAge & " days" & @CRLF & _ "Enforce Password History: " & $passwordHistory & " passwords remembered" & @CRLF & _ "Minimum Password Length: " & $minimumPasswordLength & " characters" & @CRLF & _ "Account Lockout Duration: " & $accountLockoutDuration & " minutes" & @CRLF & _ "Account Lockout Threshold: " & $lockoutThreshold & " invalid logon attempts" & @CRLF & _ "Reset account lockout counter after: " & $lockoutObservationWindow & " minutes") Func Int8ToSec($objInt8) Dim $lngHigh, $lngLow $lngHigh = $objInt8.HighPart $lngLow = $objInt8.LowPart If $lngLow < 0 Then $lngHigh = $lngHigh + 1 EndIf Return -($lngHigh * (2 ^ 32) + $lngLow) / (10000000) EndFunc (Although it looks like negative numbers in several results, but I'm sure I can figure that part out!) :-) THANKS AGAIN !!!!
  15. Well, there is definite progess being made. It lets me run the script, but nothing displays and I get the following: C:\Documents and Settings\rosborne\Local Settings\Temp\test.au3 (2) : ==> Variable must be of type "Object".: Global $objDomain = ObjGet("LDAP://" & $objRoot.Get("defaultNamingContext")) Global $objDomain = ObjGet("LDAP://" & $objRoot^ ERROR Thank you so much for you continued help!!
  16. Can someone help me get this translated to AutoIT, please? It would be GREATLY appreciated!
  17. It looks very promising, but I can't get it to work... ERROR REPORT: >Running AU3Check (1.54.13.0) from:C:\Program Files\AutoIt3 C:\Documents and Settings\rosborne\Local Settings\Temp\test.au3(7,63) : WARNING: $objDomin: possibly used before declaration. $maximumPasswordAge = Int(Int8ToSec($objDomin.Get("maxPwdAge")) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\rosborne\Local Settings\Temp\test.au3(21,81) : WARNING: $lockoutObservationWindow: possibly used before declaration. "Reset account lockout counter after: " & $lockoutObservationWindow & ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\rosborne\Local Settings\Temp\test.au3(21,93) : ERROR: syntax error "Reset account lockout counter after: " & $lockoutObservationWindow & " minutes" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\rosborne\Local Settings\Temp\test.au3(26,33) : WARNING: $objInt8: possibly used before declaration. $lngHigh = $objInt8.HighPart ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\rosborne\Local Settings\Temp\test.au3(33,41) : ERROR: syntax error Return $lngHigh * (2 ^ 32) + $lngLow) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\rosborne\Local Settings\Temp\test.au3(33,53) : ERROR: 'Return' not allowed from global scope. Return $lngHigh * (2 ^ 32) + $lngLow) / 10000000 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\rosborne\Local Settings\Temp\test.au3(34,1) : ERROR: syntax error EndFunc ^ C:\Documents and Settings\rosborne\Local Settings\Temp\test.au3(7,63) : ERROR: $objDomin: undeclared global variable. $maximumPasswordAge = Int(Int8ToSec($objDomin.Get("maxPwdAge")) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\rosborne\Local Settings\Temp\test.au3(7,63) : ERROR: Int8ToSec(): undefined function. $maximumPasswordAge = Int(Int8ToSec($objDomin.Get("maxPwdAge")) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\rosborne\Local Settings\Temp\test.au3 - 6 error(s), 3 warning(s)
  18. WISH LIST FOR ADFUNCTIONS: 1.) I would like to see a function that will force a password change for a specified user -- sets the "User must change password at next login" checkbox. 2.) I would like to see a function that will check if the account is locked out. 3.) I would like to see a function that will allow you to unlock a user account. Anyone already have these functions and wish to share?!?
  19. Thanks, but this doesn't appear to get the same data... I'm looking for the same exact results of the VBScript I posted, only in values (variables) I can capture and use in other scripts ...
  20. I would really like to get this VBScript into AutoIT, but I have no VB background. Can someone make this work? set objRoot = getobject("LDAP://RootDSE") set objDomain = getobject("LDAP://" & objRoot.get("defaultNamingContext")) maximumPasswordAge = int(Int8ToSec(objDomain.get("maxPwdAge")) / 86400) 'convert to days minimumPasswordAge = Int8ToSec(objDomain.get("minPwdAge")) / 86400 'convert to days minimumPasswordLength = objDomain.get("minPwdLength") accountLockoutDuration = Int8ToSec(objDomain.get("lockoutDuration")) / 60 'convert to minutes lockoutThreshold = objDomain.get("lockoutThreshold") lockoutObservationWindow = Int8ToSec(objDomain.get("lockoutObservationWindow")) / 60 'convert to minutes passwordHistory = objDomain.get("pwdHistoryLength") wscript.echo "Maximum Password Age: " & maximumPasswordAge & " days" & vbcrlf & _ "Minimum Password Age: " & minimumPasswordAge & " days" & vbcrlf & _ "Enforce Password History: " & passwordHistory & " passwords remembered" & vbcrlf & _ "Minimum Password Length: " & minimumPasswordLength & " characters" & vbcrlf & _ "Account Lockout Duration: " & accountLockoutDuration & " minutes" & vbcrlf & _ "Account Lockout Threshold: " & lockoutThreshold & " invalid logon attempts" & vbcrlf & _ "Reset account lockout counter after: " & lockoutObservationWindow & " minutes" Function Int8ToSec(ByVal objInt8) ' Function to convert Integer8 attributes from ' 64-bit numbers to seconds. Dim lngHigh, lngLow lngHigh = objInt8.HighPart ' Account for error in IADsLargeInteger property methods. lngLow = objInt8.LowPart If lngLow < 0 Then lngHigh = lngHigh + 1 End If Int8ToSec = -(lngHigh * (2 ^ 32) + lngLow) / (10000000) End Function
  21. Sorry...I was trying to be clear. Okay, I have a menu called _UserMenu() that I call at the beginning of my script. The _UserMenu() function has a button that a user can click, which runs another menu: _SecondMenu() When I the second menu starts, the first menu stays open -- but I don't want it to do that... :-) So my question is, how do I close the first menu (function) before opening the second menu (function) Does that clear it up? It's a long script, otherwise I'd just post it... UPDATE: I FIGURED IT OUT!! I just needed to add a GUISetState(@SW_HIDE) to my button. THANKS ANYWAYS!! :-)
  22. I have a menu that is set up as a function, which I can call in my script. How do I close the menu when I don't want it displayed? For example, I want to open a second menu when a user clicks on one of the buttons in my first menu. I'm sure there is a simple, straight-forward way of doing this in AutoIT, but I'm missing it! Please help! :-) Thank you in advance!!
  23. Thank you very much for the reply. I have a semi-working function I hacked together. It works at times, but it's not perfect... Maybe someone will be able to tell me why it works at times, but other times I get a COM error....? $UserFQDN = _ADSamAccountNameToFQDN($sInputBoxAnswer) ;Removes the user from all AD Groups Func _RemoveADUserFromAllGroups() _ADRecursiveGetMemberOf($avGroups, $UserFQDN) ;_ArrayDisplay($avGroups, "User is currently a member of the following groups:") $rows = UBound($avGroups) $rows = $rows -1 While $rows > 1 $rows = $rows -1 _ADRemoveUserFromGroup($avGroups[$rows], $UserFQDN) WEnd MsgBox(0,"AD User Account Update", "User has been removed from all Active Directory groups.") EndFunc ;<---_RemoveADUserFromAllGroups()
  24. I'm trying to use the ADFunctions Script (in the Example scripts area) to remove a specified user from all domain groups. I was able to get my script to display the groups a user belongs to, but when I try to use the same variable to remove them from all the groups listed, it fails. I'm sure it has to do with the array, but I'm not sure how I can extract the data from the array to use it...please help!!! :-) #include <ADFunctions.au3> #include <array.au3> $sInputBoxAnswer = "JohnDoe" $UserFQDN = _ADSamAccountNameToFQDN($sInputBoxAnswer) Global $avGroups = "" ;Global $avGroups = "" _ADSamAccountNameToFQDN($UserFQDN) _ADRecursiveGetMemberOf($avGroups, $UserFQDN) _ArrayDisplay($avGroups, "Debug: $avGroups") _ADRemoveUserFromGroup($avGroups, $UserFQDN)
  25. Oops! That's what I get for typing the code directly in the forum, and not in SciTe!!
×
×
  • Create New...