Showing posts with label PowerGUI. Show all posts
Showing posts with label PowerGUI. Show all posts

Tuesday, July 7, 2009

How to Create Custom Address List from Contacts with PowerGUI

Here is the scenario, you are asked to create custom address list from available contacts on the GAL based on specific e-mail addresses.

New-AddressList -Name GmailContacts -RecipientFilter {(ExternalEmailAddress -like '*@Gmail.com')}

Click here to download it

image

As soon as you run this within the PowerGUI SE

image

image

image

Now lets make sure the Address list is providing what we wanted

Double Click and Preview

image

As we can see all Contacts start with @Gmail.com is in the address List already,,,,It is pretty easy and usefully

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)

Scheduled task PowerGUI, E-mailing PS Scripts is very easy…..

Now one of the most asked question how do I get this nice report (PS Script) e-mailed to distribution group with scheduled task, we have touched base on this in the past but we will go over one more time.

If you are not a scripting person this post is perfect for you, if you never script anything in your life you are reading right article, I am sure PowerGUI will make you love PS scripts keep reading,,,,,

but first download PowerGUI (-:

The PS script is uploaded on my skydive for you to download

image

After downloading the PS script open with PowerGUI Script editor

image

Now don't forget to change the mail serve name to your own and click on the green arrow to run it

  • Verify the output as below
  • User Name       : Temp11
  • Department      : Temp Employee Office
  • Storage Group   : MAIL2\SG2\SG2-MB1
  • Total Size (MB) : 0
  • itemCount       : 10

 

image

Perfect now we need to add into PSCode a little bit, at the end of last line I will start typing Pipe and export as you see below

image

just because PowerGUI is very hand and smart it is already start helping me, by showing me the possible PS commands associating with export command, this is incredible useful and easy to learn, as you see there is another sub menu help window opened up helping me for my next command which will be “path”

image

If you loose this point your curser back to end of the command the window will re populate for you, same nice future continues to help as shown below

 

image

I finish as fallows

  • |export-csv -Path c:\report\UDSTI-Report.csv

image

after running the script I go back to my script folder to make sure the CSV file is in there

image

Here is my report

image

Now you have the report all you need to do is to run another script to e-mail this to yourself or a DL which is listed here

Send Mail With Attachment Using PowerGUI

image

one you get this working any report you wish to generate will be easy task for you.

As always all credits goes to PowerGUI, if you have not played with PowerGUI , click below link to download and start becoming PS master (-:

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)

Wednesday, July 1, 2009

PowerGUI, Get-Mailbox DisplayName,Department,StorageGroup,TotalSize (MB),ItemCount

We wanted to include item count into previous PS Script and here is the new version of it , enjoy

image

image

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)

PowerGUI, Get-Mailbox DisplayName,Department,StorageGroup,TotalSize (MB)

One of the question was asked how to get the information about usermail boxes , Storage Groups and the AD Attribute Department all together.

In previous posts we have already covered how to make any PowerGUI script to be e-mailed via windows scheduled task so this query also will be very handy.

Click here

image


Get-Mailbox -resultsize unlimited | select @{Name="User Name";expression={$_.displayname}},@{Name="Department";expression={(get-user $_.alias).department}},@{Name="Storage Group";
expression={$_.database}}, @{Name="Total Size (MB)";expression={(get-mailboxstatistics $_).totalitemsize.value.toMB()}}

 

image

 

image

 

 

image

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)

Tuesday, June 30, 2009

PowerShell at the tip of your browser By Shay Levy

Shay Levy has a great Power Shell browser toolbar using Conduit community toolbars. It is incredible useful , will take you tons of resources with a single click…..

here is his blog and link to download it

 

image

 

image 

best,

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)

Monday, June 29, 2009

Hot Dog without ketchup PowerShell Without Power GUI (-:

Beside joke, the reality is that Power GUI and PG Script editor  are such a powerful tools, I cannot imagine not having them a side and using PowerShell (-: without it.

Now we will have scheduled job and one of the reports we did generate by using PowerGUI to e-mail to us everyday. Once you get this down you can have any reports to be e-mailed to a group or yourself.

Step one

Open PowerGUI and bring up the mailbox report script we have done on the previous article, click below to download it

image

Now go to your C drive and create folder called “PSScript” or anything you wish to call

image

Open Command line, go to came directory,  copy and paste below


powershell -command "& {C:\PSScript\MailBoxReport.ps1}"

 

image

When you hit enter you get command prompt back

image

Now open your e-mail to make sure it worked

image

Remember when you download the script you need to change the from to address and so forth just read the comments in the script

  • Now let’s create the .BAT file which will execute the MailBoxReport script
  • Open notepad in the same directory
  • Copy and paste the same command

powershell -command "& {C:\PSScript\MailBoxReport.ps1}"

image

  • Do not forget to put Quotes beginning and ending otherwise you will end up having TXT file (-: instead of batch file

To test it double click on it

image

Go back to outlook and verify again you got the mail

image

Almost done

All you need to do is to use scheduled task and define how many times you want the report (-:

I recommend using DL to sent these e-mails and adding people who should see these type of information every day.

I am going to continue to keep posting creating different type of reports and as you can imagine you can PS script the entire AD and Exchange so easy with POWER GUI (-:

All credits again goes to POWER GUI it is incredible  amazing tool , I am loving it more every other day (-:

 

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)

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)