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)

No comments: