header image

Archive for June, 2011

I’ve always liked scripting against Active Directory as it has one of the potentially richest environments fro automation.  Normally I use the Quest or Microsoft cmdlets but every now and then its fun to back to using ADSI. I came a cross this problem: How do I get a user name and then force the […]

under: Active Directory, PowerShell and Active Directory

Modifying favourites

Posted by: | June 27, 2011 | No Comment |

if we use our get-favourite function to look at the content of favourite files   get-favourite | select -f 5 | foreach{""; get-content -Path $_.path}   we see this sort of structure [DEFAULT] BASEURL=http://www.bing.com/ [{000214A0-0000-0000-C000-000000000046}] Prop3=19,2 [InternetShortcut] URL=http://www.bing.com/ IDList= IconFile=http://www.bing.com/favicon.ico IconIndex=1   Not all files have the BASEURL or [DEFAULT] section but they do have […]

under: File System, PowerShellV2

Networking pains

Posted by: | June 26, 2011 | No Comment |

Last week my wireless router decided that it had enough and wasn’t going to work any more. This was annoying because I was due to give a user group presentation that night. I got a new router up and working but today discovered that connectivity from my Hyper-V environment wasn’t working. With the previous router […]

under: Hyper-V, Virtualization, Windows Server 2008 R2

In this post http://msmvps.com/blogs/richardsiddaway/archive/2011/06/26/1795135.aspx?CommentPosted=true#commentmessage I discussed using WMI to check the monitor’s brightness.  Further investigation has shown that not all monitors support the interface to WMI so it is a bit of trial and error to check if it does work on your machine

under: PowerShell and WMI

I recently showed how to generate a list of the favourites recorded on your system http://msmvps.com/blogs/richardsiddaway/archive/2011/06/24/viewing-favourites.aspx If like me you want to tidy these up from time to time it would be good not to have to search through all of them to perform the deletions using the GUI Lets turn our previous script into […]

under: PowerShellV2

  My main blog is now at http://msmvps.com/blogs/RichardSiddaway/Default.aspx but I also maintain http://richardspowershellblog.wordpress.com/ as a mirror and in case I want the two to diverge at some point. My recent posts on accessing Windows updates – especially when testing for available updates have raised a number of comments http://msmvps.com/blogs/richardsiddaway/archive/2011/06/12/windows-updates-4-tidy-up-get-update.aspx http://richardspowershellblog.wordpress.com/2011/06/12/windows-updates-4-tidy-up-get-update/ One very interesting question is […]

under: COM, PowerShellV2

I had the pleasure of meeting Microsoft’s Scripting Guy, Ed Wilson and his charming wife at the recent PowerShell Deep Dive. As well as being very nice guy Ed also has a huge depth of knowledge on scripting in general and PowerShell in particular. His Hey, Scripting Guy! blog is one of the few I read […]

under: PowerShellV2

Viewing favourites

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

I recently copied my favourites between machines which started me thinking about viewing favourites. Like many people I have generated a lot of favourites over the years – do I really need them all. Don’t know because I don’t know what they are.  Its easy to correct that $favs = New-Object -ComObject Shell.Application Get-ChildItem -Path […]

under: COM, File System, PowerShellV2

I recently saw a forum question about copying files where the file names where in a file Icreated a file with the full path to the files that need to be copied Get-ChildItem -path c:\test -Filter proc* | foreach {Add-Content -Value $_.Fullname -Path c:\test\files2copy.txt} the content of the file can be seen PS> Get-Content -Path […]

under: PowerShell Basics, PowerShellV2

I’ve been having a bit of difficulty getting code highlighted code into my posts recently. I use Live Writer to publish the posts and I was using an ISEadd-in published by Lee Holmes to paste the code. This has stopped working recently. Nor sure why. I remembered that the PowerShellPack of modules http://archive.msdn.microsoft.com/PowerShellPack included some […]

under: PowerShellV2

« Newer Posts - Older Posts »

Categories