Monday, June 29, 2009

Bulk Changes with PowerGUI

In this article we will find users who's names start with letter “H” and we will make some bulk changes on these users by using PowerGUI and power shell….

First open PGUI and use build in container Active directory and click on users as shown below.

image

Now  use filters to capture the HR users

image

Click Apply and results are here

image

on right pane there are set of functions, 

image

All you need to do is pick one and you will make the bulk changes. Now I am sure you are convinced how easy to use PowerGUI, how about the PS script got executed in the background, and did the actual work, would it be nice if you could see that so that you would try to understand the PS script itself.

Fair enough on the bottom of the PowerGUI click PowerShell code

image

As you see the last line is the PS code provided desired results

image

Now copy and paste this into PGUI script editor

| where { $_.'DisplayName'  -like  'H*' } | Select-Object -property 'Name', 'Type', 'DN'


image

This is not going to produce the same results as we are missing the very first piece of the PS Code, go back to PSC ( code) GUI,

Take a look at the starting line, to see the PS starting codeimage

now copy this and paste into PGU Script editor combining with first one


Get-QADUser



Get-QADUser |where { $_.'DisplayName'  -like  'H*' } | Select-Object -property 'Name', 'Type', 'DN'


image

click on Run

image

You get the same results

image

Now you got the idea you don’t have to know PS to make it work, all you need is PowerGUI (-:, as you see PowerGUI is incredible easy to use and very useful to learn the PS.

Now you can be more creative and use same simple technique go back to PGUI,  find the folder you created,

  • New
  • Script node
  • paste the same code there

image

Give it any name you like

 

image

Now you have your special query picking up users who's name is starting with letter “H”

image

 

PS is fairly simple to learn if you have the right tool, PG is one of the best tool out there and makes life easy so go download the PGUI if you have not done it and register the forums to ask any question you wish to experts to help you out, once you start hanging to it I recommend buying a PS book and start getting deep into it

I don't have a recommended book yet (-: as soon as I find out one, I will be happy to share with you the name of the book ……

All credits goes to PowerGUI (-:

image

Oz Casey Dedeal,

MVP (Exchange)
MCITP (EMA), MCITP (SA)
MCSE 2003, M+, S+, MCDST
Security+, Project +, Server +

Http://smtp25.blogspot.com (Blog)

Https://telnet25.spaces.live.com (Blog)

Https://telnet25.worldpress.com (Blog)

No comments: