Category Archives: Microsoft

PowerShell Summit–My recorded sessions

imageRecently I was lucky enough to attend the PowerShell Summit at Microsoft HQ in Redmond, this was an awesome event which was focused on PowerShell, it included not only people who are using PowerShell but also some of the people who wrote and designed it.

There were a bunch of great sessions, all of which can be reviewed and slides downloaded here.  I was also asked to present two sessions.  I have included the recordings for these sessions below.  Thanks to Aaron Hoover for recording these.

A couple of comments which I took away from the PowerShell Summit which really surprised me where:

  • A number of people told me they had started out with PowerCLI and then worked back into PowerShell (much like myself).
  • I was surprised that 2/3 of the room when I presented were using VMware, after all this was a Microsoft Conference!

Continue reading

Listing remote Date and Time with PowerShell

Recently I needed to find the remote time of multiple windows servers on the network and compare these, I wrote a quick function that uses WMI to pull this information and return it in a DateTime object format:

image

The Code

function Get-Time {
	<#
		.SYNOPSIS
			Gets the time of a windows server

		.DESCRIPTION
			Uses WMI to get the time of a remote server

		.PARAMETER  ServerName
			The Server to get the date and time from

		.EXAMPLE
			PS C:\> Get-Time localhost

		.EXAMPLE
			PS C:\> Get-Time server01.domain.local -Credential (Get-Credential)

	#>
	[CmdletBinding()]
	param(
		[Parameter(Position=0, Mandatory=$true)]
		[ValidateNotNullOrEmpty()]
		[System.String]
		$ServerName,

		$Credential

	)
	try {
			If ($Credential) {
				$DT = Get-WmiObject -Class Win32_LocalTime -ComputerName $servername -Credential $Credential
			} Else {
				$DT = Get-WmiObject -Class Win32_LocalTime -ComputerName $servername
			}
	}
	catch {
		throw
	}

	$Times = New-Object PSObject -Property @{
		ServerName = $DT.__Server
		DateTime = (Get-Date -Day $DT.Day -Month $DT.Month -Year $DT.Year -Minute $DT.Minute -Hour $DT.Hour -Second $DT.Second)
	}
	$Times

}

#Example of using this function
$Servers = "localhost", "dc01.domain.local"

$Servers | Foreach {
	Get-Time $_
}

Checking for time skew

We can also use this function to easily check for time skew between two machines, the below code is an example where I check my time between a remote host and the local server to see if it is within 30 seconds…

$RemoteServerTime = Get-Time -ServerName "dc01.domain.local"
$LocalServerTime = Get-Time -ServerName "localhost"

$Skew = $LocalServerTime.DateTime - $RemoteServerTime.DateTime

# Check if the time is over 30 seconds
If (($Skew.TotalSeconds -gt 30) -or ($Skew.TotalSeconds -lt -30)){
	Write-Host "Time is not within 30 seconds"
} Else {
	Write-Host "Time checked ok"
}

Installing PowerShell Web Access on Windows 2012 RC Core

Recently I wanted to check out the Windows 2012 RC build and more specifically some of the new PowerShell features.  I have seen the Web Access mentioned a few times now so wanted to deploy a quick box to test this out.

I decided to try windows core and see how easy it was to get started with PowerShell Web Access, after the install which was very fast I changed my Administrator password and then logged into the box, I was immediately presented with a command prompt, the following steps are what I took to add PowerShell Web Access into my test environment.

Step by Step

Step 1 was to launch PowerShell and add the windows feature for PowerShell Web Access

TinyGrab Screen Shot 05-06-2012 20.31.43

Next I setup the certificates, note that I just used the test certificates as this was a test box but if you are installing this in live you should use the help on Install-PswaWebApplication to see the further parameters needed for a proper certificate.

TinyGrab Screen Shot 05-06-2012 20.36.58

Next I added a single rule to allow the local Administrator access to this machine, again you can obviously setup the rules as needed in your environment with this cmdlet.

