This project has moved and is read-only. For the latest updates, please go here.

$env:COMPUTERNAME length problem

Jul 12, 2011 at 7:10 PM

Hey guys,

Great build script. I wanted to make you all aware of a problem I ran into that took a while for me to track down.

When I built my dev server I called it \\Sharepoint2010Dev - which windows server 2008 allowed me to do. I noticed after the build script I was having problems with search and I noticed that the servername was referenced as \\Sharepoint2010D  (noticed that the server name is truncated from the actual netbios computer name).  In looking in your scripts you reference the $env:COMPUTERNAME operating system environment variable. When I do a "set" command on this system I noticed that it is listing the truncated 15 character computername.  Since the computername is truncated and invalid the hostname does not resolve on the network and hence causes a variety of issues.

I wanted to recommend in the build script that you check to ensure that the $env:COMPUTERNAME environment variable actually is correct and matches the real netbios name of the computer.

Thanks for all the work you put in on this script


Jul 12, 2011 at 7:55 PM

Simply limiting your computername to 15 characters (a good IT practice for nearly as long as Windows has been around) will avoid a name mismatch between DNS and NetBIOS, and completely avoid this issue (and likely others too). Allowing Windows to truncate your NetBIOS name is asking for trouble, IMO :)


Jul 13, 2011 at 10:20 AM

You are not meant to have more than 15 characters (NETBIOS name)