PowerShell Not your Father’s Command Line Part 19 of 31: Small Business Server, PowerShell, and Me

imageWelcome to part 19, this post will be slightly different from the rest of the series, but Sarah and I had an interesting email come in with a comment and a suggestion from Sean.  BTW Sean thank you for feedback and suggestion, and I even borrowed your title.  Sean’s comment and feedback mentioned that he spends his life in Small Business Server (SBS).  He mentioned that he uses a little PowerShell in the SBS environment specifically around Exchange tasks and what can he do with PowerShell.  So he asked to have some more SBS content.  So I did some checking (thanks Amy, Kevin and Tim for your great feedback), and found some tidbits and ways to look at PowerShell in SBS environment.  More importantly I thought it would be a great topic to discuss.

First off remember the product is called Windows Small Business Server, and simply means it is built on the Windows Server OS.  So many of the tools we have used in the series still apply.  SBS has Exchange, IIS, SharePoint and many other roles you can use to manage Remember if you find yourself  doing many tasks over and over  this could be a great use for PowerShell.  Especially if you manage several SBS installs for your customers you may be able to use PowerShell scripts to quickly configure the SBS environments. 

So why is SBS unique when you think of PowerShell?  SBS has a ton of GUI wizards which really help in configuring and working with the server, which in some cases will take away some of the need to work with PowerShell.  However, one of the common themes I have seen with PowerShell and SBS is the use for Exchange.  If you check out the SBS blog, they have a few examples of PowerShell and SBS usage.  For example this PowerShell script will export a mailbox to a PST Files in SBS 2011 Standard (read the full article here: How to Import and Export Mailboxes using PST Files in SBS 2011 Standard:

New-MailboxExportRequest –Mailbox user –FilePath “\\<servername>\Sharename\user.pst”

The AD provider is also available to SBS, and the recycle bin I talked about yesterday if enabled will work on SBS 2011 Standard.   So the challenge is finding what things you want to work with on the SBS server, and for the most part all of the cmdlets Sarah and I have blogged about through this series is going to work the same in a SBS installation.  SBS 2011 even supports PowerShell 2.0 remoting and using the BPA.  So SBS has some of the same great support for PowerShell.  So even if I have a tendency to work with PowerShell and the server remember at the heart of SBS server is a Windows Server.  I hope you enjoyed this quick peak and tomorrow we take a look at managing Hyper-V with PowerShell

Thanks for reading and if you missed any of the previous posts you can find a master list of series postings located here: PowerShell Not Your Father's Command Line: 31 Days of PowerShell or on Sarah’s blog here: PowerShell Not Your Father's Command Line: 31 Days of PowerShell. Lastly Sarah and I want to hear from you email either of us with your comments or suggestions for future postings let us know, we look forward to hearing from you. Have a great day!

Comments (3)

  1. Sean says:

    Awesome, thank you!

  2. Sean says:

    Here are some common Exchange commands I run:

    Add-IPBlockListProvider -Name "Zen Spamhaus" -LookupDomain zen.spamhaus.org -AnyMatch $True -Enabled $True -RejectionResponse "{1} has blocked your IP address ({0}) using the list '{2}'. Please see http://www.spamhaus.org/…/bl{0} for further information."

    Add-IPBlockListProvider -Name "Passive Spam Blacklist" -LookupDomain psbl.surriel.com -AnyMatch $True -Enabled $True -RejectionResponse "{1} has blocked your IP address ({0}) using the list '{2}'. Please see psbl.surriel.com/listing{0} for further information."

    Enable-AntispamUpdates -SpamSignatureUpdatesEnabled $true -UpdateMode Automatic -IPReputationUpdatesEnabled $true

    Set-SenderFilterConfig -Enabled $true

    Set-SenderIDConfig -TempErrorAction Reject

    set-OrganizationConfig -SCLJunkThreshold 5

    set-ContentFilterConfig -SCLRejectThreshold 7 -SCLRejectEnabled:$true

    set-ContentFilterConfig -RejectionResponse "Email Rejected due to Content Filter"

    Pasting those in is a heck of a lot quicker than using the gui config and some of those things I can't even find in the gui config.

  3. kevin royalty [sbs mvp] says:

    great stuff Matt!  i'd love to see a series of powershell for the SMB/SBS admin, focusing on the common stuff like what sean posted.  it'd be a great series!

Skip to main content