Показать полную графическую версию : [решено] Дата смены пароля локального пользователя
Всем привет!
Можно ли каким-нибудь образом выдернуть дату смены пароля локального пользователя (предпочтительнее bat или vbs)?
How To Find Password Last Changed Date Using ADSI (https://support.microsoft.com/en-us/kb/192949):
The Active Directory Service Interfaces (ADSI) Windows NT provider does not support the PasswordLastChanged Property of an IADsUser object. You can computer this date by subtracting the password expiration period from the password expiration date to get the last change date. Note that for users whose passwords never expire, the PasswordExpirationDate will be in the past and the computation still works correctly.
Option Explicit
Dim strUser
strUser = "UserName"
With GetObject("WinNT://./" & strUser & ",user")
WScript.Echo "Password Last Changed on : " & FormatDateTime(DateAdd("s", -.Get("MaxPasswordAge"), .PasswordExpirationDate))
End With
WScript.Quit 0
Скрипт работает. Добавил еще ИМЯ пользователя в сообщение.
WScript.Echo "Password Last Changed on user "& strUser &": " & FormatDateTime(DateAdd("s", -.Get("MaxPasswordAge"), .PasswordExpirationDate))
Спасибо! Вопрос решен.
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.