PowerShell for Windows Admins:

ITKE grandparent


April 8, 2014  2:41 PM

Getting mailbox data and stats per database



Posted by: Richard Siddaway
Exchange, PowerShell v2

Way back in the day - http://richardspowershellblog.wordpress.com/2007/12/20/list-mailboxes-by-mailbox-database/ - I showed how to list mailboxes by the database in which they were stored. I had a comment left asking if its possible to list only a specific mailbox and to give the mailbox size as...

March 18, 2014  3:34 PM

Continue please



Posted by: Richard Siddaway
Security

I needed to be able to skip processing in a loop and remembered that the continue command suspends the loop processing and immediate goes back to the top of the loop. I thought a quick look at how it works in different types of loop would be worthwhile. These all work and produce the same...


February 25, 2014  4:51 PM

Requires



Posted by: Richard Siddaway
Security

You may have seen this at the top of scripts or modules #Requires –Version 3 This will stop the script running if the PowerShell version is 2.0 or below. Other options are available #Requires –PSSnapin      can be used to force the loading of a snapin #Requires...


December 23, 2013  10:06 AM

LastLogoff timestamp



Posted by: Richard Siddaway
Security

I was recently asked if there was any way to fill in the LastLogoff timestamp The short answer is no.  The values in the attributes related to logons are maintained by Active Directory during the logon process. I wouldn’t want them to be programmable as that as would create a potential...


November 27, 2013  2:35 PM

Capacity planning series finished



Posted by: Richard Siddaway
Office 2013, PowerShell, SQL Server, WMI

My capacity planning series on the Scripting Guy blog finished last week. Didn’t get chance to post about it as I was at Microsoft in Seattle. Full series and associated powertip...


November 11, 2013  12:17 PM

Capacity Planning part 2



Posted by: Richard Siddaway
PowerShell, SQL Server

My capacity planning mini series on the Scripting Guy blog continues with the second part – dealing with storing data in SQL Server - available today http://blogs.technet.com/b/heyscriptingguy/archive/2013/11/11/the-admin-s-first-steps-capacity-planning-part-2.aspx I’ll repeat the URL...


September 10, 2013  1:20 PM

Loading the SQLPS module



Posted by: Richard Siddaway
PowerShell, SQL Server

Loading the SQLPS module gives you quick access to the sql cmdlets, sql provider and the SMO assemblies. It also, infuriatingly, moves your location into the sql provider. I (really) * (lots ) hate things that assume what I want to do. You can use PowerShell to reverse this annoying, and...


September 9, 2013  12:54 PM

SMO with SQL Server 2012



Posted by: Richard Siddaway
PowerShell, SQL Server

I’ve been working quite a bit with PowerShell and SQL Server 2012 just recently. In earlier versions of SQL Server you had to load the SMO assemblies to get access to the admin functionality. In SQL Server 2012 – import-module sqlps gives you the SQL Server provider, the cmdlets and...


July 2, 2013  12:58 PM

New-mailbox oddity



Posted by: Richard Siddaway
Exchange, PowerShell

I’ve been doing a lot with Exchange recently and found an interesting quirk. If you use the New-mailbox cmdlet with the –PrimarySMTPaddress parameter the mailbox doesn’t get email address policies applied. You need to use set-mailbox to turn policy application on – after the mailbox...


June 26, 2013  4:09 PM

Dropping a database



Posted by: Richard Siddaway
PowerShell, SQL Server

A question came up on the forum regarding dropping a database & I realised it was something I hadn’t done before. SMO provides a set of classes for managing SQL Server. You get SMO when you install the SQL Server management tools Import the module to load SMO...


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: