|
|
|
@ -24,19 +24,38 @@ function prompt {
|
|
|
|
|
|
|
|
|
|
'[{0}@{1} {2}]{3} ' -f $username,$computername,$cwd,$delimiter
|
|
|
|
|
}
|
|
|
|
|
function Get-BetterADUser {
|
|
|
|
|
function Get-BADUser {
|
|
|
|
|
param (
|
|
|
|
|
[Parameter(Mandatory=$true,
|
|
|
|
|
Position=0)]
|
|
|
|
|
[string]
|
|
|
|
|
$SearchTerm,
|
|
|
|
|
|
|
|
|
|
[string]
|
|
|
|
|
$Server = $env:USERDNSDOMAIN
|
|
|
|
|
$Server = $env:USERDNSDOMAIN+':3268'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
$filter = 'UserPrincipalName -like "*{0}*" -or Name -like "*{0}*"' -f $SearchTerm
|
|
|
|
|
|
|
|
|
|
Get-ADUser -Filter $filter -Server $Server
|
|
|
|
|
Get-ADUser -Filter $filter -Server $Server @args
|
|
|
|
|
}
|
|
|
|
|
function Get-BADGroup {
|
|
|
|
|
param (
|
|
|
|
|
[Parameter(Mandatory=$true,
|
|
|
|
|
Position=0)]
|
|
|
|
|
[string]
|
|
|
|
|
$SearchTerm,
|
|
|
|
|
|
|
|
|
|
[string]
|
|
|
|
|
$Properties = 'Description',
|
|
|
|
|
|
|
|
|
|
[string]
|
|
|
|
|
$Server = $env:USERDNSDOMAIN+':3268'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
$filter = 'Name -like "*{0}*" -or Description -like "*{0}*"' -f $SearchTerm
|
|
|
|
|
|
|
|
|
|
Get-ADGroup -Filter $filter -Properties $Properties -Server $Server @args
|
|
|
|
|
}
|
|
|
|
|
function Get-Feierabend {
|
|
|
|
|
param (
|
|
|
|
|