TinyGrab Screen Shot 05-06-2012 23.31.00

After this has been completed you should now be able to visit the https site to receive a login window, in my example the URL was https://hostname/pswa

TinyGrab Screen Shot 05-06-2012 23.05.03

Here you must enter the credentials to login to the host…

TinyGrab Screen Shot 05-06-2012 23.29.38

Once logged in you should have a familiar window, as you can see I issued a Get-Command to list all the cmdlets available to me…

TinyGrab Screen Shot 05-06-2012 23.31.50

vCheck Exchange Updated

imagePhil has been doing some fantastic work with the Exchange 2010 version of vCheck, his latest version now even supports Exchange 2007 !

He has also updated most of the plugins with new and exciting data, if you have Exchange and you have not yet tried it make sure you give it a whirl, if you have already been using the previous version make sure you update to this great new version.

Download

To download this version of vCheck you can download the following file which includes the base script and all exchange plugins:

http://www.virtu-al.net/vcheck-pluginsheaders/vcheck/

For more information on the base vCheck script and its framework including a demo of how to use it visit this page.

Plugins

All Exchange Plugins are accessible via the Exchange plugins page located here.

Example Page

An example of the Exchange 2010 report can be viewed by clicking here.

Update Log

New in Exchange Plugins v2.0:

Exchange 2007 support

Report on drives with <= x% free space

MAPI Latency report where latency is above user specified threshold

Active DB not mounted on preferred server report

Various bug fixes and code cleanups

All the plugins have been renumbered into a more logical order

Plus, a bonus plugin to select (via vCheck.ps1 -config) the report header image

Added plugin “20 Exchange 20xx Largest Mailboxes by Total Size”, like 18 and 19,
but sorted by the sum of mailbox and dumpster sizes

————————————————————————————-

00 1st Plugin – Select Report Header Image
Sets report header image
For example, download the Exchange header from
http://www.virtu-al.net/featured-scripts/vcheck/vcheck-headers/
and save as vCheck\Headers\Exchange.png, and this will work out of the box
Falls back to vCheck\Header.jpg if specified header can’t be found

10 Exchange 20xx Load Snapin.ps1
Loads Exchange 2007 / Exchange 2010 powershel snapin

11 Exchange 20xx Basic Server Information.ps1
Basic Exchange server info: OS & Service pack, Exchange version, hotfix rollups,
Exchange Edition and Roles

12 Exchange 20xx Drive Details.ps1
Drive details for each of the Exchange servers.  Can be configured to report only
on drives with less than a specified percentage free space

13 Exchange 2010 Database Availability Groups.ps1
Basic info about your DAG groups – Exchange 2010 only

14 Exchange 20xx DB Statistics.ps1
Database statistics – number of mailboxes, sizes, circular logging, and last
backup dates

15 Exchange 2010 DB Status.ps1
Database status info

16 16 Exchange 2010 Active DB not on Preferred Server .ps1
Reports on databases not mounted on their preferred servers

17 Exchange 20xx MAPI Connectivity.ps1
List MAPI connectivity latencies – can be configured to only report on latencies
above a specified level

18 Exchange 20xx PF Statistics.ps1
Public Folder stats

20 Exchange 20xx Largest Mailboxes.ps1
Report on largest mailboxes by Mailbox size

21 Exchange 20xx Largest Dumpster.ps1
Report on largest mailboxes by Dumpster (deleted items) size

22 Exchange 20xx Largest Total Size.ps1
Report on largest mailboxes by Total size (Mailbox + Dumpster)

For each of the above three reports, you can report on the top n mailboxes by size
either across organisation or per DB, and you can also specify a threshold size to
report on.  For obvious reasons, I wouldn’t advise reporting on all mailboxes without
a non-zero threshold

Plugins for Exchange not up to date or installed.ps1
Report on out of date / missing plugins

Report on Plugins.ps1
Report on which plugins were invoked in current run

vCheck for Exchange 2010

imageOne of the main areas I redesigned in vCheck 6 was the new plugin concept, In my mind this was a nice HTML output which could be used for more than just vSphere checks, the plugins could potentially be any product which has a PowerShell snap-in or module, and even some which don’t 🙂

Shortly after the release I was contacted by Phil Randal who had done just this, he has taken the vCheck framework and written some Exchange 2010 plugins, this now turns the vCheck report into a Exchange monitoring report too.  Awesome stuff !

Now you can have a daily email with your Exchange 2010 details and issues.

Phil has added 6 initial Exchange 2010 plugins which add some great details, these include:

  • Basic Server Information
  • Database Statistics
  • Database Status
  • Public Folder Statistics
  • Mailboxes larger than x amount of MB
  • Mailboxes with deleted items above x amount of MB

So if you have Exchange 2010 then be sure to download this version of vCheck and give it a go, after all it doesn’t cost you a thing and could save you work in the future. Make sure you thank Phil for his hard work on Twitter, his account is @philrandal

Example Page

An example of the Exchange 2010 report can be viewed by clicking here.

Download

To download this version of vCheck you can download it here which includes the base script and all exchange plugins.

For more information on the base vCheck script and its framework including a demo of how to use it visit this page.

Plugins

All Exchange Plugins are accessible via the Exchange 2010 plugins page located here.

The VESI 1.2 – Get it now

People who read my blog know how much I like the Virtualisation EcoShell, I love the way it adds the power of PowerCLI back into the GUI to enable you to create customised GUI’s all of your own enhancing the true power of PowerShell and allowing people who do not know how to code in PowerCLI (yet) the chance to harness the power.

Version 1.2  of the VESI has now been released and it has some great new features:

Continue reading

Exchange Audit

I received a comment the other day on my Server/Workstation audit script from someone saying they had modified my script to audit Exchange 2003.

As you can imagine, I was intrigued and asked to have a look, I cant tell you how much it pleases me that people are able to take the scripts I write and amend/improve them to suite there needs.

Continue reading

Should I virtualise Exchange ?

For a long time the answer was no, but developments in the VMware Products have lead to major improvements in disk/network/memory and CPU performance so now the question is…
Where do I start ?
If your looking for a good starting point I would listen to the recent podcast from the VMware community round table which was specifically on virtualising Exchange..
Also you may want to check out the VMware pages written especially for virtualising Exchange, make sure you check out the resources tab….
It would seam that after years of advising against it even Microsoft are jumping on the band waggon:

With the release of Microsoft Windows Server 2008 with Hyper-V and Microsoft Hyper-V Server 2008, a virtualized Exchange 2007 SP1 server is no longer restricted to the realm of the lab; it can be deployed in a production environment and receive full support from Microsoft. 

Check out the full article on the Microsoft Exchange Team Blog here

Windows 7 Public Beta

On January 9th, the Windows 7 Beta will be available for Windows enthusiasts to download via the Windows 7 page on Windows.com. The Windows 7 Beta is going to be available download-only (Microsoft are not sending out physical media) and available for a limited time to the first 2.5 million people who download the beta.

For an easy way to test this out follow this well written post over at ‘VM /ETC’ which will show you a step by step guide on installing Windows 7 in VMware Workstation

For more information check out the Windows Team Blog

Removing SCVMM from vCenter

An interesting article was bought to my attention which explains that if you ever use SCVMM to control your VMware environment (no comment) and then decide to remove it again (again no comment) there are a few things left behind.

The following blog explains what is left behind and whats better it even gives you a nice powershell script to remove the leftovers, good job !

Microsoft System Center Virtual Machine Manager (SCVMM) 2008 makes several changes to your vCenter environment that you may like to know about, especially since they don’t seem to be mentioned in the product documentation. It’s also worth pointing out that none of these changes are reverted when you subsequently decide to discontinue managing vCenter with SCVMM.

Read the rest of the article here