-
-
Save darrenjrobinson/26c9ff551eeb35d790c624be0804171b to your computer and use it in GitHub Desktop.
Import LDIF File and Find Active Directory User
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-LDIFUser { | |
[cmdletbinding()] | |
param( | |
[Parameter(Mandatory = $true, ValueFromPipeline = $true)] | |
[array]$LDIFObject, | |
[Parameter(Mandatory = $false, ValueFromPipeline = $true)] | |
[string]$employeeID | |
) | |
if ($LDIFObject.Count -gt 0) { | |
$result = $LDIFObject | Where-Object { $_.objectClass -eq 'user' -and $_.employeeId -eq $employeeID } | Select-Object | |
return $result | |
} | |
else { | |
"LDIFObject Array Empty. Nothing to search for with employee ID: '$($employeeID)'." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment