O R G A N I C / F E R T I L I Z E R

Oct 18, 2016

How to Check for Expiring Certificates in PowerShell

This one I’m saving for later. Don’t confuse this with actually managing certificates via the PKI module. This is really about finding information on certificates already deployed.

First of all, remember that Cert:\ is a PS drive. Try something like this when you open a PS prompt:

cd cert:\
cd currentuser\my

PS C:\> cd cert:\
PS Cert:\> cd currentuser\my
PS Cert:\currentuser\my> dir

    Directory: Microsoft.PowerShell.Security\Certificate::currentuser\my

Thumbprint                               Subject                     
----------                               -------

So with that in mind, you can do the typical kind of listing/sorting/displaying. One of the interesting switches that shows up when you’re in the certificates drive is the –ExpiringInDays. This is extremely useful if you’re trying to get a return of certificates that are about to expire (think alerting.)

get-childitem -path Cert:\CurrentUser\My -ExpiringInDays 180

By doing this, you can treat this as a boolean return. If something pops up, fire an alert.

Sep 22, 2016

Max Group Membership Limits for Active Directory

While exploring the concept of maximum membership limits for groups, I ran into a number of posts which offered contradicting information. To set the record straight, we will start with with ancient history.

When Windows 2000 was released, the recommended number of members in a group was 5000. This corresponds with the number of changes that could be written in a single replication cycle (if I have my facts straight.) Remember, back in those days, every time you changed the membership of a group, you caused the entire group and all its membership information to replicate.

With the release of Windows 2003 came the concept of Linked Value Replication. This enabled you to make membership changes to a group and only replicate the changes in membership – adds, deletes, etc. Because of this, Microsoft hasn’t issued a new recommended limit. Here’s a snippet from a document titled Windows Server 2003 R2 and Windows Server 2003:

Recommended Maximum Number of Users in a Group

For Windows 2000 Active Directory environments, the recommended maximum number of members in a group is 5,000. This recommendation is based on the number of concurrent atomic changes that can be committed in a single database transaction. Starting with Windows Server 2003, the ability to replicate discrete changes to linked multivalued properties was introduced as a technology called Linked Value Replication (LVR).To enable LVR, you must increase the forest functional level to at least Windows Server 2003 interim. Increasing the forest functional level changes the way that group membership (and other linked multivalued attributes) is stored in the database and replicated between domain controllers. This allows the number of group memberships to exceed the former recommended limit of 5,000 for Windows 2000 or Windows Server 2003 at a forest functional level of Windows 2000. So far, testing in this area has yet to reveal any new recommended limits to the number of members in a group or any other linked multivalued attribute. Production environments have been reported to exceed 4 million members, and Microsoft scalability testing reached 500 million members.

So there you have it. The next time someone asks you about membership limitations of a group, you can happily tell them – it doesn’t exist (because you aren’t on Windows 2000, right? RIGHT?)