Steps to add a domain to Exchange

I host several domains on my server, including dpotter.net.  Recently I added another domain for a friend who is starting her own business.  I thought I remembered all the steps to provide both web site service and email service, but there was one I missed that I don’t remember being a requirement before.

For background, I’m running Microsoft Small Business Server 2003 with IIS 6 and Exchange Server 2003.  My box is also a domain controller, a DHCP server, a DNS server, an RRAS server, and a few other servers to boot.

First let me describe what I ran into and then I’ll list the steps I use to add a domain.  I added the domain so that Exchange could recognize it, added a user with a mailbox for my friend, and set up my spam filter (Exchange Hosted Services, aka Frontbridge) to allow traffic to the new domain to pass through it successfully.  However, whenever I tried to send email to the new user from an outside mailbox, I would get the following non-delivery report:

Unable to relay for (in reply to RCPT TO command)

After much hair-pulling and Internet searching, I ran across an article titled Multiple Email Domains on Exchange 2K3 – Relay Access Denied by James Montgomery.  It spelled out the extra step I had to take – update the IIS Metabase.  Huh?  I’d never had to do that before.  But it worked, so I’m a happy camper again.

Note that to modify the IIS Metabase you’ll have to download and install the IIS 6 Resource Kit.

Adding a domain
  1. Add the domain to Active Directory as a UPN suffix.  This will allow you to add users that can log in using the new domain.
    1. Run the Active Directory Domains and Trusts management tool from Administrative Tools (domain.msc).
    2. View properties of the root node in the console (titled Active Directory Domains and Trusts).
    3. Add the new domain and click the Add button.
  2. Add a new domain to the set of Internet message formats in Exchange System Manager.
    1. Run the Exchange System Manager tool from Administrative Tools.
    2. Open Global Settings.
    3. Right-click on Internet Message Formats, click New, then click Domain.
    4. Type the name of the domain in both the Name and SMTP domain fields.
    5. Click OK.
  3. Add a recipient policy for the new domain.
    1. Run the Exchange System Manager tool from Administrative Tools.
    2. Open Recipients.
    3. Right-click on Recipient Policies, click New, then click Recipient Policy.
    4. Select E-Mail Addresses and click OK.
    5. Type the name of the new domain in the Name field.
    6. Switch to the E-Mail Addresses (Policy) tab.
    7. Create a new smtp policy for the new domain.
      1. Click New and select SMTP Address.
      2. Type the name of the new domain with an at-sign before it (e.g. @mydomain.com) and click OK.
  4. Add the domain to the IIS Metabase.
    1. You may want to perform a backup of your metabase before proceeding.
    2. Open MBExplorer from the IIS 5 Resource Kit.
    3. Navigate to LM\SmtpSvc\1\Domain\.
    4. If the new domain is not in the list (which is probably will not be), add a key for the new domain.
      1. Right-click one of the other domains and click Copy.
      2. Right-click Domain and click Paste.
      3. Select Copy to a new key.
      4. Type the new domain name and click OK.
    5. Run the iisreset tool to reset IIS (click Start » Run, type iisreset, and press Enter).

Now you can create users that use the new domain in Active Directory Users and Computers and you can create web sites that use the new domain in IIS Manager.

Comments (3)

Configuring SQL Server after a rename

I’m in the process of moving to a two-machine development environment so my SQL Server processing will occur on one machine and my application will run on another machine.  I’m making this change since I’ve found that a single machine with 4GB can’t handle both processing 4 million records AND running an application that processes those 4 million records.

Anyway, this article isn’t about that.  It’s about how to configure SQL Server when you have to rename a machine.  I received my new machine which I made my development machine and moved my previous development machine over to be my database server.  The thought didn’t even cross my mind that I might need to do something special with SQL Server.  I already have a procedure that I know works every time for renaming a domain-joined machine:

  1. Leave the domain (aka join a workgroup).
  2. Rename the machine.
  3. Re-join the domain.

For the most part the machine seemed to do really well after performing those steps.  However, once I finally got my new development machine configured and attempted to connect to SQL Server, the real trouble began.

It turns out there that SQL Server doesn’t like it when you change the name of the machine.  I’ve run into this with other server software (e.g. Server Clusters, aka Wolfpack) so it’s not too surprising.  I found some articles on the Internet that seemed to claim that you can recover a SQL Server installation in this state (see Renaming a SQL Server by Brian Knight, written on 4/11/2001) but those steps didn’t work for me.  The article basically says to run the installation procedure to repair it, reboot, then run a couple stored procedures to change permissions (or something like that).  As I read through the article again to write this one, it appears that those steps are only necessary for SQL Server 7.0; I’m running SQL Server 2005!  Oh well.  What I found is that the repair option found some errors with ASP.NET.  Further trials revealed that I was unable to fix them by uninstalling and reinstalling IIS as simply uninstalling IIS 7 failed.

Fine.  I’ll do it the hard way.  I uninstalled SQL Server and reinstalled.  After a few reboots, ignoring warnings about SQL Server not working on Vista, and installing SP2, I finally got it up and running.

But my development machine still couldn’t connect to my database server.  Ugh!

Here’s the trick.  You have to enable remote access to the server.  I found a great article called SQL Server 2005 Remote Connectivity Issue TroubleShoot by Ming Lu on the SQL Server Protocols team at Microsoft.  Here’s how you do it.

Server Side
  1. Enable remote named pipes and/or TCP/IP.  This is done by running the SQL Server Surface Area Configuration tool which you can find under Microsoft SQL Server 2005 » Configuration Tools.  Click the Surface Area Configuration for Services and Connections link near the bottom of the window and you will be presented with another window where you can specify which services run, whether to start them automatically or not, and whether to support local connections only or local and remote connections.  While you’re here, set the SQL Server Browser service to start automatically.
  2. Restart the SQL server instance.
  3. If you enabled TCP/IP:
    1. Find the port SQL Server is listening on.  To do this, go to the Application event log and find a 26022 event that looks like this:
      Server is listening on [ 'any' <ipv4> 1433].
    2. Verify the server is listening on the correct port (1433 in my case).  Do this by running the following command in a command prompt window:
      netstat -ano | findstr 1433
  4. Make sure the SQL Server Browser service (aka SQLBrowser) is running.
  5. Firewall configuration:
    1. Enable File and Printer Sharing in the Firewall exception list.
    2. Either add the TCP port or sqlserver.exe (e.g. C:\Program Files\Microsoft SQL Server\MSSQL.1\Binn\sqlserver.exe) to the exception list in the firewall.
    3. Either add the TCP port 1434 or the SQL Browser service (e.g. C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe) to the firewall exception list.  Note that if you are running on a 64-bit platform this image is located below the Program Files (x86) folder.
Client Side

The article gives some steps to perform on the client side, although once I performed the server-side steps my problem was steps.  I’ll reproduce the steps here in case they are useful to someone.

  1. Verify your connection to the server (call it MYSERVER).
    1. Verify the client gets the correct IP address:
      ping MYSERVER
    2. Verify the connection on the port the SQL Server instance is listening on:
      telnet MYSERVER 1433
    3. Verify the client can access file shares on the server:
      \\MYSERVER
  2. Verify the SQL Native Client is configured to use the same protocols the server is listening on.
    1. Go to SQL Server Configuration Manager » SQL Native Client Configuration » Client Protocols.
    2. Make sure named pipes and/or TCP/IP are enabled to match the server.  It is recommended that you set TCP/IP above named pipes.
  3. If you are using MDAC (Drive={SQL Server} or SQLOLEDB.x) in your client application, you will want to run the cliconfg.exe program to enable TCP/IP and named pipes and to set the order so that TCP/IP is above named pipes.
  4. Use sqlcmd.exe to see whether connections work.
    sqlcmd -S MYSERVER -E

Hopefully my experiences will be helpful to others that run into this problem.  All this seems to be a lot more complicated than it should be – both renaming servers and enabling remote support.  Hopefully SQL Server 2008 will address these issues.

Comments (1)

NextGEN Gallery Review – Image Management

Image management is perhaps one of the strongest features of the NextGEN Gallery plugin compared with other image plugins, although until you learn a few concepts it can be a little difficult to use.

Definitions
  • Gallery – A collection of images.  Think of a gallery as a collection of images that are related, e.g. vacation photos or photos taken on a particular day.
  • Album – A collection of galleries.  An album is a good way to present multiple collections of related images together, such as photos taken on different days of your vacation.

Once you get these concepts straight, the user interface will fall into place.

Add Gallery

The first thing you will want to do is upload some images.  Before you can do that, you have to create a gallery.  You do that on the Add Gallery page.  Galleries are created below the path specified on the General Options page, typically wp-content/gallery/.  Creating a gallery actually creates a new folder on the server to store the images.

Choose the name of your gallery very carefully as once it’s been created it is very difficult to change it.  You’ll have to rename the folder on the server’s disk and then modify the gallery record in the database – not for the faint of heart.  I’d like to see the plugin modified to support this feature from the admin UI.

Adding Images

Once you’ve created a gallery you can add images to it.  There are four different ways to add images to a gallery, two by uploading them and two by copying them to a location accessible by WordPress and then scanning the directory.

Note that when uploading images, check that the php.ini file for your sever sets the maximum file upload size high enough.  Alex (the author of the plugin) recommends at least 16MB.  I set mine to 20MB.

  1. Upload images one or more at a time.  This is done from the Upload Images tab on the Add Gallery page.  (It seems like there should be a separate page for uploading images rather than on the Add Gallery page.)  From this page you can select which gallery and also whether to add metadata stored in images to the alt/title text field of each image.  With the latest versions of the plugin, you can select multiple files to upload and see progress of each image as it is being uploaded.  This is a huge improvement over previous versions which could even timeout if it took took long to upload.
  2. Upload a zip file of images.  This is done from the Upload a Zip-File tab on the Add Gallery page.  This can be useful when the link to your site is slow.
  3. Import a folder already on your web site.  This is done from the Import image folder tab on the Add Gallery page.
  4. Import images already in your gallery folder.  This is similar to the previous method but the images are already in the gallery folder.  To do this:
    1. Go to the Manage Gallery page.
    2. Click on the Edit link for your gallery.
    3. Click the Scan Folder for New Images button.
