Mon, Feb 17 2014 22:45
SMBKitchen: Susan sucks at PowerShell
Next up, lets run a little inventory script.
Download it from here: http://gallery.technet.microsoft.com/exchange/Generate-Exchange-2388e7c9
One slight little hiccup is the need for PowerShell 2.0.
The installation of PowerShell 2.0 on SBS 2003 (if you are migrating from that can be done - http://www.sbsfaq.com/?p=3040
Also can be done on SBS 2008 - http://support.microsoft.com/kb/968929
And there's some posts that say that supposedly 2008 sp2 has it but I don't it does as My PowerShell was still reporting itself as V1 not v2.
I had to go through my aging memory banks to remember that it was PowerShell 3 that had issues on SBS 2008, not PowerShell 2 - http://blogs.technet.com/b/sbs/archive/2012/12/15/windows-management-framework-3-0-applicability-on-windows-small-business-server-2008-2011-standard.aspx
"From an Exchange Management Shell, navigate to the directory you've downloaded and extracted the script to. Then to generate a simple one-time report, execute the command with the following parameters:
.\Get-ExchangeEnvironmentReport -HTMLReport .\Report.html"
We also need to remember to set the PowerShell execution policy in order to run this
Changing the Windows PowerShell Script Execution Policy
The Set-ExecutionPolicy cmdlet enables you to determine which Windows PowerShell scripts (if any) will be allowed to run on your computer. Windows PowerShell has four different execution policies:
Restricted - No scripts can be run. Windows PowerShell can be used only in interactive mode.
AllSigned - Only scripts signed by a trusted publisher can be run.
RemoteSigned - Downloaded scripts must be signed by a trusted publisher before they can be run.
Unrestricted - No restrictions; all Windows PowerShell scripts can be run.
To assign a particular policy simply call Set-ExecutionPolicy followed by the appropriate policy name. For example, this command sets the execution policy to RemoteSigned:
You may want to flip it to RemoteSigned or Unrestricted and then set it back to Restricted.
I also copied the script to the c:\scripts folder to make it easy on myself. And made sure I right mouse clicked on the file and "unblocked" it so it would run.
All set and here we go.......
...or maybe not.
...and right about here is where we find I live in SBS land and not in normal server land because this lovely inventory tool that supposedly works in all environments is failing on this part of the PowerShell
| $IntNames = [system.String]::Join(",",$IntNames)
| $ExtNames = [system.String]::Join(",",$ExtNames)
it doesn't like, as it says Exception calling "Join" with "2" arguments(s): "Value cannot be null"
Hmm... and I can't tell why it's failing. Let me go ask folks who know a heck of a lot more PowerShell than I do as I haven't a bloody clue as to what it wants or what it's lacking.
Okay enough for tonight, stay tuned for tomorrow night's edition of "How Susan realizes she totally sucks at PowerShell"
Blogging my way (starting over) through a proof of concept migration from SBS 2008 to Essentials 2012 R2 series will be a SMB kitchen project whitepaper. More about the SMBKitchen project at - http://www.thirdtier.net/enterprise-solutions-for-small-business
Filed under: smbkitchen