Did you know that there is an attribute called ‘drink’ in Microsoft’s Active Directory?
Me neither!
Apparently its been RFC since 1991!

9.3.5.  Favourite Drink

   The Favourite Drink attribute type specifies the favourite drink of
   an object (or person).

     favouriteDrink ATTRIBUTE
         WITH ATTRIBUTE-SYNTAX
             caseIgnoreStringSyntax
             (SIZE (1 .. ub-favourite-drink))
     ::= {pilotAttributeType 5}

There is a similar one in OpenLDAP, it’s favouriteDrink.
After hearing about this, I simply needed to jump right in and see if I could set one for myself!

Here’s how I did it:
First things first. If you don’t have the following option available, register the DLL file to allow you to access the Active Directory Schema Snap-In in MMC:

This works fine for both 32 &64bit OS’s

Make sure you run it as elevated Administrator prompt, or you will get warnings like these:

NOTE: You also need to be a part of the AD Schema Admins group in AD!

Add the ‘Active Directory Schema’ snap in to the MMC.

Right click on ‘user’ the Properties. Select ‘attributes’ and then click ‘Add’

Find that Attribute called Drink, Press OK, And then OK.

You can right click on the Schema and select Reload if you like.

Over to Active Directory:

In my managers OU I have 2 users

Run PowerShell as an Administrator.
Lets run the following command to see if the drink attribute is listed for the user:

Get-ADUser manager1 -Properties * | Select *


Nope! No Drink there.

Let’s set the managers drink now

Set-ADUser manager1 -Add @{drink="Scotch"}

Running the command from above one more time:

Get-ADUser manager1 -Properties * | Select *

There it is!

Easy Peasy!
I think it goes without saying however, that you need to be careful in adding things to the schema.
Don’t mess it up!

 

Microsoft Active Directory and the ‘Drink’ Attribute
Tagged on:                     

Leave a Reply

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