-
Recent Posts
Archives
- May 2012 (26)
- April 2012 (21)
- March 2012 (65)
- February 2012 (94)
- January 2012 (54)
- December 2011 (17)
- November 2011 (11)
- October 2011 (15)
- September 2011 (39)
- August 2011 (57)
- July 2011 (58)
- June 2011 (65)
- May 2011 (53)
- April 2011 (25)
- March 2011 (12)
- February 2011 (18)
- January 2011 (27)
- December 2010 (2)
- November 2010 (14)
- October 2010 (13)
- September 2010 (1)
- June 2010 (11)
- May 2010 (31)
- April 2010 (29)
- March 2010 (19)
- February 2010 (31)
- January 2010 (28)
- December 2009 (11)
- November 2009 (40)
- October 2009 (2)
- September 2009 (8)
- August 2009 (21)
- July 2009 (21)
- June 2009 (27)
- May 2009 (32)
- April 2009 (24)
- March 2009 (41)
- February 2009 (42)
- January 2009 (34)
- December 2008 (30)
- November 2008 (40)
- October 2008 (42)
- September 2008 (52)
- August 2008 (40)
- July 2008 (35)
- June 2008 (38)
- May 2008 (29)
- April 2008 (32)
- March 2008 (59)
- February 2008 (43)
- January 2008 (47)
- December 2007 (30)
- November 2007 (62)
- October 2007 (54)
- September 2007 (43)
- August 2007 (44)
- July 2007 (55)
- June 2007 (57)
- May 2007 (55)
- April 2007 (43)
- March 2007 (61)
- February 2007 (50)
- January 2007 (21)
- December 2006 (7)
- November 2006 (16)
Categories
- .NET
- Active Directory
- Active Directory administration with PowerShell
- Architecture
- BITS
- Books
- COM
- Deep Dive
- DHCP
- DNS
- Events
- Exchange
- File system
- files
- Firewall
- General
- General IT matters
- IT Community
- IT Security
- Learning Powershell
- Math
- Microsoft
- Networking
- Office 2010
- Opinion
- Outlook
- Philosophy
- Powershell
- PowerShell and Active Directory
- PowerShell and Exchange 2007
- PowerShell and IIS
- PowerShell and SQL Server
- PowerShell and WMI
- Powershell Basics
- PowerShell User Group
- PowerShell V2
- PowerShell V3
- PSAM
- Rant
- Science Fiction
- Script of the Week
- Scripting
- SQL Server
- Strings
- Technology
- Uncategorized
- Virtualisation
- Walking
- Windows 7
- Windows 8
- Windows 8 Server
- Windows Server 2008
- Windows Server 2008 R2
- WPF
- WSH
Meta
Twitter
- Preparing for the next UG meeting - PowerShell in Server 2012 - too much to choose from 1 week ago
- Reading about regular expressions in #PowerShell . My head is exploding 1 week ago
- Sat in San Diego airport waiting to fly home after an awesome deep dive 3 weeks ago
- #PowerShell Deep Dive is over. Another awesome event. It's the only place I learn something from every session 3 weeks ago
- #PowerShell v3 jobs give many more options - results available across sessions in many cases 3 weeks ago
Category Archives: COM
Create a calendar item
Continuing the occasional look at Outlook automation its time to see how we create a calendar item function new-calendaritem { param ( [string]$mailbox, [datetime]$start, [datetime]$end, [string]$subject, [string]$location, [string]$body ) $outlook = New-Object -ComObject Outlook.Application $folder = get-mailfolders | where {$_.Path … Continue reading
Posted in COM, Networking, Outlook, PowerShell V2
Leave a comment
Controlling Firewall Rules
I decide that for this module I wanted some functions that control specific rule that I could be working with often e.g. Enable/Disable WMI rules and then I want a generic function for everything else. Lets start with some specifics. … Continue reading
Posted in COM, Firewall, PowerShell V2
Leave a comment
Firewall rules (OK)
The really important thing about our firewall is the rules that are configured. function get-rule { [CmdletBinding()] param () BEGIN{}#begin PROCESS{ $fw = New-Object -ComObject HNetCfg.FwPolicy2 $fw.Rules | foreach { $profiles = @() $ruleprofile = $_.Profiles @(1,2,4, 1073741824) | foreach … Continue reading
Posted in COM, Firewall, PowerShell V2
Leave a comment
Windows firewall
I normally leave the Windows firewall enabled in my test environment. It ensures I don’t forget it when testing. My recent session for the TechEd:Australia PowerShell conference involved me disabling various firewall rules on the subject machine to set up … Continue reading
Posted in COM, Firewall, PowerShell V2
2 Comments
Outlook Connector & mail folder item count
On my home laptop I use Live Mail to aggregate my hotmail accounts. On my travelling netbook I decided to try the Outlook Connector http://office.microsoft.com/en-us/outlook-help/microsoft-office-outlook-hotmail-connector-overview-HA010222518.aspx This add in enables you to access hotmail accounts from Outlook & because I’m using … Continue reading
Posted in COM, Office 2010, PowerShell V2, Windows 7
Leave a comment
IE history to CSV
Back in April last year I wrote a post about viewing IE history http://msmvps.com/blogs/richardsiddaway/archive/2010/04/13/ie-history.aspx I had a comment left asking how this could be put into a CSV file We’ll start by turning the script into an advanced function that … Continue reading
Posted in COM, PowerShell V2
3 Comments
Windows Updates: remote machines
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 … Continue reading
Posted in COM, PowerShell V2
3 Comments
Windows updates: 4 tidy up get-update
Looking at the get-update function we created earlier I wanted to tidy it up a bit. 001002003004005006007008009010011012013014015016017018019020021022023024025026027028029030031032033 function get-update {[CmdletBinding()] param ( [switch]$hidden ) PROCESS{ $session = New-Object -ComObject Microsoft.Update.Session$searcher = $session.CreateUpdateSearcher() # 0 = false & 1 = trueif ($hidden){ $result = $searcher.Search(“IsInstalled=0 and Type=’Software’ and ISHidden=1″ )}else { $result = $searcher.Search(“IsInstalled=0 and Type=’Software’ and ISHidden=0″ )} if ($result.Updates.Count -gt 0){ $result.Updates | select Title, IsHidden, IsDownloaded, IsMandatory, IsUninstallable, RebootRequired, Description}else { Write-Host ” No updates available”} }#process … Continue reading
Posted in COM, IT Security, PowerShell V2
5 Comments
Windows Updates: 3 Installing Updates
Now we have discovered the updates we have available we can think about installing them. 001002003004005006007008009010011012013014015016017018019020021022023024025026027028029030031032033034035036037 function install-update { $session = New-Object -ComObject Microsoft.Update.Session$searcher = $session.CreateUpdateSearcher() $result = $searcher.Search(“IsInstalled=0 and Type=’Software’ and ISHidden=0″ ) if ($result.Updates.Count -eq 0) { Write-Host “No updates to install”}else {$result.Updates | select Title} $downloads = New-Object -ComObject Microsoft.Update.UpdateColl foreach ($update in $result.Updates){ $downloads.Add($update)} $downloader = $session.CreateUpdateDownLoader()$downloader.Updates = $downloads$downloader.Download() $installs = New-Object -ComObject Microsoft.Update.UpdateCollforeach ($update in $result.Updates){ if ($update.IsDownloaded){ $installs.Add($update) }} $installer = $session.CreateUpdateInstaller()$installer.Updates = $installs$installresult = $installer.Install()$installresult } The function looks for non-hidden software … Continue reading
Posted in COM, IT Security, PowerShell V2
Leave a comment
Windows Updates: 2 Installed updates
Testing for installed updates is a variation on what we saw last time. This will show updates that Windows updates has installed – Get-Hotfix will show all updates that have been installed. 001002003004005006007008 function get-installedupdate {$session = New-Object -ComObject Microsoft.Update.Session$searcher = $session.CreateUpdateSearcher() $result = $searcher.Search(“IsInstalled=1 and Type=’Software’” ) $result.Updates | select Title, LastDeploymentChangeTime} The … Continue reading
Posted in COM, PowerShell V2
Leave a comment