How to get rid of an EISA partition

If you ever need to remove the EISA partition that gets created by things like Dell and HP server installation CDs, this is how.  This is useful if you’ve carried out a physical to virtual conversion of a machine with an EISA partition on it and the EISA has been virtualised too, or if you want to set up a software RAID 1 mirror and want to keep things simple in your boot.ini file…

This is what the EISA partition looks like in Disk Management:

First thing to do is to set the c:\boot.ini file to not be read only.  Right-click on it, select properties and untick Read-only:

Then edit the c:\boot.ini file in notepad and change the two number 2s to number 1s as shown.  This is because when you have deleted the EISA partition you will have changed the Windows partition from partition 2 to partition 1.  Save the file after making the changes.

Before:

After:

Reboot the machine and boot off of the Windows CD.  Press R to boot into the Recovery Console:

Once in the Recovery Console, type in diskpart and hit return:

In diskpart, highlight the 39MB Partition1 and press D to Delete Partition:

Press L to Delete:

The partition will now show as unpartitioned space:

Quit out of diskpart and reboot the machine and hopefully you’ll see this:

Back in Disk Management the partition should now look like this:

Last thing to do is to set the c:\boot.ini file to be read only again.  Right-click on it, select properties and tick Read-only:

Secret Preferences Menu in Retrospect!

Dantz / EMC Retrospect has a secret preferences menu to allow you to do things like ramp up the diagnostics logging for debugging problems and other interesting stuff. To access it just hold down CTRL-ALT and press P twice.

It looks like this:

Retrospect's secret preferences menu

Have fun!

Hyper-V backups fail in Backup Exec because of clashing disk IDs

Backup Exec Hyper-V agent backups seem to be a bit of a black art. I’ve had several occurrences of this particular issue. The backups fail every time with the following error:


Job ended: 21 September 2010 at 12:05:17
Completed status: Failed
Final error: 0xe000fed1 - A failure occurred querying the Writer status.
Final error category: Resource Errors

For additional information regarding this error refer to link V-79-57344-65233

Click an error below to locate it in the job log

Backup- SERVERNAME.domain.com
V-79-57344-65233 - AOFO: Initialization failure on: "VRTSRV::\\SERVERNA
ME.domain.com\Hyper-V?Virtual?Machine\VirtualServerName". Advanced Open
File Option used: Microsoft Volume Shadow Copy Service (VSS).

Snapshot provider error (0xE000FED1): A failure occurred querying the
Writer status.

Check the Windows Event Viewer for details.

Writer Name: Microsoft Hyper-V, Writer ID: {66841CD4-6DED-4F4B-8F17-
FD23F8DDC3DE}, Last error: The VSS Writer failed, but the operation can
be retried (0x800423f3), State: Waiting for backup complete notification
(5).

In the Windows system event log the following is logged:


Log Name:      System
Source:        partmgr
Date:          21/09/2010 12:11:38
Event ID:      58
Task Category: None
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      SERVERNAME.domain.com
Description:
The disk signature of disk 10 is equal to the disk signature of disk 0.

I carried out the following to investigate this disk signature error:

On the virtual guest machine open a command prompt and run:


diskpart
list disk
select disk 0
detail disk

Which will look like this (click to enlarge):

diskpart output

Note down the value of Disk ID circled in red in the above picture.  It will probably be 00000080 as in the example.

Now repeat this process on the Hyper-V host server.  You’ll find that disk 0 on the Hyper-V host server also has a Disk ID of 00000080.

The reason this is a problem is that when Backup Exec tries to back up the virtual server using the Hyper-V agent it mounts the virtual hard drive on the host server.  You then have two disks mounted on one server with the same Disk ID which causes the backup to fail.

To fix, do this:

Obtain a small utility called dumpcfg.exe.  It’s supposed to be part of the Windows 2000 res kit but after some googling I managed to download it.  Let me know if you can’t find it!

On the virtual guest machine, use dumpcfg to change the Disk ID with the following command:


dumpcfg.exe –S00000081 0

(the '0' at the end of the command is
 the disk number from diskpart above)>

Re run the backup and it should now work…

Windows 2003 Server virtual machine in Hyper-V blue screens after installing the Integration Services.

I carried out a physical-to-virtual (p2v) conversion of a Windows 2003 Server SP1 to a Hyper-V virtual machine using the Sysinternals Disk2VHD tool (download from http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx), installed the Integration Services pack, rebooted and got a blue screen of death.  Rebooted again, BSOD again, with an error code of:

0x0000007B INACCESSIBLE_BOOT_DEVICE

