header image

Archive for January, 2010

Appending to a CSV file

Posted by: | January 19, 2010 | No Comment |

One of the frustrations of working with files in PowerShell is that you can’t append to a pre-existing CSV file. Dmitry has fixed that for version 2 by creating a proxy function that adds that capability. http://dmitrysotnikov.wordpress.com/2010/01/19/export-csv-append/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+DmitrysPowerblog+%28Dmitry%27s+PowerBlog%29 Excellent Technorati Tags: PowerShell

under: PowerShellV2

AD cmdlets qiuck reference

Posted by: | January 19, 2010 | No Comment |

If you use the AD cmdlets that shipped with Windows 2008 R2 you will want to grab a copy of the quick reference guide that Jonathan has produced. http://www.jonathanmedd.net/2009/10/active-directory-powershell-quick-reference-guide.html Technorati Tags: PowerShell,Active Directory

under: PowerShell and Active Directory

The UK PowerShell group will present a Live Meeting on PowerShell, WMI and WQL. Date: Tuesday 9th February 2009 Time: 7.30pm GMT Live Meeting details to follow Technorati Tags: PowerShell,User group

under: PowerShell User Group

I have a bit of a love-hate relationship with regular expressions.  If like me they are not your absolute favourite things you will want to see the series of recent posts from James on the subject http://blogs.technet.com/jamesone/archive/2010/01/14/the-joy-of-reg-ex-part-1.aspx http://blogs.technet.com/jamesone/archive/2010/01/14/the-joy-of-reg-ex-part-2-ways-i-use-it.aspx http://blogs.technet.com/jamesone/archive/2010/01/16/the-joy-of-reg-ex-part-3-select-string.aspx Technorati Tags: PowerShell,regular expressions

under: PowerShell original

So far we have only created a single table but in a database with a number of tables we need to be able to view the table definitions. 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 ## ## connect to database ## $conn = New-Object -ComObject ADODB.Connection $mydb = "c:\test\test03.mdb" $conn.Open("Provider = Microsoft.JET.OLEDB.4.0; […]

under: Office 2010, PowerShellV2

Add-Computer

Posted by: | January 12, 2010 | 3 Comments |

I was building some test machines yesterday and needed to add them to the domain. As they were Windows 2008 R2 with PowerShell v2 I decided to try Add-Computer. Add-Computer -DomainName mydomain -Credential mydomain\myaccount; restart-computer You will be prompted for the password. This only works on the local computer – you can’t add a remote […]

under: PowerShell and Active Directory, PowerShellV2

Hyper-V and Virtual PC

Posted by: | January 12, 2010 | No Comment |

Just a quick warning – be careful if you have virtual machines in virtual PC and switch to using Hyper-V.  Not sure what I did wrong (it was late last night) but managed to trash my virtual SQL Server There are instructions available – e.g. http://blogs.technet.com/andrew/archive/2008/06/30/migrating-a-virtual-machine-from-virtual-pc-to-hyper-v.aspx Technorati Tags: Hyper-V,Virtual PC

under: Uncategorized

Delete an index

Posted by: | January 10, 2010 | No Comment |

We have seen how to add indexes. We also need to be able to remove them 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 function Remove-AccessIndex { # .ExternalHelp Maml-AccessFunctions.XML [CmdletBinding()] param (     [string]$table,     [string]$index,     [System.Data.OleDb.OleDbConnection]$connection )     $sql = "DROP INDEX $index ON $table"     Write-Debug $sql         $cmd = New-Object System.Data.OleDb.OleDbCommand($sql, $connection) […]

under: Office 2010, PowerShellV2

 First meeting of 2010 and we will be looking at Windows 2008 R2 cmdlets and provider.Physical meetings will resume later in the year   When: Tuesday, Jan 26, 2010 7:30 PM (GMT)Where: *~*~*~*~*~*~*~*~*~* 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 […]

under: PowerShell User Group

Trouble with csv files

Posted by: | January 6, 2010 | 1 Comment |

There are many situations where we want to read a csv file as part of our admin script – usually as a way to input data to the script for some kind of bulk processing. This makes the following a fairly common task PS> import-csv -Path c:\test\csvtests\file1.csv | ft -a col1 col2 col3 —- —- […]

under: PowerShell original

« Newer Posts - Older Posts »

Categories