header image

Archive for May, 2013

Still time to vote on event 4 – the numbers of votes are falling off slightly – especially in the Advanced events. This is your opportunity to observe what other people are doing, comment and very possibly learn.

under: Uncategorized

The final chapters of PowerShell Deep Dive have been added to the MEAP http://www.manning.com/hicks/ Enjoy

under: Books, PowerShell V3

The MEAP for AD Management in a Month of Lunches has been extended with the inclusion of chapter 11 – Creating Domain Controllers. www.manning.com/siddaway3 Enjoy

under: Active Directory, Books, PowerShell and Active Directory

Grading the scripts in Event 4 and the one thing that jumps out is the amount of unnecessary data being carried through the scripts You were asked for 7 properties off 20 random users Get-ADUser has a –properties parameter. USE it to restrict the properties you return. You don’t NEED all the other properties Next […]

under: PowerShell and Active Directory, PowerShell original, Scripting Games

I have heard some discussions recently regarding whether Win32_LogicalDisk or Win32_Volume should be used in the answer to event 3 in the Scripting Games. The problem requires you pull the drive letter, drive size and freespace for local disks on the server. Notice the emphasis – that will be important. Looking at Win32_Volume PS> Get-CimClass […]

under: PowerShell and WMI, PowerShell original, Scripting Games

One of the principles of writing scripts (or any code) is the KISS principle – Keep It Simple Scripter. That principle is being abused al lot in event 3 I am seeing numerous entries that define an advanced function as the solution and then inside the PROCESS block define one or more functions.  You PROCESS […]

under: PowerShell original, Scripting Games

In event 3 you have to get information on hard disk capacity.  I’ve only looked at the first couple of dozen scripts but seen this too many times Get-WmiObject -Class Win32_LogicalDisk | where DriveType -eq 3 or if you prefer the version 2 way Get-WmiObject -Class Win32_LogicalDisk | where {$_.DriveType -eq 3} If puppies get […]

under: PowerShell and WMI, PowerShell original, Scripting Games

I’ve seen a lot of this type of thing in events 1 and 2 $ErrorPref = $ErrorActionPreference $ErrorActionPreference = "Stop"   Don’t The default for $ErrorActionPreference is Continue.  This means that the error message is shown and the cmdlet attempts to continue. The possible values (from about_Preference_Variables) Stop:               Displays the error message and stops  executing. […]

under: PowerShell original, Scripting Games

I saw this in one of the submissions: $Properties = @{} $Properties[‘Computer’] = $SystemInfo.__SERVER $Properties[‘OperatingSystem’] = "$($OSInfo.Caption) – $($OSInfo.CSDVersion)" $Properties[‘PhysicalMemory’] = $SystemInfo.TotalPhysicalMemory   My immediate thought was the entrant likes making work for themselves. The hash table can be created in a much simpler manner $Properties = @{ Computer = $SystemInfo.__SERVER OperatingSystem = "$($OSInfo.Caption) – $($OSInfo.CSDVersion)" […]

under: PowerShell original, Scripting Games

Chapter 10 of AD Management in a Month of Lunches is now available. http://www.manning.com/siddaway3/ The chapter covers Fine Grained Password Policies

under: Active Directory, Books, PowerShell V3

Older Posts »

Categories