Alan's Blog

"Yeah. I wrote a script that will do that."

Menu
  • About My Blog
Menu

A GUI Select of Properties for PowerShell Scripts

Posted on November 22, 2014May 14, 2016 by Alan

Updated Version, with pipeline support is here.

I have been writing a number of reporting and audit scripts where there are a lot of potential properties that the user might want in the log file or report.  It is hard to guess what items that they want in their report or in what order that they want them to appear.   Select-PropertiesForm.ps1 was written to satisfy this need.  I had a copy of the SAPIEN Technologies PrimalForms Community Edition which did the heavy lifting for the form.  An example with the properties of a Nessus file looks like this:

Select-PropertiesForm

The script takes the object as a required parameter and the title as an optional parameter.  An example for AD User data:

#Example: Have user choose fields from Get-User
$obj = get-aduser -Filter ('sn -eq "Smith"') -properties *
#Call the Function with object as parameter
$Selected =Select-PropertiesForm $obj
$obj | select -Property $Selected |
Out-GridView -Title "User Info"

The user can move one or more objects between columns with the buttons.  When they are satisfied, Accept List passes the selection of properties as an array which can be used by Select-Object.

Script Text

Leave a Reply

You must be logged in to post a comment.

Search

Please Note

All the scripts are saved as .txt files. Newer files have a “View Script” button which will let you save or open a script in notepad. For earlier posts, the easiest way to download with IE is to right click on the link and use “Save Target As”. Rename file from Name_ext.txt to Name.ext.

To see a full post after searching, please click on the title.

PowerShell Scripts were written with version 3 or later.

https connections are supported.

All new users accounts must be approved, as are comments. Please be patient.  If you find a post error or a script which doesn’t work as expected, I appreciate being notified.  My email is my first name at the domain name, and you are welcome to contact me that way.

Tags

1E ACLS Active Directory ActiveDirectory ADSI Advanced Functions Audit Change Administrator Password COMObject Computer Groups DateTime Desktop DNS Excel FileScriptingObject Forms General GPO GPS Group Policy Hacks ISE Lockout logons NAV740 Nessus OU OU permissions Outlook Pick Folder Power PowerShell Powershell Scriptlets RDP SCCM schedule reboot Scripting Security Shell.Application user information VBA Windows Update WMI WordPress WPF

Categories

akaplan.com

  • Back to Home Page

Archives

Scripting Sites

  • A Big Pile of Small Things
  • Adam, the Automator
  • Art of the DBA
  • Ashley McGlone
  • Boe Prox
  • Carlo Mancini
  • DexterPOSH
  • Doug Finke
  • Jaap Brasser's Blog
  • JeffOps The Scripting Dutchman
  • Jonathan Medd's Blog
  • Keith Hill's Blog
  • LazyWinAdmin
  • Nana Lakshmanan
  • PowerShell Magazine
  • PowerShell Team Blog
  • PowerShell.org
  • PwrShell.net
  • Richard Siddaway's Blog
  • Ryan Yates' Blog
  • Skatterbrainz
  • The Lonely Administrator

SQL Site

  • Art of the DBA

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2025 Alan's Blog | Theme by SuperbThemes

Terms and Conditions - Privacy Policy