PowerShell for Windows Admins:


August 14, 2014  2:01 PM

foreach

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

I was asked about foreach today and responded with a description of who foreach-object works. Thinking about it I should have realized that part of the issue with foreach is the confusion that arises between foreach and foreach - -  that is the difference between the foreach PowerShell statement...

August 12, 2014  10:29 AM

Can it -whatif

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

One of the nice things about PowerShell is that it can help you prevent mistakes. Many of the cmdlets that make changes to you system have a –whatif parameter that allows you to test your actions: £> Get-Process | Stop-Process -WhatIf What if: Performing the operation "Stop-Process" on...


August 11, 2014  1:44 PM

Select-Object or Where-Object

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Both Select-Object and Where-Object (referred to by their aliases of select and where from now on) are both used to filter data. It is important to know the way these 2 cmdlets are used. Where is used to restrict the objects on the pipeline to those where one or more properties satisfy the...


August 10, 2014  2:34 AM

Euorpean PowerShell Summit 2014 registration details

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

The European PowerShell Summit, organised by PowerShell.org, will be in Amsterdam September 29 - October 1 2014 at the Park Hotel. Details at 0 Comments     RSS Feed     Email a friend


July 3, 2014  2:58 PM

and finally

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

If you’re old enough and seen UK TV you’ll recognise the title but this post is about using try – catch blocks. Using try-catch this is a fairly normal construction try { Get-CimInstance -ClassName Win32_LogicalDisk  -ErrorAction Stop } catch { Throw "something went...


June 27, 2014  2:02 PM

Expanding server names

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

I had a comment left on my recent post – “Bad practices – making scripts needlessly interactive” asking how to deal with the situation of N servers consecutively numbered e.g. server01 to server05. Taking the script from that post as an example: [CmdletBinding()] param...


June 23, 2014  11:24 AM

Bad practices – making scripts needlessly interactive

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

the PowerShell community spends a lot of time talking about best practices when using PowerShell. I’m not convinced this approach is working as we keep seeing the same bad practices coming through on forum questions. I thought I’d turn the problem on its head and present a now-and-again series...


May 20, 2014  1:21 PM

Reading the trusted hosts list

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

One of the sessions I did at the recent PowerShell summit was on using the WSMAN cmdlets. In my experience, these cmdlets aren’t used much. This is for a couple of reasons I think – the syntax is a bit difficult and there are often other ways to perform the task. This short series of posts...


May 15, 2014  1:40 PM

Share Permissions – getting

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

I’ve written about working with share permissions a couple of times but a post on the forum (powershell.org) got me thinking about it again. This time I’m going to use the CIM cmdlets rather than the WMI cmdlets I’ve used in the past. My test machine has a test share called Test2April so...


May 14, 2014  1:09 PM

Domain Controllers and their sites

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Its relatively straightforward to find the domain controllers in your AD domain and its equally as straightforward to find the sites in your AD forest. Discovering which domain controllers are in which site is a bit more problematic. One way is look at the nTDSDSA objects. These are in the...


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: