joeware - never stop exploring... :)

Information about joeware mixed with wild and crazy opinions...

3/4/2011

Adding sAMAccountName and sAMAccountType to ADAM/ADLDS directories

by @ 12:37 am. Filed under tech

First and foremost… ADAM rocks. 🙂

With that being said… I regularly like to pull users and groups from AD and stuff them into ADAM. In general the normal ADAM schema is sufficient but for users and groups from an ADAM standpoint, ADAM is a positive step away from the SAM DB and as part of that step they did not put sAMAccountName nor sAMAccountType into the ADAM schema.

However… Sometimes I want the sAMAccountName and sAMAccountType attributes because I am importing user/group objects from AD and those values may be important for some reason and I may need to keep them, this could be for any number of reasons. Regardless of the reason, sometimes I want to do it, and that means I fairly regularly add those attributes to the schema of various ADAM instances I spin up. This can be done specifically for these couple of attributes or you can, if needed, import the whole Windows Server 2003 or Windows Server 2008 Schemas with the MS-adamschemaw2k3.LDF and MS-adamschemaw2k8.LDF files.

So it isn’t exciting to walk through using LDIF to import the K3 or K8 schemas and doing so doesn’t teach you anything about how you can use AdFind and AdMod so I will show how I import just those two attributes in case it proves useful to someone else trying to do something similar.

While you can do this with the older versions of AdFind and AdMod, I have added some features to the latest versions (AdFind V01.44.00 / AdMod V01.15.00) specifically to make it easier. Below I outline the process you can follow to update an ADAM instance on the local PC to have sAMAccountName and sAMAccountType for users and groups.

 

Step 1: Create a CSV file for the import (I ran this command against a Windows Server 2008 R2 Domain):

adfind -sc sdump -csv -af ldapdisplayname=samaccount* > SamAccount.csv

When run you see:

[Wed 03/02/2011 23:23:42.71]
F:\Dev\Current\CPP\SchemaMods>adfind -sc sdump -csv -af ldapdisplayname=samaccount* > SamAccount.csv

[Wed 03/02/2011 23:24:08.33]

This creates the file (it won’t look pretty here) ;o)

__SamAccount.csv__

"dn","adminDescription","adminDisplayName","attributeID","attributeSecurityGUID","attributeSyntax","auxiliaryClass","cn","defaultHidingValue","defaultObjectCategory","defaultSecurityDescriptor","description","extendedCharsAllowed","governsID","isDefunct","isMemberOfPartialAttributeSet","isSingleValued","lDAPDisplayName","linkID","mAPIID","mayContain","mustContain","objectClass","objectClassCategory","oMSyntax","possSuperiors","rangeLower","rangeUpper","rDNAttID","schemaIDGUID","searchFlags","showInAdvancedViewOnly","subClassOf","systemAuxiliaryClass","systemFlags","systemMayContain","systemMustContain","systemOnly","systemPossSuperiors"
"CN=SAM-Account-Name,<SCHEMA>","SAM-Account-Name","SAM-Account-Name","1.2.840.113556.1.4.221","{59BA2F42-79A2-11D0-9020-00C04FC2D3CF}","2.5.5.12","","SAM-Account-Name","","","","","","","","TRUE","TRUE","sAMAccountName","","","","","attributeSchema;top","","64","","0","256","","{3E0ABFD0-126A-11D0-A060-00AA006C33ED}","13","TRUE","","","18","","","FALSE",""
"CN=SAM-Account-Type,<SCHEMA>","SAM-Account-Type","SAM-Account-Type","1.2.840.113556.1.4.302","{59BA2F42-79A2-11D0-9020-00C04FC2D3CF}","2.5.5.9","","SAM-Account-Type","","","","","","","","TRUE","TRUE","sAMAccountType","","","","","attributeSchema;top","","2","","","","","{6E7B626C-64F2-11D0-AFD2-00C04FD930C9}","1","TRUE","","","18","","","FALSE",""

 

Then to import into ADAM with the new importschema shortcut (use –po switch with shortcut to see exact switches enabled for you if curious)…

[Wed 03/02/2011 23:24:08.33]
F:\Dev\Current\CPP\SchemaMods>admod -hh . -sc importschema:SamAccount.csv

