#62121 - 2002-01-16 12:14 AM
Script for determining NT account expiry?
|
Anonymous
Anonymous
Unregistered
|
Does anybody had a script or UDF for checking when an NT domain account will expire. We expire temporary accounts regularly and it'd be great to have a routine that looks for such info and I can produce a report from the output. Thx!
|
|
Top
|
|
|
|
#62123 - 2002-01-16 04:44 AM
Re: Script for determining NT account expiry?
|
Les
KiX Master
   
Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
|
rixster, You think I'd of learned by now to test my theories...yup, yup, yup... right method, wrong property... Try something like this break on Dim $usr $usr = GetObject("WinNT://YourPDC/lligetfa,user") $AccountExpirationDate = $usr.AccountExpirationDate ? "AccountExpirationDate = "+$AccountExpirationDate get $_
Let me know how it work out.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.
|
|
Top
|
|
|
|
#62127 - 2002-01-16 06:03 PM
Re: Script for determining NT account expiry?
|
Markus Hahn
Lurker
Registered: 2002-01-16
Posts: 4
Loc: Duesseldorf
|
Can I set that filter in a way that I only get one global group out of that domain and not the whole bunch of users ?Greetings Markus
|
|
Top
|
|
|
|
#62129 - 2002-01-17 05:32 PM
Re: Script for determining NT account expiry?
|
Markus Hahn
Lurker
Registered: 2002-01-16
Posts: 4
Loc: Duesseldorf
|
In fact I want the users of one global group listed together with the age of their password. Your infos brought me a lot closer to that, but I always get all domain users listed (far more then I want).Here's what I've got so far: $domain = GetObject("WinNT://EMEA") $domain.filter = "group","" for each $user in $domain $PasswordAge = $user.PasswordAge ? $user.name+ ": Password Age = "+$PasswordAge next Any idea ? Thanx Markus
|
|
Top
|
|
|
|
#62131 - 2002-01-18 04:36 PM
Re: Script for determining NT account expiry?
|
Markus Hahn
Lurker
Registered: 2002-01-16
Posts: 4
Loc: Duesseldorf
|
Thanks Bryce, do I understand this correctly that in the top line I define the Domain and the group I want to list the members of ?Function Groupmembers("MyDomain","MyGroup") Or is this script only a part of another script that is giving the Domain and group as $target and $group to that Function, and the function returns one group member ? If so what would be the name of the returned string ?
|
|
Top
|
|
|
|
#62134 - 2002-01-20 12:35 AM
Re: Script for determining NT account expiry?
|
Markus Hahn
Lurker
Registered: 2002-01-16
Posts: 4
Loc: Duesseldorf
|
Brilliant. That's it. Thaks a lot from Germany. Greetings Markus
|
|
Top
|
|
|
|
#62135 - 2002-03-10 04:57 PM
Re: Script for determining NT account expiry?
|
attiahia
Hey THIS is FUN
Registered: 2000-03-27
Posts: 268
|
In the main login script I want to add the following:
Check the user account expiration date once he login, compare it with the current date and inform the user with the remaining month\day.
For the first part (finding the user account expiration date) I did the following
$usr ="attiahXm"
$domain = GetObject("WinNT://@domain") $domain.filter = "user","" for each $user in $domain $AccountExpirationDate = $user.AccountExpirationDate ? $user.name+ ":AccountExpirationDate = "+$AccountExpirationDate next
I got a few accounts only with empty date like.
admin:AccountExpirationDate = Administrator:AccountExpirationDate = backup:AccountExpirationDate = Guest:AccountExpirationDate =
Thank you
|
|
Top
|
|
|
|
#62138 - 2002-03-11 04:40 AM
Re: Script for determining NT account expiry?
|
attiahia
Hey THIS is FUN
Registered: 2000-03-27
Posts: 268
|
Thank you a lot for this help.
How can I know that ADSI provider installed on my workstation? I think it’s exist because I executed before the OU function which I got from Alix & Bryce on this workstation and it gave me excellent result.
Whoever, I want to know what is missing in the account expiration date code.
In addition, do you know any resource kit, windows system or windows support tool which can find the account expiration date for NT domain? Thank you.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1782 anonymous users online.
|
|
|