RE: How to obtain password expiration date
- From: v-crinal@xxxxxxxxxxxxxxxxxxxx ("Crina Li")
- Date: Thu, 10 Nov 2005 06:55:36 GMT
Hi Lardy,
Thank you for posting in SBS newsgroup.
As I know, SBS has its specific OU, please try to change the script to
reflect to the SBS specific OU structure to see if it helps. For example,
change "/CN=John Doe,CN=Users,DC=YOURDOMAIN,DC=COM" to "/CN=John
Doe,OU=SBSUsers,OU=Users,OU=MyBusiness,DC=YOURDOMAIN,DC=LOCAL".
If this still does not work, you may need to post it in the MSDN newsgroup.
Thanks for your understanding and I look forward to hearing from you.
Best regards,
Crina Li (MSFT)
Microsoft CSS Online Newsgroup Support
Get Secure! - www.microsoft.com/security
=====================================================
This newsgroup only focuses on SBS technical issues. If you have issues
regarding other Microsoft products, you'd better post in the corresponding
newsgroups so that they can be resolved in an efficient and timely manner.
You can locate the newsgroup here:
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx
When opening a new thread via the web interface, we recommend you check the
"Notify me of replies" box to receive e-mail notifications when there are
any updates in your thread. When responding to posts via your newsreader,
please "Reply to Group" so that others may learn and benefit from your
issue.
Microsoft engineers can only focus on one issue per thread. Although we
provide other information for your reference, we recommend you post
different incidents in different threads to keep the thread clean. In doing
so, it will ensure your issues are resolved in a timely manner.
For urgent issues, you may want to contact Microsoft CSS directly. Please
check http://support.microsoft.com for regional support phone numbers.
Any input or comments in this thread are highly appreciated.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Lardy" <thelardmeister@xxxxxxxxxxx>
| Newsgroups: microsoft.public.windows.server.sbs
| Subject: How to obtain password expiration date
| Date: Wed, 9 Nov 2005 20:27:31 +1000
| L|
| Hi All,
|
| Windows SBS 2003 Server Standard Edition
|
| Is there a way to find when a users password is due to expire and when it
| was last changed?
|
| I hunted around the net and found the script below from
| http://support.microsoft.com/default.aspx?scid=kb;en-us;323750.
| It gives me an error for line 27 character 5, which I assume is "Set
oUser =
| GetObject("LDAP://" & strUserDN)". I have tested it on a Windows 2003
| Server SP1 and it worked like a charm. What changes would need to be
made
| for it to work on Windows SBS 2003 Server?
|
| Lardy.
|
|
| '========================================
| ' First, get the domain policy.
| '========================================
| Dim oDomain
| Dim oUser
| Dim maxPwdAge
| Dim numDays
|
| strDomainDN = "YOURDOMAIN"
| strUserDN = strDomainDN & "/CN=John Doe,CN=Users,DC=YOURDOMAIN,DC=COM"
|
| Set oDomain = GetObject("LDAP://" & strDomainDN)
| Set maxPwdAge = oDomain.Get("maxPwdAge")
|
| '========================================
| ' Calculate the number of days that are
| ' held in this value.
| '========================================
| numDays = CCur((maxPwdAge.HighPart * 2 ^ 32) + _
| maxPwdAge.LowPart) / CCur(-864000000000)
| WScript.Echo "Maximum Password Age: " & numDays
|
| '========================================
| ' Determine the last time that the user
| ' changed his or her password.
| '========================================
| Set oUser = GetObject("LDAP://" & strUserDN)
|
| '========================================
| ' Add the number of days to the last time
| ' the password was set.
| '========================================
| whenPasswordExpires = DateAdd("d", numDays, oUser.PasswordLastChanged)
|
| WScript.Echo "Password Last Changed: " & oUser.PasswordLastChanged
| WScript.Echo "Password Expires On: " & whenPasswordExpires
|
| '========================================
| ' Clean up.
| '========================================
| Set oUser = Nothing
| Set maxPwdAge = Nothing
| Set oDomain = Nothing
|
| WScript.Echo "Done"
|
|
|
.
- Follow-Ups:
- RE: How to obtain password expiration date
- From: MijakiDK
- RE: How to obtain password expiration date
- Prev by Date: Re: Companyweb - Cannot complete this action
- Next by Date: RE: sms synchronization trigger
- Previous by thread: Re: Companyweb - Cannot complete this action
- Next by thread: RE: How to obtain password expiration date
- Index(es):
Relevant Pages
|