header image

Archive for July, 2010

This months meeting covered working with the registry. The slides and the demo script are available from http://cid-43cfa46a74cf3e96.office.live.com/browse.aspx/PowerShell%20User%20Group/2010%20July   The recording is available Richard Siddaway has invited you to view a Microsoft Office Live Meeting recording. View Recording Recording Details     Subject: PowerShell and the Registry     Recording URL: https://www.livemeeting.com/cc/usergroups/view     Recording ID: CB99JS     […]

under: PowerShell User Group, Registry

Tomorrow is the PowerShell UG Live Meeting on the Registry, PowerShell, .NET and WMI. Full details from http://msmvps.com/blogs/richardsiddaway/archive/2010/07/20/july-2010-ug-meeting-registry.aspx

under: PowerShell User Group

Most organisations have a degree of heterogeneity in their infrastructure for example: mainly Windows with a few Unix or Linux servers multiple versions of SQL Server because of application restrictions a mixture of fat client and thin client systems because of application and mobility drivers virtual and physical servers Cost can also be a contributing […]

under: Infrastructure

Registry 7

Posted by: | July 24, 2010 | No Comment |

One other aspect we need to cover is deleting individual values 001 002 003 $reg = [Microsoft.Win32.Registry]::LocalMachine $key = $reg.OpenSubKey("Software\PSAM PSAdmins\Test", $true) $key.DeleteValue("oops") Open the key for writing and use the DeleteValue() method.

under: PowerShell and .NET, PowerShellV2, Registry

Registry 6

Posted by: | July 24, 2010 | No Comment |

Having created some keys lets add some values 001 002 003 004 005 006 007 008 009 010 011 $reg = [Microsoft.Win32.Registry]::LocalMachine $key = $reg.OpenSubKey("Software\ITKE PSAdmins", $true) $key.SetValue("Dword Entry", 567 ,"Dword")  $key.SetValue("String Entry", "My new string" ,"String")  $key.SetValue("Expanded String Entry", "%COMPUTERNAME%" ,"ExpandString") [string[]]$multi = "Z","Y","X" $key.SetValue("Multi-string Entry", $multi ,"MultiString") $key = $reg.OpenSubKey("Software\PSAM PSAdmins\Test", $true) $key.SetValue("Oops", "Didn’t mean to do this" ,"String") This is very similar to the script we used to change the values – […]

under: PowerShell and .NET, PowerShellV2, Registry

Registry 5

Posted by: | July 24, 2010 | No Comment |

Having seen how to read, change and delete keys – lets add some   001 002 003 $reg = [Microsoft.Win32.Registry]::LocalMachine $key = $reg.CreateSubKey("Software\ITKE PSAdmins") $key2 = $reg.CreateSubKey("Software\PSAM PSAdmins\Test") Set the hive and call the CreateSubKey method.  Note the second example where we create a further depth of subkeys.  It isn’t necessary to create each step in the chain we can create […]

under: PowerShell and .NET, PowerShellV2, Registry

Registry 4

Posted by: | July 21, 2010 | No Comment |

Now is the time to delete a registry key 001 002 $reg = [Microsoft.Win32.Registry]::LocalMachine $key = $reg.DeleteSubKey("Software\ITKE PSAdmins") If there is a tree of subkeys then we can use the DeleteSubKeyTree() method

under: PowerShell and .NET, PowerShellV2, Registry

Registry 3

Posted by: | July 20, 2010 | No Comment |

Lets look at changing registry values. In http://msmvps.com/blogs/richardsiddaway/archive/2010/07/16/registry-1.aspx  I showed how to read the registry. We’ll change the 4 values we found in that post 001 002 003 004 005 006 007 008 $reg = [Microsoft.Win32.Registry]::LocalMachine $key = $reg.OpenSubKey("Software\ITKE PSAdmins", $true) $key.SetValue("Dword Entry", 567 ,"Dword")  $key.SetValue("String Entry", "My new string" ,"String")  $key.SetValue("Expanded String Entry", "%COMPUTERNAME%" ,"ExpandString") [string[]]$multi = "Z","Y","X" $key.SetValue("Multi-string Entry", $multi ,"MultiString")   Open the key as we did […]

under: PowerShell and .NET, PowerShellV2, Registry

How we can use PowerShell, WMI and .NET to work with the registry Notes Richard Siddaway has invited you to attend an online meeting using Live Meeting.Join the meeting.Audio InformationComputer AudioTo use computer audio, you need speakers and microphone, or a headset. First Time Users:To save time before the meeting, check your system to make […]

under: PowerShell User Group

Registry 2

Posted by: | July 18, 2010 | No Comment |

In the previous post I showed this line $reg = [Microsoft.Win32.Registry]::LocalMachine   which we used to determine which registry hive we would work with. LocalMachine is a member of the Microsoft.Win32.RegistryHive enumeration. An enumeration is a closed list. I’ve added this function to my profile 001 002 003 004 005 006 function Get-Enum { param (     [string]$class […]

under: PowerShell and .NET, PowerShellV2

Older Posts »

Categories