AdMod V01.15.00cpp Joe Richards (joe@joeware.net) March 2011

DN Count: 2
Using server: hplt17:389
Directory: Windows Server 2008 Active Directory Application Mode

Adding specified objects…
   DN: CN=SAM-Account-Name,CN=Schema,CN=Configuration,CN={4DC12149-8F6B-4E24-BF3A-7A2E754CBB44}…
   DN: CN=SAM-Account-Type,CN=Schema,CN=Configuration,CN={4DC12149-8F6B-4E24-BF3A-7A2E754CBB44}…

The command completed successfully

 

After you import the attributes, you need to refresh the schema so you can attach them to the classes.

[Wed 03/02/2011 23:25:28.99]
F:\Dev\Current\CPP\SchemaMods>admod -hh . -sc refreshschema

AdMod V01.15.00cpp Joe Richards (joe@joeware.net) March 2011

Modifying ROOTDSE…
DN Count: 1
Using server: hplt17:389
Directory: Windows Server 2008 Active Directory Application Mode

Modifying specified objects…
   DN: ROOTDSE…

The command completed successfully

 

Now add the attributes to the user and group classes.

[Wed 03/02/2011 23:25:57.24]
F:\Dev\Current\CPP\SchemaMods>admod -hh . -schema -rb cn=user maycontain:++:samaccountname;samaccounttype -exterr

AdMod V01.15.00cpp Joe Richards (joe@joeware.net) March 2011

DN Count: 1
Using server: hplt17:389
Directory: Windows Server 2008 Active Directory Application Mode
Base DN: cn=user,CN=Schema,CN=Configuration,CN={4DC12149-8F6B-4E24-BF3A-7A2E754CBB44}

Modifying specified objects…
   DN: cn=user,CN=Schema,CN=Configuration,CN={4DC12149-8F6B-4E24-BF3A-7A2E754CBB44}…

The command completed successfully

[Wed 03/02/2011 23:26:29.42]
F:\Dev\Current\CPP\SchemaMods>admod -hh . -schema -rb cn=group maycontain:++:samaccountname;samaccounttype -exterr

AdMod V01.15.00cpp Joe Richards (joe@joeware.net) March 2011

DN Count: 1
Using server: hplt17:389
Directory: Windows Server 2008 Active Directory Application Mode
Base DN: cn=group,CN=Schema,CN=Configuration,CN={4DC12149-8F6B-4E24-BF3A-7A2E754CBB44}

Modifying specified objects…
   DN: cn=group,CN=Schema,CN=Configuration,CN={4DC12149-8F6B-4E24-BF3A-7A2E754CBB44}…

The command completed successfully

 

And finally now you can refresh the schema again so that you can use the attributes.

[Wed 03/02/2011 23:26:43.77]
F:\Dev\Current\CPP\SchemaMods>admod -hh . -sc refreshschema

AdMod V01.15.00cpp Joe Richards (joe@joeware.net) March 2011

Modifying ROOTDSE…
DN Count: 1
Using server: hplt17:389
Directory: Windows Server 2008 Active Directory Application Mode

Modifying specified objects…
   DN: ROOTDSE…

The command completed successfully

 

Now that you have this info in the schema you can do something like (using the new importpass1 and importpass2 switches)…

 

[Wed 03/02/2011 23:28:31.44]
F:\Dev\Current\CPP\SchemaMods>adfind -default -rb cn=users -sc export_x -csv | admod -hh . -add -importpass1 -unsafe -exterr

AdMod V01.15.00cpp Joe Richards (joe@joeware.net) March 2011

DN Count: 20
Using server: hplt17:389
Directory: Windows Server 2008 Active Directory Application Mode

Adding specified objects…
   DN: CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=$joe,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Administrator,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Allowed RODC Password Replication Group,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Cert Publishers,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Denied RODC Password Replication Group,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Domain Admins,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Domain Computers,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Domain Controllers,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Domain Guests,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Domain Users,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Enterprise Admins,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Enterprise Read-only Domain Controllers,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Group Policy Creator Owners,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Guest,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=krbtgt,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=RAS and IAS Servers,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Read-only Domain Controllers,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Schema Admins,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=testuser,CN=Users,DC=test,DC=loc,DC=adam…

The command completed successfully

 

and

 

[Wed 03/02/2011 23:28:41.20]
F:\Dev\Current\CPP\SchemaMods>adfind -default -rb cn=users -sc export_x -csv | admod -hh . -importpass2 -unsafe -exterr

AdMod V01.15.00cpp Joe Richards (joe@joeware.net) March 2011

DN Count: 20
Using server: hplt17:389
Directory: Windows Server 2008 Active Directory Application Mode

Modifying specified objects…
   DN: CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=krbtgt,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=Domain Computers,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=Domain Controllers,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=Schema Admins,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Enterprise Admins,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Cert Publishers,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=Domain Admins,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Domain Users,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=Domain Guests,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=Group Policy Creator Owners,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=RAS and IAS Servers,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=Allowed RODC Password Replication Group,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=Denied RODC Password Replication Group,CN=Users,DC=test,DC=loc,DC=adam…
   DN: CN=Read-only Domain Controllers,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=Enterprise Read-only Domain Controllers,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=testuser,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=Administrator,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=Guest,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.
   DN: CN=$joe,CN=Users,DC=test,DC=loc,DC=adam…  No LDAP updates to make.

The command completed successfully

 

and you may be wondering… seriously, did it really update the group memberships with the proper members?

 

[Wed 03/02/2011 23:30:17.19]
F:\Dev\Current\CPP\SchemaMods>adfind -hh . -default -rb cn=users -f objectcategory=group member

AdFind V01.44.00cpp Joe Richards (joe@joeware.net) March 2011

Using server: hplt17:389
Directory: Windows Server 2008 Active Directory Application Mode
Base DN: cn=users,DC=test,DC=loc,DC=adam

dn:CN=Allowed RODC Password Replication Group,CN=Users,DC=test,DC=loc,DC=adam

dn:CN=Cert Publishers,CN=Users,DC=test,DC=loc,DC=adam

dn:CN=Denied RODC Password Replication Group,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=Schema Admins,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=Read-only Domain Controllers,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=krbtgt,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=Group Policy Creator Owners,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=Enterprise Admins,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=Domain Controllers,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=Domain Admins,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=Cert Publishers,CN=Users,DC=test,DC=loc,DC=adam

dn:CN=Domain Admins,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=Administrator,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=$joe,CN=Users,DC=test,DC=loc,DC=adam

dn:CN=Domain Computers,CN=Users,DC=test,DC=loc,DC=adam

dn:CN=Domain Controllers,CN=Users,DC=test,DC=loc,DC=adam

dn:CN=Domain Guests,CN=Users,DC=test,DC=loc,DC=adam

dn:CN=Domain Users,CN=Users,DC=test,DC=loc,DC=adam

dn:CN=Enterprise Admins,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=Administrator,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=$joe,CN=Users,DC=test,DC=loc,DC=adam

dn:CN=Enterprise Read-only Domain Controllers,CN=Users,DC=test,DC=loc,DC=adam

dn:CN=Group Policy Creator Owners,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=Administrator,CN=Users,DC=test,DC=loc,DC=adam

dn:CN=RAS and IAS Servers,CN=Users,DC=test,DC=loc,DC=adam

dn:CN=Read-only Domain Controllers,CN=Users,DC=test,DC=loc,DC=adam

dn:CN=Schema Admins,CN=Users,DC=test,DC=loc,DC=adam
>member: CN=Administrator,CN=Users,DC=test,DC=loc,DC=adam

14 Objects returned

 

and AD looks like

 

[Wed 03/02/2011 23:31:03.87]
F:\Dev\Current\CPP\SchemaMods>adfind -default -rb cn=users -f objectcategory=group member

AdFind V01.44.00cpp Joe Richards (joe@joeware.net) March 2011

Using server: K8R2Dom-DC01.K8R2Dom.loc:389
Directory: Windows Server 2008 R2
Base DN: cn=users,DC=K8R2Dom,DC=loc

dn:CN=Domain Computers,CN=Users,DC=K8R2Dom,DC=loc

dn:CN=Domain Controllers,CN=Users,DC=K8R2Dom,DC=loc

dn:CN=Schema Admins,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=Administrator,CN=Users,DC=K8R2Dom,DC=loc

dn:CN=Enterprise Admins,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=$joe,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=Administrator,CN=Users,DC=K8R2Dom,DC=loc

dn:CN=Cert Publishers,CN=Users,DC=K8R2Dom,DC=loc

dn:CN=Domain Admins,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=$joe,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=Administrator,CN=Users,DC=K8R2Dom,DC=loc

dn:CN=Domain Users,CN=Users,DC=K8R2Dom,DC=loc

dn:CN=Domain Guests,CN=Users,DC=K8R2Dom,DC=loc

dn:CN=Group Policy Creator Owners,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=Administrator,CN=Users,DC=K8R2Dom,DC=loc

dn:CN=RAS and IAS Servers,CN=Users,DC=K8R2Dom,DC=loc

dn:CN=Allowed RODC Password Replication Group,CN=Users,DC=K8R2Dom,DC=loc

dn:CN=Denied RODC Password Replication Group,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=Read-only Domain Controllers,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=Group Policy Creator Owners,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=Domain Admins,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=Cert Publishers,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=Enterprise Admins,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=Schema Admins,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=Domain Controllers,CN=Users,DC=K8R2Dom,DC=loc
>member: CN=krbtgt,CN=Users,DC=K8R2Dom,DC=loc

dn:CN=Read-only Domain Controllers,CN=Users,DC=K8R2Dom,DC=loc

dn:CN=Enterprise Read-only Domain Controllers,CN=Users,DC=K8R2Dom,DC=loc

14 Objects returned

 

    joe

Rating 4.60 out of 5

3/3/2011

AdFind V01.44.00 and AdMod V01.15.00 released

by @ 11:52 pm. Filed under tech

As mentioned previously, AdFind V01.43.00 had some issues with non-Microsoft LDAP directories due to a check I added to detect if paging was available[1]. I mistakenly assumed that RootDSE’s would all return the supportedControl attribute by default. I fixed that. 🙂 In the meanwhile I took the time to work on a few other things as well that I didn’t have time to get to before in the prior release,overall though, the main changes are in AdMod.

AdFind Update Summary

As mentioned, I fixed the paging check issue. I also set up some decodes of RootDSE OIDs for OpenLDAP. I also added a –nopagingcheck just in case a directory supports the paging control but for whatever reason isn’t returning it in the RootDSE request. Look at me worrying about non-Microsoft directories. ;o)

I fixed an output bug I introduced in V01.43.00 around value metadata output.

I tweaked the attributes in the –sc export_* shortcuts.

I put in a hard block and error message when you specify a special base and the –b switch. I call this the Burbidge update.

I modified the –sc dclist shortcut. I made it more flexible so that it can be used for all DCs in the forest or just the DCs in a single forest. Also you can now specify RODCs only. At the same time I also decided to add –sc gclist and –sc !gclist. These should all be really useful for FOR /F looping in Batch. I intend to write up a blog entry or two on this because it is tremendously useful if you need to quickly gather info across all of your DCs and everyone is telling you that you need to write a script to do it.

I added another similar shortcut, –sc domainlist which gives you DNS Names (dNSRoot attribute of NC Partition object) of all Domains in the forest.

 

AdMod Update Summary

Main changes in AdMod are that I was finally able to duplicate and find some long running –CSV and –Import issues. I had been getting sporadic reports of issues for some time and I could never narrow the problem down but finally got a break in the troubleshooting and sorted it out. I spent hours most nights since the last release stepping through the code line by line for various CSV files keeping manual tables of what should be happening, reminded me exercises from computer science classes back in the 80’s. 

 

I also took this time to add some other useful features to the import functionality to make it more friendly for imports including having AdMod look at the destination directory schema and automatically filtering out any attributes from the import that don’t exist in the destination directory. I also added two new import modes, importpass1 and importpass2. This is to help deal with DN attributes that may have references that aren’t already defined when the object is created. The idea is that you run the CSV file in ADD mode with importpass1 and it creates all of the objects with the DN attributes filtered out. Then you run the same CSV file through in update mode with importpass2 and it populates just the DN attributes. It worked really well in my limited tests and I think it is pretty cool but I look forward to the comments from the field… from you guys and gals. Oh I also added an –sc importschema switch that will also be the topic of a future blog entry.

I fixed a couple of bugs, the first was around the GUID## encoding mechanism with the braces. The second is with the –hd switch.

 

Anyway, I hope folks find the changes useful, as always, any bugs or suggestions, email me at joe@joeware.net

 

See the AdFind update info at http://www.joeware.net/freetools/tools/adfind/index.htm

See the AdMod update info at http://www.joeware.net/freetools/tools/admod/index.htm

 

    joe

 

[1] This was a self-preservation change. By far the biggest “AdFind is broken” email I get is due to people querying non-MSFT directories that don’t support paging and currently AdFind uses paging queries exclusively. This is something I have on the list to change someday, but today isn’t that day. ;)  Anyway, this change should make it clear to people why AdFind is not returning data when they query LDAP directory XYZ that doesn’t support paging.

Rating 4.50 out of 5

3/1/2011

Hey where did they get light sabers from?? I want one!

by @ 12:15 am. Filed under humour
Rating 3.00 out of 5

2/28/2011

AT&T iPhone better for media, Verizon better for calls…

by @ 12:14 am. Filed under general

In my review of the Verizon iPhone, I found that its call quality and reliability were superior to that of the AT&T iPhone’s. However, data transfers were significantly slower than AT&T’s, making the AT&T iPhone better for media consumption (watching Netflix, downloading apps, etc.) while the Verizon iPhone is superior for phone calls

 

http://www.wired.com/gadgetlab/2011/02/consumer-reports-verizon/

Rating 3.00 out of 5

2/26/2011

Live the qualities…

by @ 12:32 am. Filed under quotes

This is such a great quote I wanted to post it again. So many parents now a days could really use this basic advice.

 

Your children are profoundly shaped by you, and your actions will resonate, for good or ill, throughout the rest of their lives. Be a parent who lives the qualities, characteristics and values you would like your family to emulate. Let your life be a living example of what you want to see in your children.

    – Dr. Phil  (Chapter 7 Family First)

Rating 4.60 out of 5

2/16/2011

Misery Bear goes to work…

by @ 7:24 pm. Filed under humour

I crack up when I watch the bear entering his password…

http://www.youtube.com/watch?v=5dTHlTu_DC8&

Rating 3.00 out of 5

AdFind is a Trojan according to SonicWALL Gateway Antivirus Service

by @ 1:01 pm. Filed under general

Just received an email that AdFind is being indicated as

Name: (Cloud Id: 4888821) MalUAgent.MIP (Trojan)

by SonicWALL Gateway Antivirus Service.

 

As with my other utilities, AdFind is not malware. In fact AdFind is likely the most benign tool I have available.

 

Don’t take my word for it, check out what http://virusscan.jotti.org has to say…

 

AdFind is not a Trojan SonicWall

 

   joe

Rating 3.00 out of 5

2/15/2011

AdFind Update Status

by @ 8:00 pm. Tags:
Filed under tech, updates

As mentioned in the comment to the release blog entry, the newest released version of AdFind has an issue with LDAP directories that don’t return the supportedControl attribute by default in the standard RootDSE retrieval. If you only use AdFind for Active Directory or ADAM/ADLDS, that is not an issue for you. If you use it to query say OpenLDAP, then that is a problem. Apologies as I don’t do any official testing against the non-MSFT directories though likely I may take up testing against OpenLDAP in the near future since it is freely available and pretty common.

I have a new beta that I am testing now that corrects the issue as well as an additional switch to bypass the check in case there is some other issue that crops up such as a directory that supports paging but doesn’t list it as a supported control. Also since I was looking at the OpenLDAP RootDSE I spent some time to add some decodes for the controls/features/extension OIDs of the OpenLDAP RootDSE. I was trying to work out how to determine the OpenLDAP version from the rootdse but don’t see it right off so likely won’t get that in there. However the directory type will say OpenLDAP now when you query an OpenLDAP directory. For example:

G:\Temp>adfind -hh ldap.testathon.net -rootdseanon

