Applies to: All versions of Centrify DirectControl
Question:Is there a command line way of getting the current OU or Container that a Centrify-joined computer is located in?
Answer: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:
domain.com/Testing 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$