Carpe Diem: Flaphead@Home

seize the day
Welcome to Carpe Diem: Flaphead@Home Sign in | Join | Help
in Search

Browse by Tags

All Tags » PowerShell » MsExchange
  • Update-ConfigFiles.ps1

    So inlight of RU5 I thought I would share this with you.  So we know the issue with the .net framework and the Certicate Revokation List. This script updates the Exchange 2007 .config files inline with 944752: Exchange Server 2007 managed code services do not start after you install an update rollup for Exchange Server 2007 It will add the ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on November 24, 2008
  • Update Rollup 5 for Exchange Server 2007 Service Pack 1 (KB953467)

    The whole universe knows by now that RU5 for Exchange 2007 SP1 has hit the streets. You can download it here: http://www.microsoft.com/downloads/details.aspx?FamilyID=652ed33a-11a1-459c-8ffe-90b9cbfe7903&DisplayLang=en Ninob over at the Exchange team blog says that it will be out via Microsoft Update in the next few weeks.  He also ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on November 24, 2008
  • Send-Mail.ps1 v3.2 [7 November 2008]

    v3.0 6 August 2008     : Removed the GUI form the original scriptv3.1 22 August 2008 : Updated to ''autofind'' a hub server if -server is not specifiedv3.2 7 November 2008 : Some minor tweeks. Added event logging.Added Error Event loggingThis script uses .net (System.Net.Mail.MailMessage) to send an ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on November 19, 2008
  • get-hotfix.ps1 v1.5 [7 November 2008]

    Okay I have updates as follows: v1.0 27 October 2008 : A Script is bornv1.1 28 October 2008 : Add ability to expose Server Modelv1.2 31 october 2008 : Added email and commandline v1.3 4 November 2008 : Added option to check recent changesv1.4   6 November 2008 : Days commandline ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on November 19, 2008
  • CAS vdir restore using PowerShell

    Wow is all I have to say, this is a damm excellent article and script .. check it out: http://technet.microsoft.com/en-us/library/bb124359.aspx Basically, it's a script that will recreate your owa virtual directories from a previous xml export! ..I just added a comment .. to create the export run:Get-ClientAccessServer | Get-OwaVirtualDirectory ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on November 18, 2008
  • Get-MailboxStatistics with TotalItemSize in MB to a CSV file

    Just ignore this, I wanted to store this code snippet somewhere and this was the best place.  But if you are interested this will create a csv file from Get-MailboxStatistics, but with the TotalItemSize in MB ''DisplayName,TotalItemSize(MB),ItemCount,StorageLimitSize,Database,LegacyDN'' | out-file GMS.csv; get-mailbox -resultsize unlimited | ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on November 14, 2008
  • Powershell and where

    Another thing I wanted to share.  If you want to say Get-MailboxServer but only want a subset of server you could try this: Get-MailboxServer | Where {$_.Name -LIKE ''*Serv01'' -OR $_.Name -LIKE ''Ex*NYC*''} Enjoy
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on November 14, 2008
  • Scheduling a Powershell Command

    Just wanted to share this with you all. So I have a number of scripts that I schedule to run either every 10 min, once a day or once a week.  It's simple really, I create .cmd file that I then use the task scheduler or schtasks to create.  Inside the .cmd file I have this: powershell c:\ps\Test-ExchangeServers.ps1 -localhost -testsmtp ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on November 14, 2008
  • Exchange Powershell and Whatif

    So I have been creating a few scripts to automate the configuration of exchange, and wanted to use the -WhatIf switch so you can see what would or would not change. -WhatIf [<SwitchParameter>]The WhatIf parameter instructs the command to simulate the actions that it would take on the object. By using the WhatIf parameter, you can vi ew what ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on November 14, 2008
  • Get-Hotfixes.ps1 v1.4 [7 November 2008]

    This script uses Get-ExchangeServer to generate a list of  servers and will enumerate the Exchange Patch information and list the windows updates installed on the server.  This update changes the way the server list is generated and added the ability to check cluster nodes COMMANDLINE OPTIONS-EMAIL .......... Send an Email-Localhost ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on November 7, 2008
  • schtasks

    I mentioned this before as a way to script adding tasks to a server.  So I came across an issue the other day, where I ran it once, but then it failed on the second time: ERROR: Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on November 7, 2008
  • Get-AllQueuesGUI.ps1 v1.5 [24 October 2008]

    A while back I posted this , but to have something more ''in your face'' I put a GUI around it, and this is the latest version. The script enumerates all messaging queue and displays it in a GUI. The GUI then refreshes every 10 seconds.THE GUI has four tabs: QueueDisplay the current queue MessageDisplays messages in the queue Top 5 Q’sThis ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on October 31, 2008
  • get-hotfix.ps1

    I needed to get a quick list of the hotfixes installed on my Exchange 2007 servers. So I “knocked” this up ..  enjoy
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on October 27, 2008
  • TechNet Webcast: 24 Hours of Exchange Server 2007 (Part 08 of 24): Introduction to Windows PowerShell (Level 200)

    At last I think I have cracked it so I can download these TechNet Webcasts as a video podcast to my Zune!Will post more as I get round to it, but here is the first one! .. Enjoy .. the RSS is: ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on October 22, 2008
  • Setting Exchange mailbox size limits on a group

    WHAT! I hear you say, you can't do that! .. Very true, but you can automate it ;-) using the wonders of Powershell Exchange 200x First you will need to use adsiedit.msc and get the groups distinguishedName.  Once you have that, using an account that has access to over the users AD objects you run this code: $mygroup = ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on October 20, 2008
  • Get-ExchangeADChanges.ps1

    So I  needed a way to check what has changed in the Exchange Configuration container … basically if something stopped worked ;-) So I came up with this.  I run it once a week, and it checks for changes in the last 7 days. It has one command line option and that is –email to email the results ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on October 8, 2008
  • Exchange 2007 SP1 Powershell Commands

    This is kinda interesting .. honest .. Did you know there are 394 Powershell command with Exchange 2007 SP1.  But thats not intersting, the table below is!  So the AD and Server build boys said … no mate, you can’t have local admin rights to your exchange server?  Kewl I said you guys can manage it then, as with out it we can’t do ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on September 24, 2008
  • Enable-ServiceEmailChannel

    Everyday is indeed a School Day and I had never come across this command util today!  The .NET service channel is introduced in Microsoft Exchange Server 2007 Service Pack 1 (SP1). This channel enables Exchange Server 2007 to store information that it will later forward to applications or devices that are not permanently connected to the ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on September 24, 2008
  • Get a list of scheduled tasks running on your exchange servers

    This is a handy little check.  If you want to see what scheduled tasks are running on your Exchange 2007 servers try this: Get-ExchangeServer | foreach-object{$srv=$_.Name.ToString(); write-host ''`n`n$srv''; schtasks /s \\$srv /query} Enjoy
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on September 15, 2008
  • Findout who is logged on to a server

    Has a problem today where I couldn't RDP to an Exchange 2007 server ... so knocked this up ;-)  Get-ExchangeServer | foreach-Object {write-host $_.name; quser /server:$_}
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on August 27, 2008
  • Exchange 2007 Mailbox Server Role Storage Requirements Calculator

    I am sure you all know there is a new Storage Calculator out in the wild not, ver 15.6 I have downloaded and read the article and found a need to pass this script on to you all.  Basically about half way down is a link to Collectlogs VBS script Come on! a VBS .. must be able to do that in PowerShell ;-) .. Well you sure can, and here is ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on August 26, 2008
  • Exchange 2007: Offline Address Book

    So been automating some global configuration in Exchange 2007 today and wanted to share this.  I need to enable web distribution of the oab and couldn't find the Powershell ''check box''.  But cracked it.  You need to just populate the VirtualDirectories entry and it ''checks'' the Enable Web-bases distribution. The cheat was ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on August 20, 2008
  • Get-AllQueuesGUI.ps1 v1.4

    Update to this script too, basically a change from using Get-ExchangeServer in places to Get-TransportServer.  Also add a size column to the message tab. It will also log data to c:\ps\logs\<datefolder> Let me know what you think ;-)  
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on August 7, 2008
  • Get-AllQueues.ps1

    So another script .. This is actually a one liner but this is an easy wrapper.  The one liner is: Get-TransportServer | Get-Queue
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on August 7, 2008
  • Dump-Help.ps1 v1.0

    Recreation of an old script.  Basically this will run get-help for all commands and output it to c:\ps\help .. I like it ;-) ######################################################################################### $AppName = ''Dump-Help.ps1'' $AppVer  = ''v1.0 [7 August 2008]'' #v1.0 6 August 2008 : A script is Born # #This script ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on August 7, 2008
  • Get-ExchangeServerPLUS.ps1 v1.14

    Damm, has this script grown up recently. In a nut shell, this is the daddy of all scripts and gathers chunks of information from the Exchange Organisation and each Exchange Server by using a mixture of WMI, .Net and Exchange 2007 Powershell commands. The script can be run for just one server, by appending an server name to the command or with no ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on July 30, 2008
  • How to disable the "Sent by Microsoft Exchange Server 2007" branding sentence in an Exchange Server 2007 DSN message

    So Anderson posted this, and my initial thought was huh?  The KB didn't really explain either, so it was time for a test.  So the KB will allow you to remove the circled text below: And it's a nice simple PowerShell Command: Set-TransportConfig WritingBrandingInDSNEnabled $false But you do need to have Exchange 2007 SP1 with RU3
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on July 23, 2008
  • Exchange 2003 and Windows Powershell

    I just have to share this with you, as I was quite impressed by how quick I knocked this script up.  Basically I wanted to see how much email was queued up on my Exchange 2003 servers.  I had a feeling that a WMI object existed so I ran scriptomatic on a server a behold under root\MicrosoftExchangeV2 was Exchange_SMTPQueue. So the rest ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on July 3, 2008
  • Powershell Warnings

    Do you know how sometimes you write a script and the output looks lovely, but for some stupid reason a yellow warning message ruins it. Well my school day learning from today is that you can turn them off! So lets say I run this [PS] C:\PS>get-mailboxdatabase -server ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on June 3, 2008
  • Version 5 of the Mailbox Size Gui Script for Exchange 2007

    The king of exchange powershell scripting .. so here is v5 of the awesome mailbox size gui script by Glen.  This time he has added mailbox growth history.  Check it out and download it! http://gsexdev.blogspot.com/2008/05/version-5-of-mailbox-size-gui-script.html
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on June 2, 2008
  • get-PerfCounters.ps1

    I wrote this a while back, and just blew the dust off it. Meet get-PerfCounters.ps1  Basically you feed the script a csv file that has ''ServerName'' on the first line the first. The script will then loop the servers and get the following perf counters System\System Up TimeMemory\% Committed Bytes In UseMemory\Committed BytesMemory\Commit ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on May 23, 2008
  • Exchange Management Shell: TFM (eBook)

    Off the back of Eileen's post, I just couldn't resist a new ebook. So Exchange Management Shell: TFM is a 386 page secured! PDF document, with the last 8 being adverts for Sapien Press!.  The secured bit is a a major pain in the butt as you can't copy from the PDF doc.  So a PDF ebook, that has code snippets becomes kind like a paper ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on May 22, 2008
  • Exchange 2007 Messaging Tracking

    This is an interesting one I found.  We set Message Tracking on out Hub Role servers so it would purge the logs after 30 days .. nice and simple.  MessageTrackingLogEnabled               : ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on April 4, 2008
  • Exchange 2007 / Outlook 2003 / Blackberry & OoO

    I saw Andy posted this (http://telnetport25.wordpress.com/2008/03/16/quick-ish-tip-exchange-2007-setting-oof-for-users-via-powershell-2/) today and wanted to share my script. It uses the same dll from Glen(EWSOofUtil.dll) to open the specified users mailbox and Enable/Disable a users Out Off Office Setting. This in theory fixes an Issue with ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on March 28, 2008
  • Get-MSXBackupStatus.ps1

    So this is a script I knocked up to make sure Exchange is being backed up.  It does it by querying the LastFullBackup attribute of an Exchange Database. It groups servers by AD site, and I have this run as a scheduled task every day.  It also send and email. As a scheduled task I created a .cmd file with the following in ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on February 6, 2008
  • Get-AllQueuesGUI.ps1 (v1.2)

    I just have to share this with you.  So for those of us who have Installed Exchange 2007 RTM, you may have noticed that the queue viewer is a bit pants. Now I have not seen Exchange 2007 Service Pack 1, so maybe this is fixed, but when I look at queues I want to see ALL the queues and not just the one server (like the Queue Viewer) A while ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on November 28, 2007
  • get-allqueues.ps1 v1.0

    Can remember if I posted this or not, but I forgot who handy it is. basically if just runs get-queue, but for all you Exchange 2007 Hub Transport Servers  Ah, but what is really cool is this .. You can do ''stuff'' with the output  So you could run [PS] C:\ps>.\get-allqueues.ps1 [PS] C:\ps>.\get-allqueues.ps1 | WHERE ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on November 9, 2007
  • get-exchangeserverplus.ps1 v1.3

    So after the release of Rollup Update 5, wouldn't it be nice if you could run a simple PowerShell script to check all your exchange servers and see what Rollup they have applied  Well now you can ;-) get-exchangeserverplus.ps1 It runs get-exchangeserver and enumerates a servers registry for the installation key and lists it out.  ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on October 31, 2007
  • Exchange 2007: Setup /NewProvisionedServer

    So I have been having some fun this setup switch and wanted to share some stuff with you .... so if your Exchange 2007 organization contains many Exchange servers, it is possible that more than one person will be installing Exchange 2007. As a result, you might not want every person who will install Exchange 2007 to have the permissions assigned ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on October 22, 2007
  • Test-SystemHealth

    Okay so we all know that Test-SystemHealth is basically ExBPAcmd with a nice wrapper.What I find interesting is that when I run it, it always ''Mailbox Role Checks'' even if it's run on a CAS or Hub Transport server. Well Test-SystemHealth does have a -roles but the help file says it's Reserved for internal use. However, you can use the ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on August 6, 2007
  • DynamicDistributionGroup for all users in a particular storage group

    Sorry Evan, but just to correct you a little bit. ;-) but you need <ServerName>\<SG> in get-mailboxdatabase and –organizationalUnit in New-DynamicDistributionGroup To create a DDL for each DB in an SG get-mailboxdatabase -StorageGroup <ServerName>\<SG> | % { New-DynamicDistributionGroup ''DDG-$($_.Name)'' ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on July 10, 2007
  • WindowsPowerShell [Get-Acl / Set-Acl]

    So might have guessed with my previous transport post that now I wanted to automated the moving of the logs and database to another drive. It is nice and simple, you can create a folder on the new drive and change the paths in the EdgeTransport.exe.config and by using Set-TransportServer. BUT I discovered that some of the folders have specific ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on July 6, 2007
  • Exchange 2007 MessageTracking

    So as you may know, MessageTracking in Exchange 2007 is pants.  Out of the box you can only track a message from one server and have to manually track messages from one server until the next.  The default MessageTracking doesn't even let you do this. So, this is one I made earlier ;-) A little PowerShell Script that requires a ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on June 27, 2007
  • Exchange 2007 Message Queue

    I wanted to see what was queued up on my Hub Transport servers and the Queue viewer didn't fit the bill, but this line of code did ;-) [PS] C:\ps>Get-ExchangeServer | where {$_.ServerRole -eq ''HubTransport''} | get-queue
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on May 30, 2007
  • Exchange 2007 Update Rollups

    So as you have read I have been playing with the two Update Rollups (1, 2)and the one things that gets me is that you have no way of knowing what patches are applied on what servers. Until now ;-) So I have written some PowerShell that will get a list of all your Exchange 2007 with the exception of Edge servers.  It then uses WMI to ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on May 9, 2007
  • WebService to Find Room and Equipment Mailboxes in Exchange 2007

    Time to blow the dust off my coding shoes and give this ago!... In Exchange 2007 one of the new features is resource mailboxes out of the box you have two types of these mailboxes Room mailbox and Equipment mailbox.http://gsexdev.blogspot.com/2007/04/webservice-to-find-room-and-equipment.html
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on April 11, 2007
  • WMIC

    I am playing virtual tennis with Shawn today and he scored his first point with this (the game is at 15-40) In the past I have used ScriptomaticV2 or wbemtest to test WMI or get vbscript to dump WMI data.  Shawn showed me WMIC and I am very impressed.  It's not as good as using Windows PowerShell, but it is good. So if you using a ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on March 27, 2007
  • Exchange 2007 RTM: Get-Tip

    I blogged this before with a Beta version of Exchange 2007.  Here is a dump of Get-Tip from Exchange 2007 RTM.  It turns out that we have 76 of them! [PS] C:\ps>1..76 | foreach { get-tip $_ } Tip of the day #1:To return all scripts that are found in your path, type:Get-Command -Type ExternalScript And for a useful shortcut, assign ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on January 16, 2007
  • Windows PowerShell SendMail / MailStorm script

    Okay here it is. Yes yet another send mail powershell script, but this is different! Oh yeah, it has loads of options and yet this a GUI! yeah a GUI!  Also you can send email to members listed on a CSV file and send more than one.  I suppose its actually more like a mailstorm program So copy it down, start up powershell and run ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on January 2, 2007
  • Testing with the Ex2007 Default ReceiveConnector

    Thank you Brett, I have been having heart ache trying to work out to send emai to my test server. Check it out (http://blogs.technet.com/brettjo/archive/2006/10/13/testing-with-the-ex2007-default-receiveconnector.aspx) .. its easy really [PS] ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on October 17, 2006
  • Powershell and the Registry

    Brett touched on this a while back, and I just wanted to pad things out a bit. So as brett mentioned, you can access the registry like a file system in powershell.  So start up powershell and type: PS C:\> sl HKLM: PS HKLM:\> Now you can sl, cd and chdir are all an alias for Set-Location, so you can use either.  You can see the ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on September 8, 2006
  • Exchange scripting

    Been looking for some stuff on creating public folders and stumbled across this. Source: http://h71019.www7.hp.com/ActiveAnswers/cache/70499-0-0-225-121.html?jumpid=reg_R1002_USEN It’s damm good, and has source code.  Check out the E2KWatch script in H)Part 2: Scripts for Managing Exch2K with WSH
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on September 8, 2006
  • Exchange 2007 Powershell: Get-Tip

    You know if you start the Exchange Management Shell, it gives you a “tip”.  Well it would seem that it has 80 of them!  So I thought it would be good to list them all out You can just type get-tip in the Exchange Management Shell, but if you want a specific one type get-tip 8 and you wil get #8.  Anyway here is ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on August 17, 2006
  • Updated Exchange SDK Documentation and Samples July 2006

    Exchange Server 2003 SDK Documentation and Samples July 2006 http://www.microsoft.com/downloads/details.aspx?FamilyID=32774e09-4984-458e-bdb7-ed2bb356bd27&DisplayLang=en The Exchange Server 2003 SDK Documentation and Samples assist developers building applications for Exchange Server 2003. This release of the SDK provides new and updated ...
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on August 2, 2006
  • Writing Managed Sinks for SMTP and Transport Events

    Ohh you get a word doc and some code!  Source: http://www.microsoft.com/downloads/details.aspx?FamilyID=0cd7f344-cad6-416e-9bc1-0d7c214e1d0b&DisplayLang=en This technical article and sample event sinks assist developers in creating SMTP and Transport event sinks using Microsoft Visual Stuidio .NET and the .NET Framework.
    Posted to Carpe Diem: Flaphead.com (Weblog) by paul on August 2, 2006
Powered by Community Server (Personal Edition), by Telligent Systems