How to retrieve Data (such as Department, Role or Manager) from the Active Directory by using BeanShell or other method?

Thanks.