Here’s how to fix:

  1. Reboot the virtual machine and press F8 to get into the recovery options and choose ‘Last known good’.  This is one of the rare times that this option does any good!
  2. The server should boot into Windows but without the Integration Services pack working.
  3. Go into Add / Remove Programs and uninstall Integration Services. Reboot.  It should reboot without crashing now.
  4. Back in Windows, run regedit, and find the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Wdf01000
  5. The value of this will probably be set to base…  Change it to WdfLoadGroup
  6. Reboot.  Reinstall Integration Services.  Reboot.  Should all be working.

Thanks to Robert Vierthaler for finding this here:

http://blogs.msdn.com/b/robertvi/archive/2009/10/07/after-installing-hyper-v-integration-services-on-the-next-reboot-the-vm-displays-bsod-0x0000007b.aspx

Active Directory home directory drive mapping missing.

I had a problem on a site where the users weren’t always picking up their home directory drive mappings from Active Directory, usually when connecting to terminal servers or virtual workstations.

This isn’t a fix for that issue but it is a workaround that may prove useful elsewhere. This vbscript will detect the missing drive mapping (I’ve used H:) and map it using the home directory path set for the user in Active Directory.

Copy it into notepad, save it as a .vbs file, add it as a logon script. Job done.

'This script will manually add a users home drive mapping as H: if it isn't mapped by active directory at login.
'Save it as something.vbs and add it to your logon scripts.
'It also writes a logfile out to c:\script_log.txt with the results.
'Shared on www.sinkingducks.com.

Option Explicit
On error resume next

'Declarations
	'oz = objects
	'sz = strings
	'az = arrays
	'iz = integers
	'bz = Booleans
	'rs = Recordsets
	'fz = Functions
Dim ozNetwork, ozUser, ozFileSysObj
Dim ozCurrentUser
Dim szUserName, szComputerName, szHomeDirectory 

'Create objects
Set ozNetwork = CreateObject("WScript.Network")
Set ozUser = CreateObject("ADSystemInfo")
Set ozFileSysObj = CreateObject("Scripting.FileSystemObject")

'Get user name
szUserName = uCase(ozNetwork.UserName)

'Get home directory path
Set ozCurrentUser = GetObject("LDAP://" & ozUser.UserName)
szHomeDirectory = ozCurrentUser.Get("homeDirectory")

