Page 1 of 1 1
Topic Options
#207097 - 2013-04-11 11:24 AM Password Expires/
GeorgeLittle Offline
Fresh Scripter

Registered: 2011-02-08
Posts: 47
Loc: UK
So I have used the script from a earlier thread to to reset a users password. What I really want it to do is go down a set of WAN users in a text file reset the passwords and then I will use blat or the mail function to e-mail the new password before it expires.

I am looking to run this as a schedule task \:D so it wont be under the users context

Top
#207098 - 2013-04-11 01:13 PM Re: Password Expires/ [Re: GeorgeLittle]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
Why would you want to do that? Passwords should expire if the users aren't using them. Quite often the person has left and no one bothers to tell the system administrator. I do send out warnings that your password is about to expire, but if they either aren't around or are too lazy, then the password will expire and they will have to ask to get it reset.

If your management is telling you to do this, then tell them this is bad computer security.

Top
#207099 - 2013-04-11 02:48 PM Re: Password Expires/ [Re: BradV]
GeorgeLittle Offline
Fresh Scripter

Registered: 2011-02-08
Posts: 47
Loc: UK
because we have users that authenticate for a website but the passwords are set to expire every 30 days. They cant change the passwords on the website (dont ask) and this seems a potential solution
Top
#207100 - 2013-04-11 05:17 PM Re: Password Expires/ [Re: GeorgeLittle]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
I would take a look at LoadFile().

Something in the essence of...

 Code:
$userlist = "\\server\share\users.txt"

$users = LoadFile($userlist, @CRLF)

For Each $user in $users
   ; Insert code to change users password here
   ;
   ; Insert code to email the new password here
   ;
Next

Function LoadFile($file, optional $array, $Uni)
   DIM $fso,$f,$fs
   if $uni $uni = $uni-3 else $uni = -2 endif
   if not $uni $uni = -2 endif
   $fso = CreateObject("Scripting.FileSystemObject")
   $f = $fso.GetFile($file)
   If @ERROR Exit 2 EndIf
   $fs = $f.OpenAsTextStream(1,$uni)
   If not $array
      $loadfile = $fs.Read($f.size)
   Else
      $loadfile = Split($fs.Read($f.size),$array)
   Endif
   Exit @ERROR 
EndFunction

Top
#207101 - 2013-04-11 06:00 PM Re: Password Expires/ [Re: ShaneEP]
GeorgeLittle Offline
Fresh Scripter

Registered: 2011-02-08
Posts: 47
Loc: UK
hmm getting there. Right so the only bit Im stuck on now is how do i check the password age for a user other than the logged on one
Top
#207102 - 2013-04-11 06:31 PM Re: Password Expires/ [Re: GeorgeLittle]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4574
Loc: USA
Seems you could modify the Check Pass Age UDF with the info provided in the microsoft link to get what you need.

http://support.microsoft.com/kb/323750

Check Password Age:
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=204349#Post204349
_________________________
(... better days ahead)

Top
#207105 - 2013-04-12 12:02 PM Re: Password Expires/ [Re: Allen]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
Here are a couple of other links. I think the second one has what you want:

Powershell function to get password age.
Here is a VB script to display password expiration for all users.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.061 seconds in which 0.027 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org