PowerShell for Windows Admins:

PowerShell v2


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 9, 2014  4:59 AM

End of PowerShell Jobs week



Posted by: Richard Siddaway
PowerShell, PowerShell 3, PowerShell v2, PowerShell v4

My series on PowerShell Jobs for the Scripting Guy blog has finished.  The set of articles is: Jobs week 1 : Introduction to PowerShell jobs


August 29, 2013  1:22 PM

It’s the little things



Posted by: Richard Siddaway
PowerShell 3, PowerShell v2

I’ve been spending some quality time with PowerShell 2.0 recently. When it was all we had it was great but there’s a bunch of things I miss from PowerShell 3.0 including: CIM cmdlets CIM sessions Workflows Module auto loading Improved tab completion PowerShell 3.0 ISE especially the...


June 8, 2013  5:49 AM

Creating DNS PTR records



Posted by: Richard Siddaway
CIM, DNS, PowerShell 3, PowerShell v2, WMI

When I was writing the DNS chapter of PowerShell in Practice I couldn’t get the CreateInstanceFromPropertyData method on the MicrosoftDNS_PTRType class to work. Revisiting DNS for AD management in a Month of lunches this time round I have access to the CIM cmdlets so can put the parameter names...


January 3, 2013  12:48 PM

Ensuring that parameter values are passed to your function



Posted by: Richard Siddaway
Active Directory, PowerShell 3, PowerShell v2

A question on the forum about a function had me thinking. The user had defined two parameters for the function and then used Read-Host to get the values.

NO

Much better way is to use an advanced function and make the parameters mandatory


				
								
				 

				Bookmark and Share

				   

				 0 Comments
				   

				  RSS Feed
				   

				  Email a friend

			
			
			


June 24, 2012  9:05 AM

WMI property names



Posted by: Richard Siddaway
PowerShell 3, PowerShell v2, WMI

A question brought it home to me that WMI property names don’t always mean what you might think they mean – this is also true of other objects but I tripped over this one with WMI so we’ll stick with that.

PS> Get-CimInstance -ClassName Win32_Desktop -Filter "Name LIKE...


June 8, 2012  12:22 PM

Working with profiles: 2 deleting profiles



Posted by: Richard Siddaway
PowerShell 3, PowerShell v2, Users, WMI

I recently (1 June) showed how to discover the user profiles on your system. Now its time to delete them.

function remove-profile {            
 
				
								
				 

				Bookmark and Share

				   

				 0 Comments
				   

				  RSS Feed
				   

				  Email a friend

			
			
			


June 2, 2012  7:58 AM

Using a colon with cmdlet parameters



Posted by: Richard Siddaway
PowerShell, PowerShell 3, PowerShell v2

Another question at Tuesdays PowerShell group revolved around using colons to link values to parameters. I’d not really thought about before. Thinking about it  later I realised that you only really see it when passing booleans to –Confirm.  If you don’t use a colon then you get...


June 1, 2012  1:07 PM

Working with profiles: part 1



Posted by: Richard Siddaway
PowerShell 3, PowerShell v2, WMI

A question came up on the forum for PowerShell and WMI – how do I delete profiles. I’m going to work up to answering that by looking at using WMI to work with profiles.

So to start how can we find the...


May 25, 2012  11:58 AM

Working with WMI methods



Posted by: Richard Siddaway
PowerShell 3, PowerShell v2, WMI

Many WMI classes have methods. Methods allow us to perform some action on the object. A recent question on the forum about using methods made me realise that there are still a lot of people following the old VBScript way of doing things.

We will experiment with the BITS service as it is...


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: