Browse by Tags

All Tags » COM (RSS)

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 )...
Posted by RichardSiddaway | with no comments

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. If we look at the...
Posted by RichardSiddaway | with no comments
Filed under: , ,

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...
Posted by RichardSiddaway | with no comments
Filed under: , ,

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...
Posted by RichardSiddaway | with no comments
Filed under: , ,

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...

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...
Posted by RichardSiddaway | 1 comment(s)
Filed under: , ,

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...
Posted by RichardSiddaway | with no comments
Filed under: ,

Viewing favourites

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. ...

Windows Updates: 3 Installing Updates

Now we have discovered the updates we have available we can think about installing them. 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 function  ...
Posted by RichardSiddaway | with no comments

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. 001 002 003 004 005 006 007 008 function   get-installedupdate...
Posted by RichardSiddaway | with no comments
Filed under: ,

Windows Updates: 1 Discovering Updates

I want to spend a few posts looking at Windows updates. There is a COM object model that enables us to work with the updates system. Any update processing starts with discovering the updates that are available 001 002 003 004 005 006 007 008 function...
Posted by RichardSiddaway | with no comments
Filed under: ,

Path to files on start menu

I was asked today if it was possible the path to  recent files that are shown on the start menu. I thought it was easy until I started digging into it. The files on the start menu  are .lnk files and are in a binary format. 001 002 003 004 005...

Scripting Games Commentary: III PowerShell and Excel

Some of the events had the production of a CSV file as the end result with a bonus point if you opened the file in Excel. The quickest way and easiest way to open a CSV file in Excel is like this Invoke-Item -Path chapt4.csv   This will work if you...
Posted by RichardSiddaway | with no comments

Tuesday’s recording

The recording from Tuesdays UG meeting is available. Richard Siddaway has invited you to view a Microsoft Office Live Meeting recording. View Recording Recording Details Subject: PowerShell and COM objects Recording URL: https://www.livemeeting.com/cc...

COM pt 7–Items pt 2

In part 6 we looked at the drives collection on the FileSystemObject. The Items property was mentioned. Lets jump back to our Shell object $shell = New-Object -ComObject "Shell.Application"   if we do a Get-Member $shell | gm You will see...
Posted by RichardSiddaway | with no comments
Filed under:

COM pt 6–Collections pt 1

If we return to our filesystemobject $fso = New-Object -ComObject "Scripting.FileSystemObject" and look at the drives collection $fso.Drives   we will see a collection of drives. If we try to index into it $fso.Drives[0]   we get error...
Posted by RichardSiddaway | with no comments
Filed under: ,

COM pt 5–FileSystem Object

I haven’t finished with the WScript.Shell object and we will return to it.  This time I want to look at the FileSystem object. If you have worked with VBScript and files you will be familiar with this object.  While we have techniques in PowerShell...
Posted by RichardSiddaway | with no comments
Filed under: ,

COM pt 4

If you have been following along so far you may be thinking that you can use ls env: to view the environmental variables. True. But if you compare the output of part 3, the PowerShell enc: drive and getting the environmental variables via WMI you will...
Posted by RichardSiddaway | with no comments
Filed under: ,

COM pt 3–More shell

Last time we looked at the Environment parameterized property If you ran the script in part two the output would have contained things like windir=%SystemRoot% We need to be able to resolve the variable %SystemRoot% part to the full path 001 002 003 004...
Posted by RichardSiddaway | with no comments
Filed under: ,

COM pt3–WScript.Shell

One thing that we seem to forget when we use PowerShell is the functionality that was available to us in VBScript through the Windows Scripting Host (WSH) objects. Much of this functionality has been duplicated in PowerShell cmdlets or through .NET classes...
Posted by RichardSiddaway | with no comments
Filed under: , ,
More Posts Next page »