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 […]
Archive for June, 2011
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 […]
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 […]
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
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 […]
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 […]
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 […]
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 […]
PowerShell basics: using Get-Content to drive a copy
Posted by: richardsiddaway | June 24, 2011 | 1 Comment |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 […]
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 […]
Categories
- .NET
- Active Directory
- Architecture
- Azure
- Bash
- BITS
- Books
- CDXML
- CIM
- Cloud
- COM
- Containers
- Deep Dive
- Desired State Configuration
- DevOps
- DHCP
- DNS
- DSC
- European Summit
- Events
- Exchange
- File System
- Firewall
- General
- General IT Matters
- Hyper-V
- IIS
- Infrastructure
- IT Community
- IT Security
- Learning PowerShell
- Linux
- Math
- Microsoft
- Modules
- Nano Server
- Networking
- Office 2010
- Office 2013
- Open Source
- Opinion
- Outlook
- Philosophy
- PowerShell
- PowerShell 7
- PowerShell and .NET
- PowerShell and Active Directory
- PowerShell and CIM
- PowerShell and Exchange 2007
- PowerShell and IIS
- PowerShell and SQL Server
- PowerShell and WMI
- PowerShell Basics
- PowerShell original
- PowerShell Summit
- PowerShell User Group
- PowerShell User Group 2
- PowerShell v2
- PowerShell V3
- PowerShell v4
- PowerShell v5
- PowerShell v6
- PowerShell.org
- PowerShellGet
- PowerShellV2
- PSAM
- Rant
- Registry
- Scripting
- Scripting Games
- Scripting Games 2104
- Security
- SQL Server
- Storage
- Strings
- Summit
- Technology
- Uncategorized
- Virtualization
- Windows 10
- Windows 2012 R2
- Windows 7
- Windows 8
- Windows 8 Server
- Windows 8.1
- Windows Server
- Windows server 1709
- Windows Server 2008
- Windows Server 2008 R2
- Windows Server 2012
- Windows Server 2012 R2
- Windows Server 2016
- Windows Server 2019
- WMFv5
- WPF
- WSUS