LDAP Custom Query

WellingtonIS
WellingtonIS used Ask the Experts™
on
I'm looking for an LDAP Custom Query to show the employee number.  I started with this but no good
LdapObjectType::USER(&(objectClass=user)(objectCategory=person))int employee number

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Michael B. SmithManaging Consultant

Commented:
There isn't an LDAP attribute named "employee number" in Windows Active Directory.

So tell us more about what you actually want and need...

Author

Commented:
I have an employee ID field in my attributes, I was trying to pull it out to display the number in my AD settings. If I can't then I'll have to live with it.
Jeff GloverSr. Systems Administrator

Commented:
If you are using the EmployeeID field, you need to Call that attribute "EmployeeID"
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
OK will try thanks
Managing Consultant
Commented:
If you are using Get-AdObject

Get-AdObject -LdapFilter "(&(objectClass=user)(objectCategory=person))" -prop employeeId | select samAccountName, employeeId

Open in new window

Shaun VermaakSenior Consultant
Awarded 2017
Distinguished Expert 2018

Commented:
(&(objectClass=user)(objectCategory=person)(employeeID=123))

Open in new window

Author

Commented:
No it's an employee number field this is what I'm trying to pull out
employeenumber.png
Shaun VermaakSenior Consultant
Awarded 2017
Distinguished Expert 2018

Commented:
(&(objectClass=user)(objectCategory=person)(employeeNumber=123))

Open in new window

Author

Commented:
thanks but it didn't pull anything.  The query is blank
Michael B. SmithManaging Consultant

Commented:
So? What is the query engine?

@Shaun showed you the generic answer and I showed you the MSFT AD answer. Which is it?

Author

Commented:
Actually none of them worked so I had to go with 1:Get-AdObject -LdapFilter "(&(objectClass=user)(objectCategory=person))" -prop employeeId | select samAccountName, employeeId  I changed a few things but I got what I needed.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial