if you are looking to disable the password for the Windows Server 2008 R2 in which the machine also acts as a Domain Controller then follow these steps:
1) If you go to “Local security policy- you’ll see the options but it is not going to allow you to change the setting even if you are logged in as domain administrator.
2. So we need an alternate path to edit the password expiration policy.
Go to Start > Administrative Tools > Group Policy Management
3. Here click on “edit” for the default domain policy for the domain of your choice:
4. Go To Policies > Windows Settings > Security Settings > Account Policies > Password Policy
5. Change the Password Policy!
Note that changing your password policy to disable password expiration is a security vulnerability. It’s applicable for your Demo or Test Machine only.