Hi @Glenn Maxwell ,
Please try something like this:
Get-ADUser -Filter "EmployeeID -eq 12345" -Properties * | select -property EmployeeID,DisplayName,Title,userprincipalname
Please upvote or accept as answer if it helped.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi All
i have 5 employee ids, i want to know whether they exists in AD or not. experts guide me how to pull the information.
12345
12346
12347
12348
12349
if i use the below syntax i believe it gives me all the employee ids but i dont want all.
Get-ADUser -Filter * -Properties *| select -property EmployeeID,DisplayName,Title,userprincipalname
Hi @Glenn Maxwell ,
Please try something like this:
Get-ADUser -Filter "EmployeeID -eq 12345" -Properties * | select -property EmployeeID,DisplayName,Title,userprincipalname
Please upvote or accept as answer if it helped.
Hello there,
Here's one quick way:
([ADSISearcher] "(sAMAccountName=kendyer)").FindOne()
If it returns no results, the user account was not found.
As a function:
function Test-ADUser {
param(
[Parameter(Mandatory = $true)]
[String] $sAMAccountName
)
$null -ne ([ADSISearcher] "(sAMAccountName=$sAMAccountName)").FindOne()
}
------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer–