Tips for finding Knowledge Articles

  • - Enter just a few key words related to your question or problem
  • - Add Key words to refine your search as necessary
  • - Do not use punctuation
  • - Search is not case sensitive
  • - Avoid non-descriptive filler words like "how", "the", "what", etc.
  • - If you do not find what you are looking for the first time,reduce the number of key words you enter and try searching again.
  • - Minimum supported Internet Explorer version is IE9
Home  >

KB-3127: Getting the OU or Container of a Centrify-joined computer via command line.

Authentication Service ,   Mac & PC Management Service ,  

12 April,16 at 11:09 AM

Applies to: All versions of Centrify DirectControl


Is there a command line way of getting the current OU or Container that a Centrify-joined computer is located in? 


The adquery command can also be used to query computer objects as well and is able to return this information.

For example, if a Mac machine with the hostname "test-mac" is located in the "/Testing OU/Mac Computers/" OU, then the command: 
  • adquery user -C test-mac$

Will return the canonical name: OU/Mac Computers/test-mac 

Alternatively, the distinguished name can also be queried for as well:
  • adquery user -D test-mac$

Returns: CN=test-mac,OU=Mac Computers,OU=Testing OU,DC=domain,DC=com 

The variable $HOSTNAME could also be substituted into run the commands without specifying the hostname directly:
  • adquery user -C $HOSTNAME$
  • adquery user -D $HOSTNAME$
User-added image

Related Articles

No related Articles