header image

Archive for August, 2011

We recently looked at dumping the Calendar entries http://msmvps.com/blogs/richardsiddaway/archive/2011/08/23/outlook-viewing-calendar-entries.aspx   I usually leave entries to build up in the Calendar but a simple clean operation is to delete everything that occurred before a certain date function remove-calendaritem { param ( [datetime]$date ) $outlook = New-Object -ComObject Outlook.Application get-mailfolders | where {$_.Path -like "*calendar*" -and $_.Path […]

under: Office 2010, Outlook

Network Adapter details

Posted by: | August 25, 2011 | No Comment |

In this post – http://msmvps.com/blogs/richardsiddaway/archive/2011/07/09/linking-the-network-card-to-the-registry-settings.aspx – I showed how to get the NetLuidIndex by linking the network card to the matching registry settings.  There is another way to get some that same information. function get-adapter { param( [string]$computer="." ) Get-WmiObject -Namespace root\wmi -Class MSNdis_EnumerateAdapter ` -ComputerName $computer | foreach { $nic = Get-WmiObject -Namespace root\wmi […]

under: Networking, PowerShell and WMI

Testing the network speed

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

In the last post I showed how to use the MSNdis_LinkSpeed class. Digging into the class information I found a suggestion that the speed returned was in Kbps. The answers didn’t look right especially when they suggested my wireless network was running at 540Mbps! At bit of experimentation produced this function test-linkspeed{ param( [string]$computer="." ) […]

under: Networking, PowerShell and WMI

Network Link Speed

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

The root\wmi Namespace contains a class that just returns the link speed of your network card. Quick and easy to use function. function get-linkspeed{ param( [string]$computer="." ) Get-WmiObject -Namespace root\wmi -Class MSNdis_LinkSpeed ` -ComputerName $computer | select InstanceName, @{N="Speed(Mbps)"; E={$_.NdisLinkSpeed/10000}} } The documentation I could find suggested that the NdisLinkSpeed property returned Kbps but that […]

under: Networking, PowerShell and WMI

Mailbox database status

Posted by: | August 23, 2011 | No Comment |

  A recent forum post on mailbox database status in Exchange 2007  proved interesting. If I do this PS> Get-MailboxDatabase -Status | select Name, server, storagegroup, mounted Name Server StorageGroup —- —— ———— MailDatabase EXCH07 EXCH07\Test1 MDB01 EXCH07 EXCH07\SG1 MDB02 EXCH071 EXCH071\SG2 but if I do this PS> Get-MailboxDatabase -Status | select Name, server, storagegroup, […]

under: PowerShell and Exchange 2007

We have seen how to view emails – this is how to view items in your calendar function get-calendaritem { $outlook = New-Object -ComObject Outlook.Application get-mailfolders | where {$_.Path -like "*calendar*" -and $_.Path -notlike "*birthday*"} | foreach { $targetfolder = $outlook.Session.GetFolderFromID($_.EntryID, $_.StoreID) $targetfolder.Items | foreach { New-Object -TypeName PSObject -Property @{ Folder = $targetfolder.FolderPath StartTime […]

under: Office 2010, Outlook

Tuesday August 30th 2011 at 9am EST there is a PowerShell conference at TechEd Australia.  Details from http://powershelldownunder.com/featured/teched2011/ The sessions will be available via Live meeting please register at above URL

under: PowerShellV2

Ping a subnet

Posted by: | August 22, 2011 | No Comment |

I recently needed to find which IP addresses were active on a subnet to track down a printer. Quickest way was to ping them.   function ping-subnet { param ( [parameter(Mandatory=$true)] [ValidatePattern("\b\d{1,3}\.\d{1,3}\.\d{1,3}\b")] [string]$subnet ) 0..255 | foreach { $address = "$subnet.$_" if (Test-Connection -ComputerName $address -Count 1 -Quiet){ Test-Connection -ComputerName $address -Count 1 } } […]

under: Networking, PowerShell and WMI

We cam use the [wmiclass] to create a process but it doesn’t allow us to set the credentials. We can get round that by using a bit of .NET code. [wmiclass] is as accelerator for System.Management.ManagementClass so we go back to basics function new-process { param ( [string]$computer="localhost", [string]$procpath="C:\Program Files\Internet Explorer\iexplore.exe" ) $conopt = New-Object […]

under: .NET, PowerShell and WMI, PowerShell Basics

Ethernet Errors

Posted by: | August 21, 2011 | No Comment |

While we are looking at the MSNdis_Ethernet* classes we should consider these three that pick up potential problems MSNdis_EthernetReceiveErrorAlignment MSNdis_EthernetOneTransmitCollision MSNdis_EthernetMoreTransmitCollisions   If all is well we will get an answer of zero for each of them – no errors and no collisions. Its a bit awkward working through each class in turn and we […]

under: Networking, PowerShell and WMI

« Newer Posts - Older Posts »