Active Directory is one of those Microsoft tools that so many have no choice but to use. Although I much prefer LDAP because it is so much easier to set up and manage. But for much of the enterprise world Active Directory is the tool used. Does this mean you are locked into managing Active Directory from a Windows machine? No. If you are a creature of the command line you can manage your AD from the Linux command line. It's not that difficult and, in the end, will give you many more options to keep your AD server managed.
Of course it is not just a matter of working on the Linux end of things. There is one issue to settle on the MS end. You have to activate Secure LDAP on your AD Server. This process goes beyond the scope of this article, but the steps are pretty clear.
Here are the steps to enable Secure LDAP on your Windows 2003 AD server (I will leave out the details):
Fortunately adtool will be found in your distributions' repositories. So all you have to do is follow these steps:
This is a bit of configuration you need to handle before you can use adtool on your AD server. First create the file (if it doesn't exist) /etc/adtool.cfg and add the following contents:
Where YOUR.DOMAIN.HERE is the actual address to your Active Directory server.
Where PASSWORD is the password for the AD user that has proper permissions to manage the AD server.
You will also need to make sure the following is in your /etc/ldap/ldap.conf file:
Without the above configuration you will not be able to accept the SSL certificates from the server.
The basic usage of the adtool command is simple. Of course you will have to understand Active Directory in order to really understand the usage of this tool. Below I will give you samples of commands to handle the basic tasks for AD. Any information in ALL CAPS would be altered to fit your needs.
Create a new organizational unit:
adtool oucreate ORGANIZATION NAME ou=user,dc=DOMAIN,dc=COM
Add a user:
adtool useradd USER ou=ORGANIZATION ou=user,cd=DOMAIN,dc=COM
Set a user password:
adtool setpass USER PASSWORD
Unlock a user:
adtool unlock USER
Create a group
adtool groupcreate GROUP ou=user,cd=DOMAIN,dc=COM
Add a user to a group:
adtool groupadd allusers USER
Add an email address for the user:
adtool attributereplace USER mail EMAIL@ADDRESS
We've only really scratched the surface of this powerful tool. But from this you should be able to see how easy adtool can be as well as how helpful it is.Advertisement
Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.