Remove orphan collection item without related database in TFS 2013 with Update 2

Last week, the Configuration Manager in our company tested to create a collection in Team Foundation Server (TFS for short) 2013 with Update 2. After test, the database of this collection is deleted directly from SqlServer by mistake and there is no backup for it. So an orphan item for this collection is still existed there and have to be removed manually.


First, I try to remove it from Team Foundation Server Administration Console (TfsMgmt.exe). It failed in detach process.

Then, I try to do it with TFSconfig.exe in console mode. I’m pretty sure that’s work in previous version of TFS, maybe 2012. But in 2013 with Update 2, it failed the same as TfsMgmt.

I tried to use a database from another collection by renaming it as the deleted one, or even use a database created with another TFS instance with the same collection name, all failed.

At that time, I turned to MSDN forum. One MVP provided some tables within Tfs_Configuration database. Some deleting operations should be taken there. After that, the collection is removed from the TfsMgmt but it still can be found in Visual Studio at client side.

Finally, I detached all collections and redeployed the whole TFS instance. That works as predictable.


If somebody falls into the same jam, the detachment and redeployment is the only way to correct it, unless you have the backup of that deleted database.



Drobo 5D is not trustworthy

By believing the ad from Drobo, I brought a Drobo 5D June 2013. I installed a Plextor PX-128M5M as an SSD Cache and 5 WD30EFRX for storing with 2 disks redundancy. For using with OSX, I format it with HFS+ in Drobo Dashboard.

After 2 weeks, it’s failed. The partition cannot be mounted, neither fixed by OSX. After checked by engineer from DiskWarrior, I know the partition is too severely damaged and not possible to recover. I contact the support of Drobo. After 45 days waiting, I get the respond. The problem is partition-related (offset) and should be fixed by firmware 3.0.5. But the my Drobo 5D is shipped with firmware 3.0.7. Finally, the Drobo says there is no way to repo in the lab, and I lost all my home videos for 5 years.

For preventing this issue again, I rebuilt the partition and sent the log to Drobo engineer. After checking the log, the engineer confirmed it’s looks great now.

But, it’s failed again after 2 months. Same behavior, same problem confirmed by DiskWarrior. The funny thing is the support engineer from Drobo. After I submit the ticket again, first response is:

“Western Digital has emailed customers warning them about possible data loss issues between external hard drives and the latest version of Apple’s Mac software, OS X Mavericks (10.9).” taken from this article below:

On another note, not sure whether it is related, your mSATA card may not be entirely compatible, it is not found from the list shown here:

Should I worry about WD software? I guess not. for mSATA SSD cache thing, the PX-128M5M removed from the supported list, without any explanation, and not be put in to incompatible list either. It’s just gone.

After I tell the support I didn’t use WD software but Drobo Dashboard and prove the PX-128M5M WAS on the compatible list by searching mirroring sites, Drobo does like before, just ignore you and do not reply any more.

Now, this Drobo 5D is on my shelf to warn me and my friend: NEVER BUY THE DROBO PRODUCTS.

Volume Shadow Copy Service error on Windows Server 2012

In many instance of Window Server 2012, there are lots of errors in Event Log about Volume Shadow Copy Service like this:
Volume Shadow Copy Service error: Error creating the Shadow Copy Provider COM class with CLSID {463948d2-035d-4d1d-9bfc-473fece07dab} [0x80070005, Access is denied.].
Creating instance of hardware provider
Obtain a callable interface for this provider
List interfaces for all providers supporting this context
Query Shadow Copies
Provider ID: {3f900f90-00e9-440e-873a-96ca5eb079e5}
Provider ID: {3f900f90-00e9-440e-873a-96ca5eb079e5}
Class ID: {463948d2-035d-4d1d-9bfc-473fece07dab}
Snapshot Context: -1
Snapshot Context: -1
Execution Context: Coordinator

Actually, that may be a bug of Windows Server 2012. You need to and are able to correct it manually by setting up the right credential for related DCOM. You can choose UI or PS to reach that:
UI mode:
1 Open Component Services, open Computers – My Computer – DCOM Config.
2 Locate WTVdsProv and press right mouse key – Properties – Identity, select This user, enter an account name and password with local administrator’s permission.
3 Do the same step for WTSnapshotProvider.
PS mode:
Open PowerShell and use these commands:
$PsCred = Get-Credential
$PrvdIdentityPath = New-Object System.Management.ManagementPath(“root\wmi:WT_iSCSIStorageProviderIdentity”)
$PrvdIdentityClass = New-Object System.Management.ManagementClass($PrvdIdentityPath)


How to migrate WSUS Database from WID to SqlServer on Windows Server 2012

I was trapped in migrating WSUS database from Windows Internal Database to a dedicated SqlServer instance. Due to lots of changes taken in in WSUS and WID of Windows Server 2012, the old way as Windows Server 2008R2 does not work anymore. Finally, I found a solution to do that.
All your needs:
1 A working instance of WSUS, which has a database in WID.
2 SqlServer installation package.
3 Backup before migration.

Migration steps:
1 Install a SqlServer instance. For my case, SqlServer 2012 Express x64 is chosen.
2 Install a SqlServer Management Studio.
3 Log on to this server by LOCAL ADMINISTRATOR. If your server joined a domain, you have to do this by local administrator. No matter your domain account is in local administrators group or not, you cannot do that with a domain account.
4 Open SqlServer Management Studio and connect to server \.\pipe\MICROSOFT##WID\tsql\query using Windows Authentication. You will find a database named SUSDB listed.
5 Stop service WSUS Service and IIS Admin Service.
6 Detach SUSDB. Drop active connections if needed.
7 Log off and log on to this server with your account if you like. You may need an account from local administrators group.
8 Copy database files out from C:\Windows\WID\Data. You need 2 files related to SUSDB.
9 Remove Role Windows Server Update Services and Feature Windows Internal Database. Server will have to reboot after this step.
10 Install removed role and feature again. Choose database instead of WID database. When asked to specify a path for storing updates, use the same file location as before.
11 Finish post deployment but do not open MMC.
12 Open SqlServer Management Studio and connect to the SqlServer instance installed by step 1. You need to run this instance by administrator privilege, or you will get a read-only database in next steps.
13 Stop service WSUS Service and IIS Admin Service.
14 Delete SUSDB database from SqlServer Management Studio.
15 Attach SUSDB from the location where you copied to in step 8.
16 Start service WSUS Service and IIS Admin Service.
17 End.

PS: SqlServer database is not like one in WID, it cannot be backed up by Windows Server Backup. Please choose a separated folder or volume for your database files and setup an agent job to backup them.

Fix: Boot Camp Assistant stuck on Partitioning

Yesterday, when I was removing Windows partition through Boot Camp Assistant, it got stuck on partitioning:

Status: Partitioning Disk

I’m lucky to fix it manually. There are my steps:

1 Command+Q to quit the Boot Camp Assistant.

2 Open Disk Utility, select the harddisk, go to tab Partition.

3 I see there is some free space after my osx partition. Simply, I extend my osx partition and click Apply.

4 An error message is given to me. Due to some error within my osx partition, this operation cannot be done.

5 Reboot computer with Option key down, and select Recovery.

6 Use Disk Utility to repair the osx partition.

7 Do not try to extend partition here. You cannot make it successfully.

8 Reboot to osx normally.

9 Open Disk Utility again to extend osx partition. It can be done now.

10 Start Boot Camp Assistant if you need to re-install another Windows instance.


That’s my story.


OSX 10.8

Windows to remove: Win7 with single partition, created by Boot Camp Assistant of OSX 10.8.


PS, Windows 8 works great. Except there is a bug on current version of Boot Camp. You can only back to OSX by holding Option button down while powering up, not able to do that with the menu command within Boot Camp.

TreeView with CheckBox

If you wanna use CheckBox enabled TreeView in Windows Vista and further systems, you need to pay attention. If you double click the CheckBoxes in the TreeView, some useful event handlers, like BeforeClick and AfterClick, will not be raised. And, the vision of CheckBoxes will be changed (checked or not) but the property of related TreeNode will not.

To fix this, you have to create your own TreeView instead of the provided one.

using System;
using System.Windows.Forms;

public class FixedTreeView : TreeView
	protected override void WndProc(ref Message m)
		if (m.Msg == 0x203)
			m.Result = IntPtr.Zero;
			base.WndProc(ref m);