How to get user details out of Active Directory?

Microsoft Windows
Post Reply
Simon_Weel
Posts: 36
Joined: 2021-Dec-13, 3:53 pm

How to get user details out of Active Directory?

Post by Simon_Weel »

I have a script to setup Outlook for new users. One of the things it does is 'installing' signature files. There's another topic on this in this forum.
One of the things we have in our signatures is the Job Title. And I'm trying to figure out how to extract that from AD. It's a breeze with Powershell, but I'm not very familiar with Powershell. It looked like ADQuery and ADGet could be a solution, but they require RSAT tools installed on the machine where those commands run. Copying them (including any auxiliary files) from the server to a share on the network and use them from there doesn't seem to work. Nothing happens when ADQuery is run from that share, not even an error.
Had a look at WMIC and although it does list quite some user details, the Job Title is not one of them.
So I wonder if there's some tool around to get all the user details?
User avatar
Simon Sheppard
Posts: 191
Joined: 2021-Jul-10, 7:46 pm
Contact:

Re: How to get user details out of Active Directory?

Post by Simon Sheppard »

If you don't want to install RSAT, then I would use VBScript, heres a sample script you can modify to return other properties:

Search
https://ss64.com/vb/syntax-ad.html

for current user
https://ss64.com/vb/syntax-userinfo.html

LDAP properties
https://ss64.com/ps/syntax-ldap.html
Simon_Weel
Posts: 36
Joined: 2021-Dec-13, 3:53 pm

Re: How to get user details out of Active Directory?

Post by Simon_Weel »

Cool! The script for the current user does it all - full name, e-mail address and job title! Thanks!
Post Reply