kmps Posted August 24, 2006 Posted August 24, 2006 Hello, I am trying to write a script to make sure the users NT account password is not blank or something like "abc","123"... If any good man can tell me,how to do that? On Error Resume Next Set objNetwork = CreateObject("Wscript.Network") strComputer = objNetwork.ComputerName strPassword = "password" Set colAccounts = GetObject("WinNT://" & strComputer & "") colAccounts.Filter = Array("user") For Each objUser In colAccounts objUser.ChangePassword strPassword, strPassword If Err = 0 or Err = -2147023569 Then Wscript.Echo objUser.Name & " is using the password " & _ strpassword & "." End If Err.Clear Next just like above but with Autoit 3 not Windows Script language thx a lot!
=sinister= Posted August 24, 2006 Posted August 24, 2006 I know a bunch of people that can help you... In the SUPPORT FORUM.
Richard Robertson Posted August 24, 2006 Posted August 24, 2006 Hey, =sinister=, that was kind of a mean way to say it. But, yes, this does belong in AU3 support.
=sinister= Posted August 24, 2006 Posted August 24, 2006 (edited) sorry... but my point got across... Edited August 24, 2006 by =sinister=
theguy0000 Posted August 24, 2006 Posted August 24, 2006 Hey, =sinister=, that was kind of a mean way to say it.But, yes, this does belong in AU3 support.it doesnt seem so mean to me after the amount of people that post in the wrong forum.sorry, but people posting in the wrong forum has become a pretty big pet peive of mine of the last month or so lol The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
MHz Posted August 24, 2006 Posted August 24, 2006 sorry... but my point got across...Only thing you accomplished was telling someone to double post. Please do not add to the problem. Instead try to help the member and warn them to post in support next time. A moderator's role is to move posts to correct forums. Please consider this next time.This topic is now a Scrap and a waste of time to view.
dabus Posted August 24, 2006 Posted August 24, 2006 (edited) Try RunAsSet() with the usernames and those passwords you mentioned. I'd add something like IniReadSection and write all the Names and Password into one infile, use a for ... to ... next and see what happens. AutoItSetOption('RunErrorsFatal', 0) $UserName='USER1' $Password='123' If @UserName <> $UserName Then RunAsSet($UserName, @ComputerName, $Password) If @Compiled Then Run('"' & @ScriptFullPath & '" ') Else Run('"' & @AutoItExe & '" "' & @ScriptFullPath & '" ') EndIf If @error Then MsgBox(4096 + 64, 'Sec', 'Good Password.') Else MsgBox (48, 'Sec' 'This is a crappy password') EndIf Edited August 24, 2006 by dabus
MHz Posted August 24, 2006 Posted August 24, 2006 dabus, look here to help kmps with your post.http://www.autoitscript.com/forum/index.php?showtopic=31486Saves any cross posting for the same issue...thus the result of double posting.
ptrex Posted August 24, 2006 Posted August 24, 2006 @Mhz I did correct your version of the script because it was throwing up errors. for those interested in a working version. ObjEvent("AutoIt.Error", "ComErrorHandler") Dim $oMyError Dim $Array[2] = ["user", "Group"] $objNetwork = ObjCreate("Wscript.Network") $strComputer = $objNetwork.ComputerName $strPassword = "password" $colAccounts = ObjGet("WinNT://" & $strComputer & "") $colAccounts.Filter = $Array[0] For $objUser In $colAccounts ;$objUser.ChangePassword($strPassword, $strPassword) If @error = 0 or @error = -2147023569 Then MsgBox(0,"Password Check - "& $Array[1], $objUser.Name & " is using the password " & $strpassword & ".") EndIf Next Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Remove the commented line to actually change the password. Enjoy !! ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
=sinister= Posted August 24, 2006 Posted August 24, 2006 Only thing you accomplished was telling someone to double post. Please do not add to the problem. Instead try to help the member and warn them to post in support next time. A moderator's role is to move posts to correct forums. Please consider this next time.This topic is now a Scrap and a waste of time to view.No, I didn't see his other post in the Support Forum, **Once Again, sorry.**
Olish Posted August 29, 2006 Posted August 29, 2006 @ ptrex Hi ! Is it possible to retrieve the password of a user with $objUser like this by example : $objUser.Password This does not work but is it possible ? Thanks ! Olivier, from France.Free Wake On LAN script
MHz Posted August 29, 2006 Posted August 29, 2006 No, you are unable to retrieve a users password as has been mentioned by the MS Scripting Guy. I left the change password here which does error with com if you get the password wrong, but does not error if you get it right. If you set the script to look for users with a password of "Password" then, the script will tell you upon success who has that password. The script does not affect users passwords, as changing a password to what it is already is not hurting anyone.
Confuzzled Posted August 29, 2006 Posted August 29, 2006 @ ptrex Hi ! Is it possible to retrieve the password of a user with $objUser like this by example : $objUser.Password This does not work but is it possible ? Thanks ! Oliver, Windows Security is lax, but not that lax - what would be the point of having a password if it was easily accessed? The original articles I think the previous posters were referring to is probably http://www.microsoft.com/technet/scriptcen...05/hey1006.mspx. Have a read at http://www.microsoft.com/technet/scriptcen...les/sg1103.mspx as well.
Olish Posted August 29, 2006 Posted August 29, 2006 Ok I understand now. Thank you a lot for answering me ! Olivier, from France.Free Wake On LAN script
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now