Search code examples
active-directoryactive-directory-group

How to get the AD of current user


We are building an intranet for our client and we need to display certain information for certain users. Preferably we want to do this with knowing which AD the user belongs to.

Is there any easy way of getting the AD information of the user?


Solution

  • Typically you already know the Active Directory server, I'm not sure if your asking for a way to discover which AD server they are connected to, or if you want to query the AD server for information. To discover, here's a link that describes a number of methods to Find a Domain Controller

    If you want to query the AD server, you need an authorized user account with the LDAP server (bind account), then you can query pretty much everything in the AD server for a user. Some of the things you can get are Groups the user belongs to, various permissions, etc.