Ok, here's the setup. My company has been building a new 2012 domain environment. So far, all the servers in the domain are 2012.
With the new domain, I have begun testing Fine-Grained Password Policies because it was one of the functions we could not do on our old domain. And so far, everything on the domain side appear to be working just fine.
So now comes the problem. Because our users will be using Remote-apps to connect to their servers, they aren't going to be notified that their passwords will be expiring soon. Thus enters the VBscript.
Using Microsofts instructions, http://msdn.microsoft.com/en-us/library/ms974598.aspx, I have been trying to get a script going that will pop up a message telling the user that they need to change their password, but I've hit a brick wall with this part of the script.
Set objDomain = GetObject("LDAP://" & objADSystemInfo.DomainDNSName) Set objMaxPwdAge = objDomain.Get("maxPwdAge") If objMaxPwdAge.LowPart = 0 Then WScript.Echo "The Maximum Password Age is set to 0 in the " & _ "domain. Therefore, the password does not expire." WScript.Quit
For some reason, it will not pull the max password age. Now I'm using Fine-Grained passwords for the test account, but I have also tried setting the max password age in the default domain policy, and I still get the message that the "age is set to 0 and the password will not expire" even though I know the policy is functioning on the account.
I was thinking I might need to try and get the information from this attribute http://msdn.microsoft.com/en-us/library/cc220303.aspx, but I am unsure of how to call this information.
If I can just get the script to pull the max password age, I believe I can get the rest of the script working.
- Edited by Hotpocketdeath Wednesday, July 03, 2013 2:16 PM code correction