header image

Archive for May, 2011

The root\wmi namespace contains a massive number of classes. Unfortunately there appears to be very little documentation available for these classes. Another issue is that many of classes do not appear to return anything (at least on my Windows 7 system – further testing is required). In this smalls series I intend to dig through […]

under: PowerShell and WMI, PowerShellV2, Windows 7

Event log cleanup

Posted by: | May 24, 2011 | No Comment |

If we look at the event logs   PS> Get-EventLog -List   Max(K) Retain OverflowAction        Entries Log   —— —— ————–        ——- —   20,480      0 OverwriteAsNeeded      19,975 Application   20,480      0 OverwriteAsNeeded           0 HardwareEvents      512      7 OverwriteOlder              0 Internet Explorer   20,480      0 OverwriteAsNeeded           0 Key Management Service    8,192      0 OverwriteAsNeeded           0 […]

under: PowerShellV2

In this post I showed my Advanced Function template  http://msmvps.com/blogs/richardsiddaway/archive/2011/05/13/powershell-module-construction.aspx I’ve since modified it to add the parameter validation methods. I can never remember them all so decided putting them in the template was the easiest way forward.   001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 […]

under: Modules, PowerShellV2

More Help

Posted by: | May 23, 2011 | No Comment |

I recently mentioned the update to the PowerShell help files that can be downloaded from the Microsoft web site. Tucked away in that file is a page entitled Windows PowerShell Features from Microsoft. Its worth downloading the help file for this page alone as it contains links to the major PowerShell features including: Core PowerShell […]

under: PowerShellV2

One thing that I saw in a script really made me sit up and take notice. The line of code was this   write-output $object | format-table   I looked at it several times before deciding that while it works it probably doesn’t deliver what the scripter thought it did. If we look at the […]

under: PowerShellV2

New PAM version

Posted by: | May 22, 2011 | No Comment |

I’ve added the 0.6 release of the PowerShell Admin Modules to codeplex – http://psam.codeplex.com/ This release adds two modules PAMADSNAPSHOT – functions for work with AD snapshots in Windows 2008 & 2008 R2 PAMLOAD – loads all of the PAM modules in one command Import-Module PAMLOAD –Force   Further releases are planned during the year

under: Modules, PowerShellV2, PSAM

Do you need to be able to delete local user accounts?  try this   001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 function remove-user { [CmdletBinding(SupportsShouldProcess=$true)] param (  [parameter(ValueFromPipeline=$true,    ValueFromPipelineByPropertyName=$true)]  [string]$computer,    [parameter(ValueFromPipeline=$true,    ValueFromPipelineByPropertyName=$true)]  [string]$id  […]

under: .NET

One of the standard troubleshooting tasks when investigating a problem is deciding if the machine can communicate on the network. The approach is usually ping the loop back address to check TCP/IP is working ping the machines own address ping the default gateway ping other servers This means running ipconfig to discover some of the […]

under: PowerShell and WMI

The simple touch

Posted by: | May 20, 2011 | No Comment |

A utility called touch has been used for many years to modify the creation, access or write time property on a file. The System.Io.FileInfo class enables us to do this. It gets easier because Get-ChildItem returns – guess what – System.Io.FileInfo The following properties can be modified CreationTime LastAccessTime LastWriteTime We can create a function […]

under: PowerShellV2

This made me smile

Posted by: | May 20, 2011 | No Comment |

The notice about browser age popped up today.  Look what I’m running.  Do they know something we don’t?  

under: General

« Newer Posts - Older Posts »

Categories