'Map H: if it doesn't exist
If not ozFileSysObj.FolderExists("H:\") then MapNetworkDrive "H:", szHomeDirectory, "", ""

'---------------------------------------------------------------------------------------------
'Functions

Function MapNetworkDrive(szDriveLetter,szNetworkPath, szNewUser, szPassword)
'Map network drive
On Error Resume Next
	Dim bzUpdateProfile

	bzUpdateProfile = "False"

	WriteLog "Mapping drive " & szDriveLetter

	If szNewUser = "" or szPassword = "" Then
		ozNetwork.MapNetworkDrive szDriveLetter, szNetworkPath, bzUpdateProfile
	Else
		ozNetwork.MapNetworkDrive szDriveLetter, szNetworkPath, bzUpdateProfile, szNewUser, szPassword
	End If
	If Err.Number <> 0 then
		WriteLog Err.Description
	Else
		WriteLog "Drive " & szDriveLetter & " was mapped"
	End If
End Function

Function WriteLog(szMessage)
'Write messages out to log file
On Error Resume Next
	Dim szNow, szTempFolder,szFilename
	Dim ozHistory

	szNow = CStr(Now)
	szTempFolder=mid(ozShell.ExpandEnvironmentStrings("%temp%"),3)
	szFilename = "c:" & szTempFolder & "\script_log.txt"

	ozBrowser.document.all.szlog.Value = szMessage  &  vbCrLf  &  ozBrowser.document.all.szlog.Value 

	Set ozHistory = ozFileSysObj.OpenTextFile(szFileName, 8, True)

	ozHistory.WriteLine(szNow  &  ":"  &  szComputerName  &  ":"  &  szUserName  &  ":"  &  szMessage)
	ozHistory.Close
	err.description = ""
	err.Number = 0
End Function
'---------------------------------------------------------------------------------------------

Event ID 15006 MSExchangeTransport: Exchange 2007 is low on disk space!

Here’s a quick fix for a particular issue I have encountered a few times with Microsoft Exchange 2007.  I’m mainly posting this so I don’t forget it myself!

The problem is as follows…

Exchange 2007 stops receiving email and the following event is logged in the Application event log:

Log Name:	Application
Source:		MSExchangeTransport
Date:		4/6/2010 9:37:30 AM
Event ID:	15006
Task Category:	ResourceManager
Level:		Error
Keywords:	Classic
User:		N/A
Computer:	computername.domain.com
Description:
The Microsoft Exchange Transport service is rejecting message submissions because the available disk space has dropped below the configured threshold.
Resource utilization of the following resources exceed the normal level:
Queue database logging disk space ("C:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue\") = 97% [Medium] [Normal=95% Medium=97% High=99%]
Back pressure caused the following components to be disabled:
Inbound mail submission from the Internet
Mail submission from the Pickup directory
Mail submission from the Replay directory

This error indicates that the drive that the Exchange 2007 message queue is installed on is running low on space, although because the thresholds are calculated as percentages the available space may not appear to be that low!

There are two possible fixes:

  1. Delete some stuff to free up space.
  2. Move the queue to an alternative location.  To do this, edit the EdgeTransport.exe.CONFIG file, which can be found in the Exchange Bin folder. If your Exchange is installed with all the default options this will probably be in C:\Program Files\Microsoft\Exchange Server\Bin. Find and change the following lines:
<add key="QueueDatabasePath" value="C:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue" />
<add key="QueueDatabaseLoggingPath" value="C:\Program Files\Microsoft\Exchange Server\TransportRoles\data\Queue" />

Amend the paths in these two lines to the desired new location on another drive with more free space, so you may end up with something like:

<add key="QueueDatabasePath" value="D:\ExchangeQueue" />
<add key="QueueDatabaseLoggingPath" value="D:\ExchangeQueue" />

Create the folder that you are redirecting the queue to, restart the Microsoft Exchange Transport service, job done!

Email alerts from failed Windows scheduled tasks.

So I’ve just been asked to find a way to monitor Windows Scheduled Tasks and send alert emails if are failing. I found most of the solution in this forum post: http://forums.techarena.in/server-scripting/972774.htm and set about making it work with Blat, the Win32 command line email utility, as suggested in the post.

To use, download and install Blat on the PC or server to be monitored. Copy / paste the code below into notepad and save it as a .bat or .cmd somewhere sensible. Amend the variables as instructed in the code. Schedule the script to run after all the other scheduled tasks should have finished. Job done!

@echo off
REM This script checks the Last Result code of every Scheduled Task on Windows XP or 2003 Server.
REM If the code isn't 0x0 it emails a warning using Blat from http://www.blat.net.
REM The script has been adapted from a post I found on Techarena here: http://forums.techarena.in/server-scripting/972774.htm
REM Install Blat from the above website onto the PC or server to be monitored.
REM Save this script on the machine in c:\scripts as a .bat or .cmd file.
REM Amend YourEmailAddress@Domain.com, smtp.domain.com, c:\pathtoscript and @domain.com to suit your situation.
REM Schedule the script to run after all the other Scheduled Tasks have finished.

REM Change the values after the equals sign (=) below to you email address, SMTP server and the path to the script.

set YourEmailAddress=YourEmailAddress@Domain.com
set SMTPServer=smtp.domain.com
set PathToScript=c:\pathtoscript

REM Change the value of @domain.com below to be your email domain.
set FromAddress=%computername%@domain.com

REM Stop making changes now!

for /F "delims=" %%a in ('schtasks /query /v /fo:list ^| findstr /i "Taskname Result"') do call :Sub %%a
goto :eof

:Sub
set Line=%*
set BOL=%Line:~0,4%
set MOL=%Line:~38%
if /i %BOL%==Task (
set name=%MOL%
goto :eof
)
set result=%MOL%
echo Task Name=%name%, Task Result=%result%
if not %result%==0 (
echo Task %name% failed with result %result% >c:\scripts\taskcheckerlog.txt
blat %PathToScript%\taskcheckerlog.txt -to %YourEmailAddress% -subject "Warning! Failed Scheduled Task on %computername%" -serverSMTP %SMTPServer% -f %FromAddress%
)

.NET 3.5 SP1… You try installing it!

So I wasted a good couple hours of my life today trying to get .NET 3.5 SP1 installed on a Windows 2003 Server. It failed at every attempt, whether from a download or from windowsupdate. In the end, the fix was fairly simple (in a rip-it-all-out-and-start-over kinda way!)

  1. Download the .NET Framework cleanup tool from Aaron Stebner’s blog: http://blogs.msdn.com/astebner/archive/2006/05/30/611355.aspx
  2. Uninstall all existing versions of .NET Framework.
  3. Run Aaron Stebner’s .NET Framework cleanup tool and reboot.
  4. Install .NET Framework Version 1.1.
  5. Install .NET Framework Version 2.0.
  6. Reboot.
  7. Install .NET Framework 3.5 Service Pack 1.

This clearly has scope to break many other things.  And that clearly won’t be my fault!