AdFind V01.44.00cpp Joe Richards (joe@joeware.net) February 2011

Using server: ldap.testathon.net:389
Directory: OpenLDAP

dn:
>objectClass: top
>objectClass: OpenLDAProotDSE

Like it does for Windows Directories

G:\Temp>adfind -hh . -rootdse

AdFind V01.44.00cpp Joe Richards (joe@joeware.net) February 2011

Using server: SFMWIN764.test.loc:389
Directory: Windows Server 2008 R2 Active Directory Application Mode

dn:

 

If you want some more coverage in AdFind/AdMod for other non-MSFT directories, let me know. I don’t guarantee anything but I can give it a shot by at least adding the requests to the DCR lists. At a minimum the directory needs to be LDAPv3 and support paging. If you want me to have AdFind identify the directory type, supply the full output of the rootdse so that I can see if there is an identifier to display the proper string. For example, with Windows directories, I parse the supportedCapabilities attribute, for OpenLDAP I used the structuralObjectClass attribute.

Also if you know of any publicly available instances of a given directory type to test against, please let me know. I found a public instance of OpenLDAP at http://blog.stuartlewis.com/2008/07/07/test-ldap-service/, OpenLDAP allegedly has one also at ldap.openldap.org but that doesn’t work for me. I get Server Down both from Wide Open West cable and Comcast cable internet systems.

 

    joe

Rating 3.00 out of 5

2/13/2011

AdFind V01.43.00 and AdMod V01.14.00 Released

by @ 11:45 pm. Filed under tech, updates

The Kleine Schmetterling release of AdFind/AdMod has hit the free tools portion of the web site. I will be back to write up more on the new features and fixes, right now I am going to go to bed, I just spent the last hour fighting with MSFT Expressions Web where it kept crashing on me over and over again so I am not feeling like I want to type much more now. 🙂

 

See the AdFind update info at http://www.joeware.net/freetools/tools/adfind/index.htm

See the AdMod update info at http://www.joeware.net/freetools/tools/admod/index.htm

 

      joe

Rating 4.60 out of 5

2/8/2011

From the mailbag: Expiring a bunch of user accounts immediately

by @ 1:15 am. Filed under tech

I had an email from someone who needed to expire a bunch of userids immediately. They wanted to expire the accounts instead of disabling the accounts because they wanted the change to be “self-documenting” in terms of when it occurred. They also wanted to expire the accounts instead of the passwords because they didn’t want the users to be able to use the accounts and by default, of you expire the password, the user can just change the password, not to mention expiring the passwords wouldn’t be “self-documenting” since when you force a password to be expired you change pwdLastSet to 0. While you could look at the metadata, 90% of your AD admins don’t know that and even still it is more painful and you can’t search on the metadata.[1]

You can easily do this by generating the proper int8 value, searching for the objects with adfind (it was all accounts in a specific OU), and then applying the int8 value to accountExpires attribute of the objects.

Something like

F:\Dev\Current\CPP\AdFind\Release>adfind -enccurrent 0

AdFind V01.43.00cpp **BETA** Joe Richards (joe@joeware.net) February 2011

129416142148710000

 

and then performing the find and replace…

adfind –default –rb ou=disabletheseusers –s one –f objectclass=user –dsq | admod accountexpires::129416142148710000 –unsafe

There is another way of accomplishing this that has one less step and more generic… Just switch to CSV mode and use the *now_int8* expansion variable.

adfind –default –rb ou=disabletheseusers –s one –f objectclass=user –csv | admod –csv –expand accountexpires::{*now_int8*} –unsafe

This will stamp the users in the OU with the current time as of the running of the command.

What if you wanted these accounts to expire in 14 days instead?

adfind –default –rb ou=disabletheseusers –s one –f objectclass=user –csv | admod –csv –expand accountexpires::{*now_int8*:+d:14} –unsafe

Hope that is useful for you. 🙂

 

     joe

 

[1] I will write about this more later I think. There is a new feature in the beta of AdFind that I intend to release in the next week that can put you into a position where you can search on metadata though it won’t be real time…

Rating 4.44 out of 5

[joeware – never stop exploring… :) is proudly powered by WordPress.]