Monday, February 4, 2013

Thunderbird using GMail Calendar for Meetings

I have been using Thunderbird for quite some time and have grown to like it very much.  The only issue I have had in the past is the ability to accept invitations.  I can easily receive and accept the invitations, but I don't want them stored on the local calendar, I want them stored on my Google calendar.  If I accept and copy/move the invitation, then all users get updates seeming to show me as the organizer.  I have tried to change this in the past, but I was unsuccessful, until today.

Most of the time, when accessing my Google calendar through Thunderbird  I was using lightning and the Provider for Google Calendar.  This sets up an iCal connection, and when I edited the config to make the Google Calendar the default, it never worked.  So, I have moved to a new method, setting up the calendar using a CalDAV connection and then modifying the config to make this calendar default.

Setup CalDAV 

I followed the information in this post to setup the CalDAV connection. 
  • Open your Calendar pane and select New Calendar from the menu on the left.
  • Choose On the Network
  • Select CalDAV from the options and for the location enter  https://www.google.com/calendar/dav[Your Google Calendar ID]/events
    • If you are using your standard calendar, Your Google Calendar ID is your email address.
    • Since I am using a specific calenader, I had to enter the Calendar ID found on the Calender Settings page, it will be [long string of number]@group.calendar.google.com
  • Click Next and complete the wizard.  

Google Calendar as Default

To set the newly created calendar as default takes a bit of under the hood configuration of Thunderbird.

  • Open Tools / Options / Advanced / Config Editor
  • Search for calendar.registry
  • You will be present with a list of items that show you all your calendars.  The one thing to pay attention to is the number in each string.  The values all relate to the same calendar.
  • Find the string associated with your current primary calendar and look for a value calendar.registry.[srting of numbers].calendar-main-default
    • Toggle this value to False
  • Find the string associated with the calendar you want to make your default.
    • There should be a string calendar.registry.[string of numbers].calendar-main-in-composite, right click on this and select Copy Name
    • Right click again and select New -> Boolean
    • In the preference pane, past the copied string and then modify it to say calendar.registry.[srting of numbers].calendar-main-default and click OK
    • When prompted for the value, set it to True
  • Restart Thunderbird 
Now when you accept an email invitation, you should be able to toggle which calendar the event will be applied

Friday, January 11, 2013

Local SMTP Testing

Setting up SMTP server on local windows machines for web services is a pretty simple task.  In Windows 2008 you have to remember to install IIS 6.0 tools to be able to manage the SMTP instance.

The issue I have been working with is just to make sure the SMTP server is actually sending out information. You can test it by using Telnet (which is not installed by default)

  1. From the command prompt, type: telnet localhost:25
  2. type: EHLO and press enter
  3. type: AUTH LOGIN if you are using credentials and enter the appropriate information
  4. type: MAIL FROM:somesender@somedomain.com (the mail address you are sending from)
  5. type: RCPT TO:somesender@somedomain.com (the mail address you are sending to)
  6. type: DATA Enter the information you want to have in the body of the message.
  7. Press Enter and type a single period (.)
If mail is working properly you will get a 250 2.6.0 infomration message and an email in your inbox.

Friday, December 14, 2012

Windows Hung Service

Today I had an issue where a windows service was stuck in a "starting" state.  Since this was an email server and the service in question was IMAP, doing a reboot wasn't a good option.  So i searched around and found this useful piece of information:

You can force kill an service if you know the services PID.
To get the PID, you can run the following to query the service and output them to a text file to make it easier to search.

  • sc queryex > C:\Running_Services.txt
Once the command completes, use a text editor (Notepad++) to find the service you are looking for.  You will see the Service Name, Display Name, and the PID.  Now that you know the PID, you can issue the following to kill the process.  For our example, lets say the PID is 12345
  • taskkill /PID 12345 /F

Now the process should be terminated, and a restart can be attempted.

Friday, November 9, 2012

BGInfo Useful Custom Strings

Recently I have been using BGInfo a bit more to get a better handle on what servers I am currently working on. Most of the time the standard definitions work well enough, but there are the few occasions when I want to show additional details or to hide information.

One such case that has come up often is when a server has multiple NICs, but only one is in use. BGInfo by default show all, so you have to add custom WMI queries to show only the info you want. I found a site that listed several useful queries as follows:

  • Active DNS - WMI Query - SELECT DNSServerSearchOrder FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Active IP - WMI Query - SELECT IPAddress FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Active MAC Address - WMI Query - SELECT MACAddress FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Active Subnet Mask - WMI Query - SELECT IPSubnet FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Manufacturer - WMI Query - SELECT Manufacturer FROM Win32_ComputerSystem
  • Model - WMI Query - SELECT Model FROM Win32_ComputerSystem
  • OS and Edition - Registry Value - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName
  • OS Architecture - WMI Query - SELECT OSArchitecture FROM Win32_OperatingSystem
  • OS Architecture XP2K3 - Registry Value - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE
  • Workgroup - WMI Query - SELECT Workgroup FROM Win32_ComputerSystem

I also added one of my own to show the IIS version on the desktop:
  • IIS Version - Registry Value - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\SetupString
Using these in combination with the predefined queries has allowed me to display all relevant information that I want.  

Tuesday, September 4, 2012

Enabling/Disabling NIC via Command line

I recently found that I need for my system to be on multiple VLANs at different times.  Now, my NIC supports this and it is fairly easy to do in Windows 7, but I wanted to make it easier.  To accomplish this I wrote a little batch file that simply enables or disables the network interface card via wmic.

The NIC is configured with the following commands:

  • To determine the index value (##)
    • wmic nic get name, index
  • To Enable
    • wmic path win32_networkadapter where index=## call enable
  • To Disable
    • wmic path win32_networkadapter where index=## call disable

I then have the batch file with a choice statement that allows me to select the option I want.

I found the original information on how to accomplish this task here.

Friday, August 3, 2012

Ghost Network Interface Cards

Recently, I imported a bunch of virtual machines.  After the import was complete, only one nic showed up under network adapters but when making any changes to the static IP's a warning was shown stating duplicate information.  After doing some digging, I found that there were actually 2 NICs in the system, but only one was being display.   I tried multiple ways to get the second card removed, but had no success until I came across a few posts mentioning devcon.

Using devcon you can perform the following command line options to remove the ghosted nic:

  • Run this command to list all the network hardware
    •  devcon findall =net  
  • This will output a bunch of information in the format PCI\VEN_xxxxx : Adapter Name
  • Copy the string before the colon.
  • Run the devcon command to remove the nic
    • devcon -r remove "@PCI\Ven_xxxxxx"


The biggest issue I ran into was getting devcon for the correct architecture.  The inital post I read linked to Microsoft for the x86 and ia64, but my systems were running x64.  So, I managed to find the tool on a Windows Server installation media for x64.  But I have also found it online as part of the Windows Driver Kit with instruction on how to extract it here How to Obtain the Current Version of Device Console Utility (DevCon.exe)

Thursday, March 8, 2012

DHCP Information

I came across a recent little command that helped me out a lot.  I was trying to determine all of the information of a DHCP server that had multiple reservations.  Now, I could use the management console and just export the IP and reservation name.  But this did not give me the MAC addresses or any additional information.  I also wanted to just have the basic info of the DHCP scope.  So, after some searching I found a fairly easy way to do it.  I ran the command:

netsh dhcp server dump >> C:\DHCP_Info.txt

This created a file DHCP_Info.txt in the root drive that contained all the information i needed.  I just had to parse the section that listed reservations and import it into a table.