如何从C#Active目录属性获得“交互式登录:提示用户在到期前更改密码”天数?
答案 0 :(得分:0)
组策略只是将注册表设置应用于计算机或用户。在这种情况下:
PasswordExpiryWarning
中的 HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
https://technet.microsoft.com/en-us/library/cc957396.aspx
您可以使用以下方式阅读:
int expiry = (int)Microsoft.Win32.Registry.LocalMachine
.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon")
.GetValue("PasswordExpiryWarning");