PowerShell for Windows Admins


April 9, 2012  2:44 AM

Scripting Games 2012 Comments: #2 Read the help file

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

I’m seeing a lot of scripts where code is used to perform an action that is available as a parameter on a cmdlet that is used earlier in the pipeline.

 

Read the help file for the cmdlets you are going to use to see how you can get PowerShell to do the work for you instead you having to create and test code

April 8, 2012  7:54 AM

Scripting Games 2012 Comments: #1 Line Continuation

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

As with previous games I’ll publish a series of comments on the games. I won’t deal with any event specific issues until the games events are all closed but there are some things coming through that while not affecting any gradings don’t make the best use of PowerShell.

The first one that’s jumped out is line continuation.

I’ve seen a number of examples like the following two

get-service | `
sort status  -Descending

or

get-service  `
| sort status  -Descending

Both work but the line continuation character is unnecessary

All you need to do is

get-service |
sort status  -Descending

The pipeline symbol also works as a line continuation.

A minor point maybe but let PowerShell do the work for you


April 6, 2012  7:32 AM

2012 games–5 events published

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

We’re just about at the halfway point with 5 events available – remember there is only a week to complete an event. Deadlines start on Monday.

The overall quality of submissions from what I’ve seen so far is up on last year which is an achievement. What is staggering is that we’ve already had as many entries as we had in total last year.

Its going to be a busy time for the judges Smile


April 2, 2012  12:39 PM

Scripting Games have started

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Jump over to http://blogs.technet.com/b/heyscriptingguy/

for event 1 in the beginners and advanced categories


April 2, 2012  12:33 PM

Finding the primary name of a DNS alias record

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

A forum question asked how to find the primary name from an alias or CNAME record.

Get-WmiObject -Namespace 'root\MicrosoftDNS' -Class MicrosoftDNS_CNAMEType `
-Filter "ContainerName = 'Manticore.org'" -ComputerName server02  |             
select @{N='Alias'; E={$_.Ownername}}, Primaryname            

 

use the MicrosoftDNS_CNAMEType class. Filter on the domain ie containername.  ComputerName holds the DNS server name.

Change OwnerName to Alias in a select calculated field


April 1, 2012  10:09 AM

MVP renewal 2012

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

My MVP award was renewed for another year today.

Thank you to Microsoft for bestowing the honour for the fifth year and thank you to all of the people who’ve helped me gain this award by posting questions, reading my blogs, listening to talks etc.


March 30, 2012  8:49 AM

PowerShell in Practice offer today only

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Manning have PowerShell in Practice on a half price offer today. Go to www.manning.com and use code dotd0330cc when ordering


March 29, 2012  2:57 PM

UK PowerShell Group March 2012 meeting recording

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

 

The recording, slides and demo script from the session on CIM cmdlets – Tuesday 27 March is available

https://skydrive.live.com/?cid=43cfa46a74cf3e96#cid=43CFA46A74CF3E96&id=43CFA46A74CF3E96%212955

Enjoy


March 26, 2012  11:38 AM

PowerShell Deep Dive 2012 Agenda

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

The agenda for the PowerShell Deep Dive next month has just been published on the PowerShell team blog

http://blogs.msdn.com/b/powershell/archive/2012/03/26/schedule-for-the-upcoming-powershell-deep-dive-and-a-few-videos-from-frankfurt.aspx

If you are already booked to go – looking forward to meeting you.  If you’re thinking of going last years event was amazing. If you are interested in PowerShell it is the place to be


March 25, 2012  5:09 AM

UG meeting reminder – March 2012

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Quick reminder that the UK user group meeting is on Tuesday 27 March @ 7.30 BST.  Details from

http://msmvps.com/blogs/richardsiddaway/archive/2012/03/06/uk-powershell-group-march-2012.aspx

 

The meeting is on the new CIM functionality in PowerShell v3.  This is a need to know technology as much of the new PowerShell functionality in Windows Server 8 is based on this.

Please double check the time as the UK switched to daylight saving time this weekend.


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: