Thursday, November 29, 2007

Troubleshooting Exchange 2007 Transport Logs with LogParser


There is a series of posts on the Microsoft Exchange team blog on analyzing and troubleshooting your Exchange 2007 logs.

Part 1, gives an introduction to LogParser.
Part 2, drills down to analyzing various exchange logs and explains how to draw charts from your mail flow information.

Here are some of the queries you can find in part two:

- Identifying top senders to your system
- Identifying times of highest traffic
- Identifying top senders
- Identifying top email rejecting IP sources
- Identifying outbound email issues
- Content agent filtering log
- Message tracking log

Exchange Server 2007 with Service Pack 1


Exchange Server 2007 with Service Pack 1 is available for download here.

See the full list of new features in SP1 here.

Bear In mind that installing SP1 requires uninstalling the current version and re-installing
the SP1 version.So, Backup... Backup and Backup again!

Wednesday, November 28, 2007

Script Fanatic - The Hebrew version

I started a new weblog on Microsoft's Israel blogs. It is intended for Israeli audience and will be written in Hebrew and I hope it will help Israeli scripters to get acquainted to PowerShell. I'll keep on posting here in English.

Developer Academy II


Yesterday, I attended the second Microsoft's annual developers event "Developer Academy II", in Israel.

I attended some sessions like LINQ introduction, Mushups and Windows Live and C# 3.0 but the main event for me was "The Power of Windows PowerShell" session presented by Shahar Gvirtz.

Shahar showed some cool demos: how to use PowerShell from any .NET Application including Web pages, Runspaces, writing Cmdlets for web administration and Invoking them from hosted runspaces, VSTO, extending PowerShell from code or by using XML files and many more.

I really loved it. At first, only quarter of the session auditorium was full. A minute before the session started they had to add another 40 seats, Hugh success!. The session presentation is also available from Shahar's weblog.

This weblog also got mentioned in the links slide of the session. Thanks!

TechNet Magazine Poster: Exchange 2007

Get your hands on this new Exchange 2007 poster of this month's TechNet magazine issue. This poster highlights the architecture and feature set of Microsoft Exchange Server 2007:

  • Management and Monitoring
  • High Availability
  • Client Access, Edge Transport, Hub Transport, Mailbox, and Unified Messaging server roles

    Download it here (PDF)


    Sunday, November 25, 2007

    Top 5 Exchange Server 2007 Security Best Practices

    Devin L. Ganger, Exchange MVP, lists his recommendations for securing Exchange 2007. Read it here.

    Thursday, November 22, 2007

    Two PowerShell articles on MSDN magazine


    In this month's issue of the MSDN Magazine, there are two articles on PowerShell.

    Ever wanted to perform automation on windows forms or click a button in a window, etc?

    Dr. James McCaffrey (blog link) shows how to create a small collection of custom Windows PowerShell cmdlets (eight custom cmdlets) that perform Windows UI automation tasks.

    The sample cmdlets includes: get-window, get-control, get-controlByIndex, send-chars, send-click, get-listBox, send-menu, and get-textBox.


    The second article "Extend Windows PowerShell With Custom Commands" by Jim Truher discusses:

    • Windows PowerShell SDK
    • Using the System.IO.IsolatedStorage namespace
    • Overriding default cmdlet behavior
    • Installing and using custom cmdlets

    You can also download the magazine in HTML Help (.chm) format here. Click the month link and try to download the file in your language. BTW, the English version for December 2007 (EN) is broken :-(

    Tuesday, November 20, 2007

    The end of public key cryptography?


    Adi Shamir, a professor at the Weizmann Institute of Science in Israel, One of the world’s most prominent cryptographers issued a warning about a hypothetical incident in which a math error in a widely used computing chip places the security of the global electronic commerce system at risk.

    Read the rest of this at The New York Times website.
    The Hebrew version can be found here (TheMarkerIT).

    System Center Virtual Machine Manager 2007 Scripting Guide



    "The Virtual Machine Manager 2007 (VMM) command shell is built on Microsoft Windows PowerShell, an administrator-focused, interactive command-line shell and scripting language that is integrated into the Windows operating system. VMM commands, called cmdlets, can be used separately to perform simple administrative tasks, as an alternative to using the VMM Administrator Console. VMM cmdlets and other command-line elements can also be aggregated into scripts to perform more complex tasks and to automate tasks involving a large number of managed virtual machines that would be burdensome to perform from the Administrator Console."


    Download the Scripting guide here

    Monday, November 19, 2007

    PowerSSAS - New PowerShell provider for Analysis Services

    powerSSAS_banner copy

    Darren Gosbell [MVP], has written a new provider (first public release) for Analysis services called powerSSAS. powerSSAS enables you to navigate SQL Server Analysis Server like a drive, much like the FileSystem and Registry (Get-PSDrive) drives in PowerShell . It's released as an open source project on codeplex.

    You can read more on Daren's PowerSSAS in his blog.

    How to configure mail forwarding in Exchange 2007


    This procedure describes how to configure a mailbox to forward mail to either a mail-enabled contact or another mailbox. It can be configured through GUI (EMS - exchange Management Console) but here I'll show how to do it via PowerShell (EMS - Exchange Management Shell).


    $srcMbx="Test"  # forward copy of all messages from this mailbox
    $dstMbx="ShayL"  # mailbox to receive forwarded messages from source mailbox


    # list forwarded mailboxes for user "Test" (default settings for new mailbox, no one)

    PS > Get-Mailbox -Identity $srcMbx | fl deliver*,forward*

    DeliverToMailboxAndForward : False
    ForwardingAddress          :


    # Set forward messages (copy) to ShayL mailbox

    Set-Mailbox -Identity $srcMbx -DeliverToMailboxAndForward $true;
    Set-Mailbox -Identity $srcMbx -ForwardingAddress $((get-mailbox -Identity $dstMbx).DistinguishedName);


    # Check again

    PS > Get-Mailbox -Identity $srcMbx | fl deliver*,forward*

    DeliverToMailboxAndForward : True
    ForwardingAddress          : DomainName/Users/Shay Levy


    ### EDIT ###
    The command can be issued as a one liner:

    Set-Mailbox user -DeliverToMailboxAndForward:$True -ForwardingAddress



    # Check the GUI, Exchange > Recipient Configuration > Mailbox > Test


    Help vs. Get-Help

    Help text for any command-let in PowerShell can be viewed by executing "help cmdletName" or "get-help cmdletName". At first glance there's no difference between the two, both emits the relevant help to PowerShell's console, but under the cover they are completely different command types:

    PS > (help get-command).gettype().fullname

    PS > (get-help get-command).gettype().fullname


    All members type of 'help get-command' are strings, while 'get-help get-command' returns rich PSCustomObject:


    PS > (help get-command) | foreach {$_.gettype()}

    IsPublic IsSerial Name                                    BaseType
    -------- -------- ----                                         --------
    True     True     String                                   System.Object
    True     True     String                                   System.Object


    PS > (get-help get-command) | foreach {$_.gettype()}

    IsPublic IsSerial Name                                     BaseType
    -------- -------- ----                                          --------
    True     False    PSCustomObject                     System.Object


    Now with Get-Member, which returns different type names:

    PS > (help get-command) | gm
    TypeName: System.String

    PS > (get-help get-command) | gm
    TypeName: MamlCommandHelpInfo


    One might think (as I did) that "help" is a built-in alias for get-help:

    PS > Get-Alias -name h* | format-table -auto

    CommandType  Name     Definition
    ----------- ----    ------      ----
    Alias                 h           Get-History
    Alias                 history   Get-History

    There is no such alias for get-help. Another test:

    PS > get-alias | where {$_.Definition -match "Get-Help"}

    No output. Typing help or get-help separately shows different output formats. Executing "Help" emits a list of PowerShell's built-in aliases, cmdlets, providers and about help files. It also supports paging (one screen at a time). On the other hand get-help outputs the help for the get-help cmdlet with no paging support.


    So, what is "help"? Lets try get-command:

    PS > get-command help  | ft -auto

    CommandType   Name        Definition
    ----------- ----     -----          -----
    Function             help         param([string]$Name,[string[]]$Category=@('All')...
    Application         help.exe   C:\WINDOWS\system32\help.exe


    Ah.. help is a function while get-help is a cmdlet. To view the source of the help function (edited):

    PS > (dir function:\help).definition

    if ($Detailed)
          #Detailed and #Full are in different sets..let get-help cmdlet handle the error
          get-help $Name -Full -Detailed  |

    if ($Examples)
          #Examples and #Full are in different sets..let get-help cmdlet handle the error
          get-help $Name -Full -Examples  |


    You can see that behind the scenes, the help function is kind of a proxy command. It pipes the typed help command and parameters to get-help and then pipes the result to to support paging.

    Moreover, when you want to access certain member (like examples) to display a specific code example:

    PS > (get-help get-command).examples.example[0]

    -------------------------- EXAMPLE 1 --------------------------


    This command retrieves information about all of the Windows PowerShell cmdlets....


    Try the same with help and you'll get an error:

    PS > (help get-command).examples.example[0]
    Cannot index into a null array.
    At line:1 char:37
    + (help get-command).examples.example[0 <<<< ]


    So, if you need access to specific members of a certain cmdlet using the above examples use get-help. If you know other differences, please post them in the comments box.

    Saturday, November 17, 2007

    Jeffrey Snover interview in TechEd Barcelona 2007


    Michael Cote interview Jeffrey Snover in the lobby of the Microsoft TechEd IT Forum in Barcelona.

    Wednesday, November 14, 2007

    Enable POP3 on Exchange 2007

    By default, POP3 service is not enabled on Exchange 2007. Moreover, the Administrator account is explicitly blocked from POP3/IMAP4/SMTP for security reasons. To enable POP3 you first must enable and start the service:


    PS > Set-Service MSExchangePop3 -StartupType automatic
    PS > Start-Service MSExchangePop3


    Enabling POP3 for clients can be achieved with the Set-CASMailbox cmdlet. To get a list of all users mailbox with their POP3 settings:

    PS > Get-CASMailbox | Select Name,PopEnabled


    To enable clients for POP3:
    Set-CASMailbox -Identity <username> -PopEnabled $true


    When trying to connect to a POP3 mailbox, a user/password dialog pop-up appeared. When I entered the user's credentials the dialog kept poping up again and again. Something did not work with the user's login.

    I issued Get-Command *pop* and found the cmdlet Get-PopSettings (there is also the corresponding Set-PopSettings), I piped it to Get-Memebr and among all members there was a property called LoginType

    PS > Get-PopSettings
    LoginType       : SecureLogin

    You can see that the LoginType is set by default to secure login. I needed to change it to allow clear text login (although not recommended), so I piped it to get-member:

    PS > Get-PopSettings | gm l*

       TypeName: Microsoft.Exchange.Data.Directory.SystemConfiguration.Pop3AdConfiguration

    Name      MemberType Definition
    ----      ---------- ----------
    LoginType Property   Microsoft.Exchange.Data.Directory.SystemConfiguration.LoginOptions LoginType {get;set;}


    Trying to find the valid values to set the property.

    PS > [Microsoft.Exchange.Data.Directory.SystemConfiguration.LoginOptions]

    IsPublic IsSerial Name                                     BaseType
    -------- -------- ----                                     --------
    True     True     LoginOptions                             System.Enum


    You can see that LoginType is a System.Enum type. To get all valid options for LoginType :

    PS > [enum]::getnames([Microsoft.Exchange.Data.Directory.SystemConfiguration.LoginOptions])


    Now you can change the value to "PlainTextLogin".
    PS > Set-PopSettings -LoginType PlainTextLogin


    After setting the login type to PlainTextLogin, All POP3 enabled users could login successfully.


    Sunday, November 11, 2007

    SMS Cmdlets for Windows PowerShell


    Don Brown, wrote a sample cmdlet to manage Microsoft System Management Server (SMS) 2003 clients local policy from Windows PowerShell. The CMDlet source code can be downloaded here, there is also a setup/MSI file.


    The sample snap-in includes six cmdlets:

    Verb-Noun (Cmdlet template)

    Saturday, November 10, 2007

    New TechNet portal for IT Pros


    TechNet EDGE Is a new community portal for IT Pros and is a sister site to Channels 8, 9, 10 and Mix Online. The portal will open officially on Monday but you can join the site starting now.

    Here's the about text (from the EDGE site):

    "TechNet Edge is a place where IT professionals go to get the inside scoop on the latest and greatest technologies. You can do stuff like watch screen casts, check out interviews with people who develop the products, connect with your peers and speak what’s on your mind. It is part of the Evangelism Network and follows its doctrine, so you know we keep it real."

    Tuesday, November 6, 2007

    Windows Server 2008 Core screencasts


    There is an 8 part screencast series on Keith Combs' Blahg blog. The short videos starts with a technical overview and goes through different aspects of Microsoft's Windows Server Core 2008. Check it out.

    Part 1 - Core Technical Overview (6:00)
    Part 2 - Core WSv Prerequisites (7:37)
    Part 3 - Core Networking (6:37)
    Part 4 - Core Activation (5:38)
    Part 5 - Domain Join (2:37)
    Part 6 - Core Role Installation (3:46)
    Part 7 - Core Feature Installation (3:49)
    Part 8 - Core Management (6:24)


    Additional details of installing and configuring Server Core can be found in the Windows Server 2008 Step-by-Step Guides.

    Windows PowerShell 2.0 CTP released


    Finally, the CTP version is available for download.
    Check out the Windows PowerShell team blog.

    TIP: If you can't see any content when opening the WindowsPowerShell2.0_CTP_SDK.chm file, right click it and click on the unblock button.

    Sunday, November 4, 2007

    PowerShell v2.0 (CTP)


    Well friends, one year after PowerShell v1.0 was first released, Jeffrey Snover announced v2.0 CTP (Community Technology Preview) in a 3 blog entries (see below) on the Windows PowerShell team blog. You should read them all very carefully.

    The new version features are "partly cloudy" and will be revealed somewhere next week, though Remoting is the major feature as stated before.

    My adrenaline levels is going high and one week seems to be a very long time ;-)


    Read Jeffrey Snover posts on the Windows PowerShell team blog

    CTP != Beta !
    Platform Requirements

    Saturday, November 3, 2007

    NET Framework 3.5 poster


    I read itvon Guy Burstein's blog, you can download a poster (PDF file) of the Commonly Used Types and Namespaces in .Net Framework 3.5.


    Thursday, November 1, 2007

    SysInternals - utilities new version

    The recent updates include updates for the following system utilities tools:

    BgInfo v4.11
    Handle v3.30
    ZoomIt v1.71
    Process Monitor v1.25

    You can download the Sysinternals Suite in one file (bundle of the most common utilities).

    Subscribe to comments by email

    There is a cool new feature (its about time, thanks guys!) that allows readers of a blog to receive an email each time a comment is made to a particular post. You can subscribe to a post's comments by clicking the "Email" link next to "Subscribe to comments" on the post page.

    There is one exception to this feature. In order to subscribe to comments by email, you must be logged in to a Google Account. Please log in with the account using the email address at which you'd like to receive the comment emails. As soon as you're logged in, you’ll be taken to a confirmation page where you can click "Subscribe" to opt in. On this page, you’ll also have the option to use a different Google Account to receive comment emails.

    After you subscribe, you’ll receive one email for every comment published on the post. For moderated comments, an email will be sent out only after the comment has been approved by the moderator.

    You can unsubscribe from comments by email at any time; just click the unsubscribe link in the comment emails you receive.

    Or, alternatively, you can click the "Unsubscribe" link on the blog's comment page. Then, just as when you subscribed to comments by email, you’ll be taken to a confirmation page where you can confirm your unsubscription.


    • You may only subscribe to comments on a per-post basis.
    • If your Google Account is unverified, you can still subscribe to comments but won’t receive comment emails until your account is verified. If you sign up for comment emails on a blog post with an unverified Google Account, you’ll see a message on the comment page to remind you to verify your account.

    Validate your scripts syntax

    Keith Hill posted an excellent PowerShell QuickTip on Preparsing Scripts to Check for Syntax Errors. This answers a problem I had regarding my blog entry on Converting PowerShell scripts, which I'm going to update with a link to Keith's post.