Configuring Granular Password Settings in Windows Server 2008, Part 2

If you missed the first part in this article series please read Configuring Granular Password Settings in Windows Server 2008, Part 1

This last of two articles will give some useful background information about the granular password settings in Windows Server 2008. We will now deal with the new attributes on groups and user objects, the Password Settings Objects (PSO), the resultant PSO, design recommendations, Shadow Groups (SG) and much more…

Why would I want to do this?

We have now seen how to create PSOs and assign them to users and/or groups, but why do we need multiple password and account lockout policies you might ask? Well, there are many reason for doing this – one could be “hosting” scenarios where multiple companies are present in a single AD domain, another more common reason is where we need stricter settings to apply to a specific group of people with privileged accounts (like domain administrators, help desk personnel etc.).

Those privileged accounts can have a complexity requirement and a requirement of defining a minimum of 16 characters in their passwords and other, more limited accounts, can have more “user friendly” requirements – although I would recommend everyone to use passwords of that strength (more about this in a later article).

Who can hit what?

At the risk of repeating myself I must say this to make sure it is 100% clear. The new “multiple password policy” functionality in Windows Server 2008 (Codename “Longhorn”) allows us to set individual password policies and account lockout policies on user objects, interOrgPerson objects and global security groups.

Fine-grained password policies cannot be applied to an OU directly – now we must apply these policies to groups instead. Not any kind of group – it must be security groups set to the global scope. It’s possible to set the options/attributes on other groups; however it will not work as expected (the settings are ignored).

If we really want to handle password policies within the OU structure, the ‘Shadow Groups’ can be useful – see the section ‘Shadow Groups and how to script them’ later in this article.

By default only members of the “Domain Admins” group can set, create and delete fine-grained password policies – better known as Password Setting Objects (PSO). However, these permissions can be delegated and tweaked if required, but the default settings should be fine for most environments. To be more specific, only members of the Domain Admins group have the required ‘Create Child’ and ‘Delete Child’ permissions on the Password Settings Container (PSC) object.

To apply a PSO to a user or a group object, you must have ‘Write’ permissions on the PSO object – members of the Domain Admins group are the only ones with this permission by default. The “funny” thing is that you don’t have to have permissions on the user or group object itself, as these are set by a background directory process.

Take a look at those attributes

I just have to mention some of the attributes that make all of this possible.

msDS-PSOAppliesTo

Every PSO has a multi-valued attribute named msDS-PSOAppliesTo which is known as a ‘forward link’, linking to user or group objects. It can link to a single user, a single group, multiple users, multiple groups or multiple users and groups. These links are actually just the distinguished names (Eg. “CN=GroupA,OU=MyGoups,DC=Contoso,DC=Local”) of the associated objects.

You might ask: What if we rename or move a user or group object (to another OU or container), will the PSOs “follow” the objects? Yes – the PSOs msDSPSOAppliesTo attribute is automatically updated by the directory service in the background, to point to the new location (distinguished name) of the changed object.

msDS-PSOApplied

The just mentioned msDS-PSOAppliesTo attribute on the PSOs can be edited as opposed to the ‘back link’ attribute msDS-PSOApplied which is present on user and group objects. The latter attribute is “view only” and handled by the directory service in the background.

The msDS-PSOApplied attribute contains a ‘back link’ to the PSO/PSOs pointing at its parent object – as users and groups can have multiple PSOs applied to them this attribute is multi-valued too.

msDS-ResultantPSO

The msDS-ResultantPSO attribute is present on user objects only. It contains a calculated value, also referred to as the “Resultant Set of Policy” (RSoP). This is a link to the single “lucky” PSO that is active on the specific user object. This value is calculated by the directory service process in the background from the rules mentioned in the next section of this article (“The Design“).

You might ask: When is the password policy active on a user who is added to a group? As soon as a user is added to the group the resultant PSO is also calculated for the user object by the directory service. It is the same story if you remove a user account from a group – the change takes effect immediately.

msDS-PasswordSettingsPrecedence

The msDS-PasswordSettingsPrecedence attribute is present on the PSO objects. A lower value for this attribute indicates that the PSO has a higher priority. This attribute is used when multiple PSOs are applied to a user object – i.e. the lowest “cost” is chosen . If you assign a unique precedence value to each of your PSOs in the domain, it will always be easy to determine the effective password policy for a certain user object.

The design

Before implementing multiple password policies in the domain it is recommended to get an overview of what policies are needed and to finish the overall design of those policies and their interaction.

You can have multiple policies assigned to a single user, directly or through group memberships (even nested security groups are addressed), but only one PSO can be effective for a certain user object at any given time, and password or lockout settings cannot be “merged” like with Group Policies – it is one or the other policy that takes effect.

Therefore we need some rules and a priority calculation when multiple PSOs are present for a user.

The simple rules…
The resultant PSO is determined as follows:

  1. A PSO that is linked directly to the user object will take effect unless multiple PSOs are linked directly to the user object. If more than one PSO is linked, the PSO with the lowest precedence value (msDS-PasswordSettingsPrecedence) is the resultant PSO. If the system should spot two or more PSOs applied directly to a given user, all with the exact same msDS-PasswordSettingsPrecedence value, the PSO with the smallest Global Unique Identifier (GUID) is applied.
  2. If no PSOs are linked to the user object, the global security group memberships of the user are taken into consideration. If the user is a member of multiple security groups with different PSOs applied, the PSO with the lowest precedence value is the resultant PSO. If the system should spot two or more PSOs applied by group membership to a given user, all with the exact same msDS-PasswordSettingsPrecedence value, the PSO with the smallest GUID is applied.

If no PSO is obtained from conditions 1 and 2, the password and lockout settings from the “Default Domain Policy” are applied, just like it was with earlier versions of Active Directory (AD) environments.
So, to make a long story short: PSOs set on user objects will win over PSOs set on group objects and the lower precedence value will win over the higher – if that “fails” the result is based on GUID numbers – and if nothing applies we are back to where we started: The “Default Domain Policy”!

As more general recommendations I will mention these:

The ‘Description‘ field can be used to specify the password and lockout settings that are enabled in the PSO. Use it for a quick ‘wrap-up’ of the PSO configuration and intended use.

Create a naming convention for PSOs like you have for other AD objects etc.

Assign PSOs to groups, instead of directly on user objects, for better overview and easier manageability.

Assign a unique precedence value to each of the PSOs in your domain, it will then be much easier to determine the effective password policy for a certain user object.

The Default Deny All rule

Well, I know this might not be a popular thing to say, but I would recommend you set the password settings contained in the “Default Domain Policy” to a very high (almost ‘annoying’) level of security. This is because you – or somebody else – might “forget” to include a user in one of the password security groups. In that case the user accounts password policy will “fallback” to the one defined in this default policy set on the domain level.

Look at the security policy in the Default Domain Policy as the “Default Deny All” rule in a firewall – if no specific rule/policy is available for the user (or one of the groups of which he is a member) then we should place a very strict policy on the user’s ‘head’. The user will probably call help desk to get this fixed ASAP – if we give the user a very relaxed password policy instead he/she will, in most cases, never complain.

Another way to do this would be to set a granular password policy on the “Domain Users” group with the lowest priority used – but again, at some point an account might “slip” out of this group for some reason… My choice is definitely the Default Deny All rule – as always!

Shadow groups and how to script them

If you have never heard about “Shadow Groups”, do not worry – neither had I two months ago. A Shadow Group (SG) is a security group (in this case a Global security group) that contains the objects within a given OU as members. A SG is a security group that is “logically” mapped to an OU you could say.

For instance you might have an OU, “OU=Sales,OU=CorpUsers,DC=Contoso,DC=Local”, with the user accounts for the entire sales department – a SG would be a group that matched that content 100%. For password policies this can be a really good thing if we want the password policies to “follow” the OU structure “virtually”, instead of following the Security Group structure.

You can probably imagine that this would mean a great deal of work if we had to update the SGs manually every hour or so – that is why I have written a small and simple VBS script to automate this process by using a scheduled task.

The script collects the user accounts from a specific OU – specified as an argument to the script – and places those into a dictionary object. The script then collects the users within a specific group – specified as an argument to the script – and places those into another dictionary object. By comparing those dictionaries, the script adds or removes users from the “shadows group”. The script is ‘designed’ to be scheduled as a task and should be used with the following syntax: ShadowGroup.vbs “Target OU” “Shadow Group”

Example:
ShadowGroup.vbs “OU=Test,DC=Contoso,DC=Local” “CN=Shadow,OU=Test,DC=Contoso,DC=Local”

The script can be downloaded here, but use in a production environment is at your own risk. It is recommended to put in some error handling routines and maybe reporting functionality. Also support for sublevel OUs would be a good idea to implement. I might provide such a script later on, but so far we have the basic functionality included.

Scripting
It is actually possible to script the creation and modification of granular password policies and assigning those policies to specific users or groups. However, this article will not deal with these possibilities in detail.

We can use the good old LDIFDE tool and of course, the new Sheriff in town, Mr. PowerShell. Windows PowerShell is included with Windows Server 2008 and must be added as a “Feature” – choose “Add Feature” in the new and shiny Server Manager, select Windows PowerShell and after a few moments you are ‘PowerShell Ready’

I will recommend you trying out the Quest AD Cmdlets and to check out PowerGui.org.

A free command line tool, PSOmgr, already exists from Joeware. With this tool you can manage Password Settings Objects in Windows Server 2008 very easily, eg. display the applied policies and the effective policy of a given user, display the PSOs in the domain/forest, add or remove a user from a PSO, create/rename/delete/modify PSOs and much more…

Conclusion

Understanding how Granular Password Settings work – and how, when and why to use them, is very important. Hopefully these two articles about ‘Configuring Granular Password Setting in Windows Server 2008’ have enlightened you on the subject.

The ‘password policy design’ itself is probably the hardest and most crucial part of setting up multiple password policies within a single AD domain, and after creating the required policies the rest is just ‘management as usual’ – enjoy!

If you missed the first part in this article series please read Configuring Granular Password Settings in Windows Server 2008, Part 1

External links
AD DS: Fine-Grained Password Policies
Step-by-Step Guide for Fine-Grained Password and Account Lockout Policy Configuration

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top