Add user search to PowerGUI

Here’s a PowerShell tip I wanted to share for quite some time: making PowerGUI search for a user for you rather than displaying all users in the grid and then making you scroll down to find the account you need (for example in a helpdesk scenario when you need to unlock an account or reset password for someone calling you):

A node in the PowerGUI tree prompting you for a user name, email address, or some other identifier

A node in the PowerGUI tree prompting you for a user name, email address, or some other identifier

Once you type something about the user (name, partial name as in the screenshot above, email address, office location, SID, GUID, login name) you get the account (or list of accounts) which the search would return.

Here’s how you add a node like that:

  1. In PowerGUI, right-click the place in the left-hand tree where you want to place the functionality,
  2. On the shortcut menu, select New / Script Node.
  3. Supply the name and code for the node:
Adding the Find node

Adding the Find node

Here’s the code which I use:

# Locate a user account
$user = Read-Host "Who do you want to find today?"
Get-QADUser $user

Now you (or your helpdesk) will be able to find the objects they need much faster!

Tags: , , , , , ,

0 Responses to “Add user search to PowerGUI”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




My Recent Tweets

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

April 2009
M T W T F S S
« Mar   May »
 12345
6789101112
13141516171819
20212223242526
27282930  

%d bloggers like this: