Jump to content

lewisg

Active Members
  • Posts

    58
  • Joined

  • Last visited

About lewisg

  • Birthday 03/18/1950

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

lewisg's Achievements

Wayfarer

Wayfarer (2/7)

1

Reputation

  1. Thanks for the respond rudi. Double checked my script and that is being set with Water's function "_AD_EnablePasswordChange"
  2. Thanks for looking Water. My boss mention that it use to work and force a password change. We've really tighten password policies and perhaps that has made things get strange. Looking at the AD attribute "pwdLastSet" it's set to 0x0 that I believe is the toggle for Change Password at Logon, so it seems like everything is set to force a password change. That is also, I think, the same attribute that that the PowerShell command you mentioned toggles. I'll continue trying fixes and report back.
  3. The whole script is over 1100 lines and works flawlessly except a new password prompt after the new user first logs in. Much of the script is error checking and logging so I can look back and see if there is a problem and also document all the new user's information. The pertinent AD user creation sub is: $RepondCreateUser = _AD_CreateUser($P_OU_Destination, $P_SamAccountName, $P_displayName) ; Create the User in AD ****Here the user is created****** Sleep(500) $RepondEnablePasswordExpire = _AD_EnablePasswordExpire($P_distinguishedName) ; Needed so user MUST change password at first logon as set by the "1" in next line ProgressSet(5, "5%", "Enabling Password Expire") ; Set the "subtext" and "maintext" of the progress bar window. Sleep(250) If $RepondEnablePasswordExpire = 1 Then _Log_Report($hLog, 'Successfully set Enable Password Expire', @ScriptLineNumber) Else _Log_Report($hLog, 'ERROR!! Unsuccessfully Set Enable Password Expire', @ScriptLineNumber) EndIf $RepondSetPassword = _AD_SetPassword($P_distinguishedName, $P_Password, 1) ; Sets a user's password and the "1" forces a Password change ProgressSet(10, "10%", "Setting User Password") ; Set the "subtext" and "maintext" of the progress bar window. Sleep(250) If $RepondSetPassword = 1 Then _Log_Report($hLog, 'Successfully set User Password to = ' & $P_Password, @ScriptLineNumber) Else _Log_Report($hLog, 'ERROR!! Unsuccessfully Set User Password to = ' & $P_Password, @ScriptLineNumber) EndIf $RepondEnablePasswordChange = _AD_EnablePasswordChange($P_distinguishedName) ; Disables the 'User Cannot Change Password' option, allowing the user to change their password. ProgressSet(15, "15%", "Enabling Password Change") ; Set the "subtext" and "maintext" of the progress bar window. Sleep(250) If $RepondEnablePasswordChange = 1 Then _Log_Report($hLog, 'Successfully set Enable Password Change', @ScriptLineNumber) Else _Log_Report($hLog, 'ERROR!! ERROR!! Unsuccessfully Set Enable Password Change', @ScriptLineNumber) EndIf Blah, blah, blad, etc. set more user attributes........
  4. Using Waters great AD.UDF to create Active Directory users I can't seem to force a password change at the first login. Creation, permissions, group addition, etc. all work as expected, just no prompt at the first login to change their password. I'm setting: _AD_EnablePasswordExpire($distinguishedName) _AD_SetPassword($distinguishedName, $password, 1) _AD_EnablePasswordChange($distinguishedName) They all return 1 so I'm sure there is no issues with the syntax. Running both compiled and through SciTE fail. Using ----- AutoIT 3.3.14.5 UDF Version 1.6.1.0 SciTE 5.4.0
  5. Combining and slightly modifying the Help example files for Ping and _INetSmtpMail it could be done in under 30 lines. Whatcha' got so far? We here to help, not create.
  6. Water I'm trying to populate a TreeView using your _AD_GetOUTreeView with selected OUs. For example an OU "Students" with child OUs under it "2018", "2019", "2020", "2021", "2022", "2023", etc. where I would pick "2018", "2019", "2020", "2021" to be in the TreeView. Looping through those 4 OUs will populate the TreeView however when trying to retrieve the currently selected item in the TreeView it always only returns what correctly what was added in the last supplied OU loop. This is a copied simplified script that works great, because it does grab all the sub OUs under "Students". I short, is there a way to pick and choose what child OUs populate a TreeView using _AD_GetOUTreeView Thanks
  7. If the IP is always after the string "Callback address:" you could take the result of StringInStr and pass it to StringMid.
  8. In your code above "WinActivate("Downloads")" give focus (i.e. highlights) a "window" on your screen, not to the script. You were on the correct track with ;Local Const $sTestPath = _PathFull("C:\Users\camanjana\Downloads\xyz.csv") $hFile = Fileopen("xyz.csv") Either uncomment the "Local Const $sTestPath.....bla..bla.... and use that variable as the argument in the Fileopen function of the next line or add the quoted full path as the argument. However gruntydatsun link and suggestion will take you to your final goal.
  9. Thanks to all, using the link iamtheky's provided and following the example of using many (3) string variables instead of one long string, it's now working as expected. Why it changed to begin with and why it now works, I don't know.....just glad it's solved.
  10. Suddenly a RunWait command has stop working after 2 years of no errors, issues, or problems. The code uses RunWait to start Plink.exe, a command-line remote connection tool similar to UNIX ssh. I'm using it to ssh to a linux (Centos) machine, run a Perl script, and redirect the output to a file on a PC running the AutoIt script. $FilePath = "C:\AutoIT\LED" $FilePathPlus = $FilePath & "\plink.exe" $Code1 = RunWait(@ComSpec & " /c " & $FilePathPlus & " -ssh -l root -pw ?????? 10.170.4.163 /usr/local/nagios/etc/led.pl > C:\AutoIT\LED\led.txt ", @SW_SHOW) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : @ComSpec & " /c " & $FilePathPlus & " -ssh -l root -pw ????? 10.170.4.163 /usr/local/nagios/etc/led.pl > C:\AutoIT\LED\led.txt " = ' & @ComSpec & " /c " & $FilePathPlus & " -ssh -l root -pw ?????? 10.170.4.163 /usr/local/nagios/etc/led.pl > C:\AutoIT\LED\led.txt " & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console The ConsoleWrite output when cut-n-pasted into a DOS box produces the expected file so I know it works. I've also tried many variations of the function moving, adding, and changing the " and ' (quote) marks. Also tried it without the @ComSpec macro and other related functions...e.g. ShellExecuteWait , etc. The PC is a Windows 10 64bit and AutoIT is version 3.3.14.2. Searching here and Google has not yielded any clues that helped.
  11. Think your question belongs in a different section of the Forum. One answer to your question is maybe.....look at the function EXIT() Really need some sample (or the whole) of the code you have for the correct answer.
  12. Script-o-matic (for AutoIT) could be your friend. Jon's AutoIT Script-o-matic
  13. I use this in for a script at work. ShellExecute("shutdown.exe","/s /m \\" & $PickPC, "", "open", @SW_HIDE) "$PickPC" is a var grabbed from a ListView
  14. Thanks, I revisited the "Atom" solution and although I at first dismissed it because it only gave a summary of the message I might be able to still make it work.
  15. Any suggestions as to how to download, get, or retrieve email from Google's Gmail? No need to send mail only receive. I thought perhaps JiBE's SSL UDF might work however a reply to a post at his original post says otherwise (Didn't want to hijack his post). I have been using "GAM", "GYB", and "GMAIL Backup"(old), all command line inputs. Running them through a AutoIT script using RUN() and RUNWAIT() works somewhat, but has been unreliable.
×
×
  • Create New...