|
|
|
@ -36,17 +36,22 @@ function prompt {
|
|
|
|
|
function Get-BADUser {
|
|
|
|
|
param (
|
|
|
|
|
[Parameter(Mandatory=$true,
|
|
|
|
|
Position=0)]
|
|
|
|
|
[string]
|
|
|
|
|
Position=0,
|
|
|
|
|
ValueFromPipeline)]
|
|
|
|
|
[string[]]
|
|
|
|
|
$SearchTerm,
|
|
|
|
|
|
|
|
|
|
[string]
|
|
|
|
|
$Server = $env:USERDNSDOMAIN+':3268'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
$filter = 'UserPrincipalName -like "*{0}*" -or Name -like "*{0}*"' -f $SearchTerm
|
|
|
|
|
process {
|
|
|
|
|
foreach ($term in $SearchTerm) {
|
|
|
|
|
$filter = 'UserPrincipalName -like "*{0}*" -or Name -like "*{0}*"' -f $term
|
|
|
|
|
|
|
|
|
|
Get-ADUser -Filter $filter -Server $Server @args
|
|
|
|
|
Get-ADUser -Filter $filter -Server $Server @args
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function Get-BADGroup {
|
|
|
|
|
param (
|
|
|
|
|