diff --git a/profile.ps1 b/profile.ps1 index a106057..4aa8776 100644 --- a/profile.ps1 +++ b/profile.ps1 @@ -19,7 +19,20 @@ function prompt { '[{0}@{1} {2}]{3} ' -f $env:USERNAME.ToLower(),$env:COMPUTERNAME.ToLower(),$cwd,$delimiter } +function Get-BetterADUser { + param ( + [Parameter(Mandatory=$true, + Position=0)] + [string] + $SearchTerm, + [string] + $Server = '{0}:3268' -f $env:USERDNSDOMAIN + ) + $filter = 'UserPrincipalName -like "*{0}*" -or Name -like "*{0}*"' -f $SearchTerm + + Get-ADUser -Filter $filter -Server $Server +} #check for old version