Using DSCL to troubleshoot directory issues
There is a very useful command in terminal that can be used to help troubleshoot machines that are tied to a directory, called the DSCL command. This command allows you to create, read and manage Directory Service data.
I use DSCL to run a simple test on a Mac’s Directory connection, by navigating to a Directory folder (e.g. cd Active Directory/All Domains/Users) and if I’m not presented with an error message, then my Mac can successfully talk to the directory system it is connected to.
If you open the Terminal (Applications>>>Utilities) and type man dscl it will give you a manual of what DSCL is and what it does as well as other useful commands within the interactive DSCL mode.
Once you have read the manual for DSCL we can begin to use it, start by launching Terminal again and type dscl then press enter / return.
You have now entered interactive mode and can now start to work your way through the directory.
Type ls – this will show all the directories that the machine is bound to e.g Active Directory, Open Directory, if neither, then simply local.
Select the directory you wish to enter by typing cd and then begin to type your directory exactly as it was stated previously in terminal e.g with capital letters, then press the tab key and it will auto-fill (in this example I have chosen Local as my machine as it is not bound to any directory)
Once you have selected your directory again type ls – this will show the next category, keep going until until you get to a point where there are multiple options shown and you can begin to see the awesomeness that is DSCL!