Powershell GUI fronted (WPF) to run categorized console scripts

⌈⌋ ⎇ branch:  ClickyColoury


Artifact [5c7be413a1]

Artifact 5c7be413a159eaf42bbe7adac5c14ed5bfffe84a:

  • File tools/bulk/FilterUserSearch.ps1 — part of check-in [09ab7c0a65] at 2018-05-16 18:13:53 on branch trunk — AD search for user properties, with a few (unpractical) sample -Filters. (user: mario size: 1655)

# encoding: utf-8
# api: multitool
# category: bulk
# title: -Filter user search
# description: queries AD users by filter, generate list as table/csv
# version: 0.1
# vars:
#    {
#       name: filter,
#       type: select,
#       select: '(office -like "*Oxford*")|(l -like "*France*")|(division -eq 32156)|(description -like "*finance*")|(company -like "*Google") -and (department -like "Engineering*")'.
#       description: "-Filter attributes or properties. Use -like and * for fuzzy search, or -eq for exact matches. Multiple attributes can be combined with -and / -or, or wrapped in parens."
#    }
#    { name: display, type: select, select: "Format-Table|ConvertTo-Html|Out-GridView|Format-List|Export-CSV", description: "How to output result list." }
#    { name: export_fn, type: file, description: "Filename for Export-cSV" }
#    {
#       name: props,
#       type: select,
#       select: "SAMAccountName Name EmailAddress|SAMAccountName Name EmailAddress Manager EmployeeType Company Description L Enabled AccountExpirationDate",
#       description: AD fields to list
#    }
# icon: user
# type: inline
# depends: psm:ad
# priority: experimental
#
# Shortcut for Get-ADUSer -Filter
# A few sample filters in combobox prepared.
# Outputs either list, table, or saves to CSV file.
#

Param(
   $filter = (Read-Host "filter"),
   $display = (Read-Host "display"),
   $export_fn = (Read-Host "export_fn"),
   $props = (Read-Host "props")
)


#-- find
$results = Get-ADUser -Filter $filter -Prop * | Select ($props -split "\W+")


#-- output
Out-DisplayDispatch $result $display $export_fn