Managing Images

Once you get images into a gallery, you can perform a number of different operations on them.  Probably the first thing you’ll want to do is to annotate them.  While you’re at it you may as well add a description to your gallery.

The Manage Gallery page provides a lot of flexibility and allows you to make a lot of changes at once.  One thing you’ll want to be careful of, however, is to avoid doing to many operations that take a lot of time, such as regenerating thumbnails.  Doing so can cause the operation to timeout.

Here is a summary of the operations that can be performed on images on the Manage Gallery page.

  • Specify a description for each image.  This text can be displayed under thumbnails as well as in slideshows.
  • Specify alternate title text for each image.  This text can be displayed under thumbnails as well as in slideshows.
  • Exclude images from being displayed on gallery pages.
  • Specify tags for images.  Specifying a tag allows it to be displayed as a related image for posts that use the same value for its category or tag.
  • Delete an image.  The image file itself will only be deleted if the Delete image files option is enabled on the General Options page.
  • Set a watermark on selected images.
  • Generate (create) new thumbnails for selected images.  This is especially useful when you change the thumbnail options.
  • Resize images.  This is useful when you set resize parameters on the Images option page.
    • It would be nice if resize parameters could be specified at the time that images are resized or as part of the gallery rather than in one place for all images.
  • Import metadata (e.g. EXIF, IPTC, or XMP data) from images and set it in the alternate title text field.
  • Scan the folder for new images as described above.

Here is a summary of the operations that can be performed on the gallery on the Manage Gallery page.

  • Edit the name and description of the gallery.
  • Edit the path (although this only changes the path, it doesn’t rename it).
  • Link the gallery to a page which can be displayed when the gallery is clicked on when viewing an album.  I mistakenly linked the gallery to the page displaying the album.  The correct thing to do is to link it to a different page than the page displaying the album.
    • Note that this page is only used if the Deactivate gallery page link checkbox is unchecked on the Gallery Options page.
    • In order to display the contents of the gallery on the page you specify, you need to specify a shortcode, like this:
      [gallery=#] where # is the ID of the gallery.
  • Specify a preview image that will be displayed when albums to which the gallery belongs are displayed.  By default no image is displayed.  You can select one of the images in the gallery.
  • Create a new page for displaying the gallery.
  • Delete the gallery.
Albums

An album is a nice way to display a list of galleries.  To create an album

  1. Go to the Album page.
  2. Type the name of your new album.
  3. Click the Update button.

Note that there isn’t any way to rename an album through the UI once you’ve created one, which is unfortunate, although I haven’t seen any place where the name of the album is actually displayed.

Once you’ve created an album, you can drag galleries from the Select Gallery box to the Album Page box.  The UI also allows you to rearrange galleries in the album by dragging and dropping.  This is a very nice interface and easy to use once you figure out that you can drag and drop.  Yes, there is some text describing that, but every time I teach someone how to use it I end up having to show them how to use this page.

Comments (164)

NextGEN Gallery Review – Configuration

There are a lot of options available in this plugin.  To configure it, you find a top-level Gallery menu in the admin menu.  The main page looks very similar to the WordPress Dashboard page.  The one thing that is missing is a link to the plugin page itself.

Before you do anything else, go to the Options sub-page.  From here you’ll notice a number of options pages for configuring different parts of the plugin, including General, Thumbnails, Images, Gallery, Effects, Watermark, and Slideshow.

General Options
  • Gallery path
    Most people won’t have to change this.  I needed to because I share the same WordPress installation using a modification of MultiBlog by Stephen Rider, so the default location (wp-content/gallery/) would place the images for all sites using that installation in the same directory.
  • Delete image files
    Check if you want to the image files to be deleted from the disk when you delete images from a gallery.  Disabled by default.
  • Activate batch upload
    Allows you to specify multiple image files to upload in a single batch.  Requires Adobe Flash 9.  This provides a major improvement in the upload experience.  Disabled by default.
  • Activate permalnks
    Check this if you want nice permalinks to be generated for galleries and images.  After checking this you have to regenerate permalinks.  Disabled by default.

    • If your WordPress site is hosted on IIS, you won’t be able to check this checkbox unless you’ve purchased a product that gives you the .htaccess features of Apache.
  • Activate related images
    Check this to have the plugin generate a section at the end of posts for images whose tag matches the post’s tag or category (see the next option).  Pretty cool!  One problem I found is that the background behind the images is white which may not match your theme.  Disabled by default.
  • Match with Categories or Tags
    Specifies whether you want an image’s tag to be matched against a post’s category or tag.  Defaults to Category.
  • Max. number of images
    Specifies the maximum number of images to show with each post.  Specifying 0 will show all images.  This value defaults to 7.
Thumbnails

After making changes to thumbnail options, you will need to regenerate thumbnails in all galleries.

  • Width x height (in pixels)
    Specifies the maximum width and height for thumbnail images.  The default is 100 x 70.  I like larger thumbnails so I specify 128 x 128.
  • Set fixed dimensions
    Ignores the aspect ratio of images and generates a thumbnail to the exact dimensions specified above.  Disabled by default.
  • Crop square thumbnail from image
    Creates square thumbnails.  The note on the page says to use only when the dimensions are set to 128 x 128.  I’m not sure what happens if the dimensions are set to something else.  Hopefully it fails gracefully.  Disabled by default.
  • Thumbnail quality
    This is a percentage of maximum quality.  I haven’t played with this so I can’t comment on how it works.  Defaults to 100%.
  • Resample mode
    Specify a value between 1 and 5, with higher values using more CPU.  I haven’t played with this so I can’t comment on how it works.  Defaults to 3.
Images
  • Resize images
    Specifies the width and height that images will be resized to.  These are maximum dimensions and aspect ratio is maintained.  Images are only resized when you choose to do that specifically.  Images are not resized when you upload them.  Defaults to 800 x 600.
  • Image quality
    This is a percentage of maximum quality.  I haven’t played with this so I can’t comment on how it works.  Defaults to 85%.
  • Resample mode
    Specify a value between 1 and 5, with higher values using more CPU.  I haven’t played with this so I can’t comment on how it works.  Defaults to 4.
  • Cache single pictures
    When using the singlepic tag, the image is resized for display on the page based on the values specified with the tag.  If this is checked, those images will be cached for each singlepic setting, which will improve load times and CPU loads on subsequent page loads.  I haven’t played with this so I can’t comment on how well it works.  Disabled by default.
  • Clear cache folder
    Push button that allows you to clear the cache.
Gallery
  • Activate jQuery navigation
    You should not check this box.  Alex’s advice to anyone who ever checked it is to disable it.  My advice to Alex is that if it shouldn’t be used, he should remove it before releasing each version.  Disabled by default.
  • Deactivate gallery page link
    When enabled, clicking on a gallery (e.g. in an album) will cause the gallery to be displayed on the same page.  When disabled, the page you have associated with the gallery will be displayed.  Enabled by default.

    • I’ve made some changes to this behavior which I’ll describe later.
  • Number of images per page
    Specifies how many images are displayed on a gallery page.  All images are displayed if 0 is specified.  Defaults to 0.
  • Integrate slideshow
    Allows visitors to switch between viewing the thumbnails in the gallery and viewing the pictures as a slideshow.  You can also specify the text that is displayed to switch between the two modes.  Enabled by default.
  • Show first (thumbnails, slideshow)
    Specifies what to view first when a gallery is displayed.  Defaults to Thumbnails.
  • Show thumbnail description
    Specifies what to display under thumbnails in a gallery.  Defaults to None.

    • None – Just the thumbnail is displayed with no text.
    • Description text – The text entered in the description field for each image is displayed under the thumbnail.
    • Alt/Title text – The text entered in the alt/title text field for each image is displayed under the thumbnail.
  • Show ImageBrowser
    If enabled, a larger version of the image will be displayed on the page when clicking on an image.  If not enabled, what looks like a pop-up window is displayed in the middle of the page to display the image and the page behind it goes dark.  I much prefer the non-ImageBrowser effect (disabled).  Disabled by default.
  • Sort thumbnails
    Specifies how thumbnails are sorted when displayed in a gallery.  Defaults to Image ID.

    • Image ID – Sorts thumbnails by the ID of the image.  This works well if you import them in the order you want them displayed.
    • File name – Sorts thumbnails by the name of the image file.  This works well if your image files are named the way you want them sorted.
    • Alt/Title text – Sorts thumbnails by the alt/title text specified for each image.  This defaults to the name of the image file or to the EXIF data if you specified that during import, but you can change this at a later date.
  • Sort direction
    Specifies the direction for sorting (ascending or descending).  Defaults to Ascending.
Effects

This page has a note about Thickbox being the only effect that is added to the theme.  I’m not sure what this actually means, it could mean that you have to install something before the other effects will actually work.  It would be handy if there was a pointer to the other effects on this page.

  • JavaScript thumbnail effect
    Selects the effect to use when clicking on a thumbnail.  Choices include None, Thickbox, Lightbox, Highslide, Shutter, and Custom.  Although it’s not clear from the UI (because it’s always editable), it appears that selecting Custom allows you to modify the style used (in the Link code line box).  I’ve only tried Thickbox so I can’t comment on the others.  Defaults to Thickbox.
  • Link code line
    Shows the code that will be used to display images when the visitor clicks on a thumbnail.  The text is always editable, but it may only be saved when Custom is selected for JavaScript thumbnail effect.
  • Select loading image
    This option is only displayed when JavaScript thumbnail effect is set to Thickbox.  Two options are displayed – a series of dots in a circle and a horizontal bar that looks like a progress bar moving like a barber pole.  The latter is the default.
Watermark

These options allow you to add a watermark to images.  There’s a note at the top of this page saying that once a watermark is added it can’t be removed.  Watermarks are added from the Manager Gallery page.< You can choose to add either an image or text as a watermark.  There are several additional options if you select text, such as font, size, color, and opacity.

Slideshow

The options on this page configure how NextGEN Gallery displays slideshows using JW Image Rotator.  Alex provides a nice link to the options that can be set on the rotator (http://www.jeroenwijering.com/?item=JW_Image_Rotator).  I’ll summarize the options here as they appear on the Slideshow option page.

  • Default size (W X H)
    Specifies the default size of the slideshow.  This is the size at which slideshows are displayed.  Defaults to 320 x 240.
  • Shuffle mode
    If enabled images are displayed in a semi-random order.  Otherwise they are displayed in the order specified by the sorting options on the Gallery page.  Disabled by default.
  • Show next image on click
    When enabled, causes the next image to be displayed when the current image is clicked.  Enabled by default.
  • Show navigation bar
    When enabled, shows a bar about 1/5th of the way up from he bottom that displays the description in the middle and arrows on either side for navigating between pictures.  When using the default slideshow size, I found the navigation bar to be too distracting.  It might be more useful on larger slideshows.  Disabled by default.
  • Show loading icon
    I didn’t see a difference whether this was enabled or disabled.
  • Use watermark logo
    Uses the settings on the Watermark options page to add a watermark to each image in the slideshow.  I suspect it is only added to the scaled version being displayed, not the original version stored in the gallery.  Disabled by default.
  • Stretch image
    Allows you to specify how images that have a different aspect ratio than the slideshow.  For example, this is useful for determining how portrait images should be displayed.  I found that no option had any effect whatsoever; portrait images were always stretched to fit the slideshow area.  Defaults to true.  From the JW Image Rotator page:

    • true – stretch images proportionally to fit the slideshow area.
    • false – stretch images to fit the slideshow area (I’m not sure how this differs from fit)
    • fit – stretch images disproportional to fit the slideshow area.
    • none – keep original dimensions.
  • Duration time
    Specifies how many seconds each image should be displayed before moving on to the next one.  Defaults to 10 seconds.
  • Transition / fade effect
    Specifies how to transition from one image to another.  Defaults to random.

    • fade – fades one image out as the new image fades in.
    • bgfade – fades to the background color and then fades to the new image.
    • slowfade – like fade only slower.
    • circles – displays rotating circles that grow larger to reveal the new image underneath.
    • bubbles – displays rising bubbles that grow larger to reveal the new image underneath.
    • blocks – displays blocks that move from one corner to the opposite corner to reveal the new image underneath.
    • fluids – like bubbles only from the center, as if liquid has been spilled on the image.
    • flash – quickly flashes to white and then fades the new image in.
    • lines – displays vertical lines that move left and right to reveal the new image underneath.
    • random – randomly selects a transition effect for each transition.
  • Use slow zooming effect
    This enables a very cool effect that zooms into the images a little bit and then moves across them.  Disabled by default.
  • Background color
    Specifies the color of the background for slideshows and for image popups.  Defaults to black (000000).
  • Text/button color
    Specifies the color for text and buttons.  Defaults to white (FFFFFF).
  • Rollover/active color
    Specifies the color of text and buttons when rolling over them.  Defaults to red (CC0000).
  • Screen color
    Not really sure here as by default there is no numeric value.  It looks like it uses white, though.
  • Background music (URL)
    A URL to a music file to play while the slideshow is playing.
  • Try XHTML validation (with CDATA)
    I didn’t try this so I can’t comment on it.  There is a comment next to this option saying that it could cause problems with some browsers.

Comments (93)

NextGEN Gallery Review – Installation

The installation instructions in the readme.txt file indicate that the plugin should be copied to a folder called nggallery, but Alex must have removed that requirement since writing that as the code clearly allows the plugin to be installed in any directory below wp-content\plugins.  I initially installed it in the nextgen-gallery directory and it worked fine.

Before the plugin will work, you need to install JW Image Rotator in the NextGEN Gallery plugin directory.  You can get that from http://www.jeroenwijering.com/.  Once you’ve downloaded it, just copy the imagerotator.swf file to the NextGEN Gallery plugin directory.

Now you can activate the plugin.  You’ll notice that there are two NextGEN plugins – a NextGEN Gallery plugin and a NextGEN Gallery Widget plugin.  If you want to display images on your sidebar, activate the widget plugin as well.

Comments (52)

NextGEN Gallery Review – Introduction

I’d been looking for a better way to manage and display photos on my blogs when I ran across Alex Rabe’s fantastic NextGEN Gallery plugin.  It provides a comprehensive interface for managing photos and images through a set of admin pages, and it displays photos in a way that makes your web site look very professional.

Overall Grade: A+
Plugin Name: NextGEN Gallery
Plugin URI: http://alexrabe.boelinger.com/wordpress-plugins/nextgen-gallery/
Download URI: http://wordpress.org/extend/plugins/nextgen-gallery/
Version: 0.83
Description: A NextGENeration Photo gallery for the WEB2.0(beta)
Author: Alex Rabe
Author URI: http://alexrabe.boelinger.com/
Support Forum: http://alexrabe.boelinger.com/forums/

Alex has some good information on his site about this plugin.  I will fill in some of the details in this series of articles.

Comments (125)

Calling static methods

PowerShell is extremely flexible in what it allows you to do, even allowing you to call static methods on just about any class in just about any assembly.  The problem I had was that I couldn’t remember what the syntax was.  I seemed to recall that it included a double colon (::) but beyond that I was stumped.  A short trip to Google led me to the Windows PowerShell blog.  Here’s the syntax:

[full-type-name]::method-name(parameters)

For example:

PS C:\> [System.IO.Path]::GetDirectoryName("C:\Windows\Fred")
C:\Windows

Note that since there are no using statements in PowerShell like there are in C#, you must specify the full name, including all namespaces, for the type.  Thus you can’t simply specify [Path] but instead must type [System.IO.Path].  Case is not important, however, so you could also type [system.io.path]::getdirectoryname and get the same result.

You can see what methods are available on a static class by using the -Static parameter to the Get-Member cmdlet:

PS C:\ > [System.IO.Path] | Get-Member -Static

    TypeName: System.IO.Path
Name                        MemberType Definition
––––                        –––––––––– ––––––––––
ChangeExtension             Method     static System.String ChangeExtension(String path, String extension)
Combine                     Method     static System.String Combine(String path1, String path2)
Equals                      Method     static System.Boolean Equals(Object objA, Object objB)
GetDirectoryName            Method     static System.String GetDirectoryName(String path)
GetExtension                Method     static System.String GetExtension(String path)
GetFileName                 Method     static System.String GetFileName(String path)
GetFileNameWithoutExtension Method     static System.String GetFileNameWithoutExtension(String path)
GetFullPath                 Method     static System.String GetFullPath(String path)
GetInvalidFileNameChars     Method     static System.Char[] GetInvalidFileNameChars()
GetInvalidPathChars         Method     static System.Char[] GetInvalidPathChars()
GetPathRoot                 Method     static System.String GetPathRoot(String path)
GetRandomFileName           Method     static System.String GetRandomFileName()
GetTempFileName             Method     static System.String GetTempFileName()
GetTempPath                 Method     static System.String GetTempPath()
HasExtension                Method     static System.Boolean HasExtension(String path)
IsPathRooted                Method     static System.Boolean IsPathRooted(String path)
ReferenceEquals             Method     static System.Boolean ReferenceEquals(Object objA, Object objB)
AltDirectorySeparatorChar   Property   static System.Char AltDirectorySeparatorChar {get;set;}
DirectorySeparatorChar      Property   static System.Char DirectorySeparatorChar {get;set;}
InvalidPathChars            Property   static System.Char[] InvalidPathChars {get;set;}
PathSeparator               Property   static System.Char PathSeparator {get;set;}
VolumeSeparatorChar         Property   static System.Char VolumeSeparatorChar {get;set;}

Leave a Comment

XStreamHD

This past weekend I was catching up on all things home theater on AVS Forum when I ran across a company (XStreamHD) that is promising to deliver hi-def movies and more via satellite and the Internet to your home.  The information provided by the flash content on their web site is pretty impressive.  Here’s a snippet from their press release on 1/8/2008 at the CES show in Las Vegas:

XStreamHD is leading the Full HD revolution with the first transport network to bring 1080p video and 7.1 channels of lossless audio directly to the home via satellite.  Never before has there been a home theater experience that combines all of the features, quality, value, and convenience that consumers want.  XStreamHD offers affordable access to the highest quality HD movies, music, broadcast TV, electronic games, and more – without the limitations of programming schedules, storage space, or physical media, and without the hassles of video rental stores, slow mail service, or out-of-stock titles.  With XStreamHD, consumers will never miss the new releases or the broadcast HD content they love.  The hottest movies and new releases are delivered via satellite, while vintage titles may be delivered over a broadband Internet connection.

With XStreamHD, consumers can build a customized, unique, and unparalleled in-home entertainment network and enjoy the content they want most, when it’s most convenient, anywhere in the home, and at the quality today’s home theaters were designed to support.  Only XStreamHD‘s proprietary technology delivers video in Full HD (1080p) – twice the quality of current cable and satellite offerings – and up to 7.1 channels of lossless audio achieving sound quality that is identical to the studio master and surpassing any other direct-to-home service available.

They are implementing this with a media server, much like a media server by SnapStream (ala Beyond TV) or Microsoft (ala Windows Media Center).  However, their server has 3 ATSC tuners and a PBX.  Here’s the feature list from their site:

  • Satellite delivery of Full HD 1080p video, MPEG-2 or MPEG-4/H.264 in 4:3 or 16:9 screen formats
  • Satellite delivery of up to 7.1 channels 96kHz/24bits of lossless DTS-HD™ Master Audio
  • View four Full HD video streams simultaneously throughout the home
  • Learns users’ choices and preferences to adopt their entertainment profile and continuously updates the Virtual Personal Library™ with titles they’re likely to enjoy
  • Equipped with three ATSC tuners and a Network Video Recorder for viewing and recording three HDTV broadcasts at the same time – even while watching a fourth selection from your Virtual Personal Library™
  • Patent Pending Adaptive Recording™ ensures accurate recording of HDTV programs from start to finish, even if broadcast schedules change or are delayed
  • Easy-to-use on-screen menus to manage content preferences, parental controls, spending limits
  • DLNA v1.5 certified to integrate all compatible devices on the XStreamHD network
  • Dual slide-in drive bays enable scalable storage featuring Seagate® Technology hard drive storage – 500GB, 1 TB, 2 TB options – and the ability to configure an external storage subsystem via the eSATA interface
  • Includes a feature-rich Personal PBX business-class phone system; also supports VoIP calls and offers free calls between XStreamHD subscribers
  • Uses gigabit Ethernet (GigE) permitting the transfer of HD video and audio at 1 gbps throughout the home
  • HDMI interface simplifies installation and ensures signal integrity for vibrant 1080p video
  • Front panel USB port for MP3 audio downloads

They then depend on small fanless units connected to TVs throughout the house to stream video from the server.

It’s a pretty impressive product, especially if it is priced right and is reliable.  Here’s their pricing and availability blurb:

The XStreamHD solution will be available to consumers in early Q4 2008. The introductory price for a complete XStreamHD home solution, including a Media Server and a Media Receiver, is available to initial subscribers starting at just $399.

Commentary

Probably the biggest thing I would be concerned about is storage.  While 2TB sounds like a lot, large DVD collections wouldn’t fit on that, much less large hi-def collections.  I also wonder what kind of archiving would be allowed.  Could the content be burned to a Blu-ray disc?  Could it be copied to another computer or server?

Another concern is whether the satellite(s) would be reliably available and how reliable the end-to-end solution would be.  I’m currently using Windows Media Center and Beyond TV on Windows Vista and it’s not completely reliable.  It works and the quality is amazing, but if I’m not around at the wrong time my family is still paralyzed.  As a turnkey system, XStreamHD may actually prove to be the thing my family needs.

Overall, though, this looks like a fantastic solution, and I’m really looking forward to hearing more about it.

Leave a Comment

Testing out the Firefox waters

Based on the experience of a colleague, I decided to try out Firefox.  It was partially motivated by problems he was having viewing my blog in Firefox.  Installing it also gave me a way to verify what others see when they view my blog.

Some of the add-ons are pretty cool as well.  Here are the ones I’ve installed:

  • CallingID – Shows the owner of a web site and if it is safe to buy or login there.  This also works on IE.
  • DOM Inspector – Inspects the structure and properties of a window and its contents.  This was automatically offered when I installed Firefox.
  • Download Statusbar – View and manage downloads from a tidy statusbar.  Nice add-on for minimizing the number of windows that are displayed.  Takes a little getting used to, though.
  • Firebug – Very cool add-on for exploring CSS on a page.  I wished I’d had this before I’d started working on this theme.
  • Flashblock – Replaces Flash objects with a button you can click to view them.  This allows you to only see Flash objects when you want to.
  • IE Tab – Enables you to use the embedded IE engine within Mozilla/Firefox.  Allows pages that only work in IE to be displayed properly.  Adds a button in the lower right corner of the status bar that allows you to switch between a Firefox rendering and an IE rendering.  Very cool!
  • LinkedIn Companion for Firefox – Provides some pretty cool integration with the LinkedIn.com web site.
  • PDF Download – Allows you to choose what to do with a PDF file: download it, view it with an external viewer or view it as HTML.
  • Talkback – Sends information about program crashes to Mozilla.  This was automatically offered when I installed Firefox.  I like being a good citizen and helping the developers by giving them more data to analyze crashes which might improve the product, so I installed this one.
Things I like
  • The add-on feature in Firefox and the availability of add-ons seems to be a lot better than in IE.  The selection of add-ons is amazing.  In particular, I’m especially impressed with IE Tab, Firebug, and Flashblock.
  • I really like that Firefox remembers all the pages and tab histories when it restarts after restarting or crashing.  You can also configure it to reload the pages from the last time it was running.  Very cool!
  • The type-ahead on the address bar seems to be smarter and quicker than the feature in IE.
  • Firefox has a built-in spell check for text controls with a red dotted line.  Very nice.
Things I don’t like

All is not a bed of roses, however.  I’ve run into a number of problems using Firefox that I didn’t encounter using IE7.  Some of these are Firefox issues and some could be web site issues.

  • Minor nit:  I really like the blank tab in IE7 which you can use to open a new tab.  In Firefox you have to right click on the tab bar (if it is being displayed) and select New Tab, Click File and select New Tab, or press Ctrl+T.  Admittedly this is just one more click, and I’ll probably get used to it, but it’s annoying nevertheless.
  • Minor nit:  I think the tab bar in IE7 looks a lot better than the one in Firefox.  Like a said, minor nit :-)
  • Some pages display very badly in Firefox that display just fine in IE7.  While preparing this article, I went to the CallingID page, which has 4 errors in Firefox which prevent all graphics from being displayed, and I couldn’t figure out a way to get it to be displayed correctly.  Their site is almost completely useless for me in Firefox.
  • Firefox doesn’t know how to display .MHT files.  These are single file web pages that can be produced by Microsoft Office applications like Word and Excel.  It is very convenient to save a Word document as an .MHT file so that it can be viewed in a web browser.  Well, it looks like that is pipe dream.  This is actually rather upsetting as I was depending on this functionality in several places.  Yes, I could save documents as HTML files, but then all the associated content gets saved in a subdirectory below the directory holding the HTML file.  Yuck!
    • IE Tab to the rescue!  I found this add-on while griping about this problem :-) .  .MHT files work using this add-on.
    • Unfortunately IE Tab didn’t help when viewing the CallingID page.
  • One of the plugins I use on some of my blogs for displaying photos (NextGEN Gallery) isn’t displaying thumbnails properly in all the blogs it’s used on.  What’s weird is that it works fine on some blogs but not on others.  I haven’t figured out exactly what’s wrong yet; maybe nothing.
  • Where’s the Save Target As functionality when I right-click on a link that points to a file?  IE Tab to the rescue again.
  • File type associations aren’t honored by Firefox.  When I click on an .MP3 file, I expect it to play in Windows Media Player.  Instead Firefox plays it in QuickTime.
  • Probably the biggest problem I’m having is that Firefox uses a LOT of memory if it is running for a long time.  I had it running for about five days or so with between 4 and 10 tabs open at any one point in time and it became very sluggish.  Looking in Task Manager I found that it was using almost a half a gig of RAM.  When I closed it down, the window went away pretty quickly, but it took the process almost 5 minutes to actually shut down, and at its height its memory usage reached almost three quarters of a gig.  I’m really not happy about this.
    • Note that one of the reasons I had decided to try Firefox was because I wasn’t very happy with IE7’s memory consumption.  I noticed that its memory footprint would seem to grow over time and, considering the large number of changes from IE6, I made the assumption that there were some memory leaks the IE team at Microsoft still needed to run down.  However the largest I ever saw IE7 get was about 150 meg – far, far less that Firefox.
Conclusions

The jury is still out because I’ve just started using it so I’m not ready to go back.  We’ll see how it goes, but at this point I’m still pretty impressed.

Comments (2)

My Codelog Theme Modifications

I found the Codelog theme by Alex Günsche two or three weeks ago and have been banging on it to make it do what I want.  I’m almost there, but I think my changes are useful enough to release.

The two biggest changes I made were to make the theme widget-aware and to support both fixed- and fluid-width layouts.

Style Changes
  1. The biggest change is to allow the theme to be either fixed or fluid width.
  2. Removed the margins around unordered lists to be more consistent with ordered lists.
  3. Fixed display of the submit button on the Search widget on Firefox.
  4. Added some table styles to mimic Microsoft Word 7.
  5. Added code and example formatting styles so that they stand out more.  Code and examples can be indented and shaded with a border surrounding them.
  6. Added a td style to vertically align data in tables at the top of cells.
Layout Changes
  1. Moved the ‘Edit’ link to the post meta bar and shortened it to just ‘Edit’.
Plugin Support
  1. Added support for the WP-Email plugin from Lester ‘GaMerZ’ Chan.
  2. Added support for the WP-Print plugin from Lester ‘GaMerZ’ Chan.
  3. Added support for the WP-PostViews plugin from Lester ‘GaMerZ’ Chan.
  4. Added support for the WP-PostNav plugin from Lester ‘GaMerZ’ Chan.
  5. Added supported for the cross-references plugin from Francesc Hervada-Sala.
Admin Page

Added an admin page for the theme.  The following options can be set from this page.

  1. Select fixed or fluid width.
  2. Specify the width in pixels if fixed width is selected.
  3. Specify whether to display the author on posts.
  4. Specify whether a message about which tags can be used in comments should be displayed below the comment editing box.
  5. Specify whether the WordPress version should be displayed in the footer.
Resources

These changes have been tested on IE7 and Firefox 2.0.0.11 against WordPress 2.3.2 and PHP 5.2.4.

Upcoming Changes in v0.1.2

These are changes that I’ve made to the theme and am using on this site but haven’t released yet.  Let me know if you think I should release a new version or want to know how to make these mods yourself.

  • Set code styles to be left-aligned so that the spacing between the words in code doesn’t change based on if it fills a line or not.

Comments (5)

Page 10 of 16« First...89101112...Last »