DarrenH
(Fresh Scripter)
2009-07-01 04:34 PM
A simple question about @MaxPWage

You have all been very helpful in the past. I hope this isn't too stupid, but does @Maxpwage and @pwage only work for the current user? I mean the one running the script. I have a script that notifies a manager when his employees passwords are going to expire. They are all show the same pwage. That may be the case, but I want to make sure. I don't want to be using my password age for every user!

Gargoyle
(MM club member)
2009-07-01 04:48 PM
Re: A simple question about @MaxPWage

Depends on how you wrote the script. But if you are using the builtin macros, then it would be of the current user running the script. If you are wantint to generate a report, you will have to connect to AD and read each of the users information and go from there.

DarrenH
(Fresh Scripter)
2009-07-01 04:59 PM
Re: A simple question about @MaxPWage

In the script I can show PasswordLastChanged, but I'm not sure how to do the math on mm/dd/yyyy hh:mm:ss to find what I need.

Mart
(KiX Supporter)
2009-07-02 12:02 AM
Re: A simple question about @MaxPWage

Have a look at the TimeDif() UDF. Easy in use and does exactly what you want/need.

TimeDiff() - calculate time difference between 2 timestamps

You can let it calculate the number of days between PasswordLastChanged from AD and today. If the outcome is more then X days send a notification the user's manager.

BTW: @ Glenn, there is a typo in title of the UDF. It says betweeen (three e’s).


Glenn BarnasAdministrator
(KiX Supporter)
2009-07-02 01:19 AM
Re: A simple question about @MaxPWage

No there isn't (any more) ;\)

Thanks!

Glenn


BradV
(Seasoned Scripter)
2009-07-02 12:58 PM
Re: A simple question about @MaxPWage

Maybe he saw a mouse jump out of his rocket while he was typing it in?
\:\)


DarrenH
(Fresh Scripter)
2009-07-06 04:42 PM
Re: A simple question about @MaxPWage

Thanks. I think that will do it.

Benny69
(MM club member)
2009-07-06 06:09 PM
Re: A simple question about @MaxPWage

@BradV, LOL!