Tuesday, 17 March 2015

Changing a hosts display name case in SCVMM

If you want to change the displayed case of hosts in SCVMM to upper case below this the SQL query you need to execute on the SCVMM SQL database.


Stop the System Center Virtual Machine Manager and System Center Virtual Machine Manager Agent service on the SCVMM server.

Open SQL Studio manager, select the VirtualManagerDB and take a backup first! Then paste this code into a new query window and select execute.

SELECT [ComputerName], UPPER(LEFT([ComputerName], CHARINDEX('.', [ComputerName], 1) -1)) +
            RIGHT([ComputerName], LEN([ComputerName]) - CHARINDEX('.', [ComputerName], 1) + 1)
FROM [VirtualManagerDB].[dbo].[tbl_ADHC_Host]

UPDATE [VirtualManagerDB].[dbo].[tbl_ADHC_Host]
SET [ComputerName] = UPPER(LEFT([ComputerName], CHARINDEX('.', [ComputerName], 1) -1)) +
                               RIGHT([ComputerName], LEN([ComputerName]) - CHARINDEX('.', [ComputerName], 1) + 1)


Start the System Center Virtual Machine Manager and System Center Virtual Machine Manager Agent service on the SCVMM server.

Job done!

Using PowerShell Enter-PSSession when your computer isn't on the domain.

Quite often when i'm at a customers site I need to work on their servers. Each time I go to site I don't join my laptop to the customers domain. The problem with this is that when you use the Enter-PSSession command you get an error message about the fact that your computer is not joined to the domain that the server is.

This also presumes you have enabled PSRemoing on the destination host with this command:

Enable-PSRemoting -Force

Here is the work around; Enter the first command on you computer once only. This tells your computer to trust the identify of any remote computers. This should not be done on non technical users computers as the security implications are obvious.

Set-Item WSMAN:\Localhost\Client\TrustedHosts -Value * -Force

The command below will connect you to the computer of your choice, you will need change the IP address or substitute a computer name, you will also need to change the domain and username to an account that is active on the server.

Enter-PSSession -ComputerName 0.0.0.0 -Credential domain\username -Authentication negotiate


Wednesday, 11 March 2015

DHCP scope exhausted with BAD_ADDRESS enteries

I noticed a new VM would not get a DHCP address from one of the customers DC's, after remoting into the DC we could see that the scope was full. Upon further inspection the scope had been filled with BAD_ADDRESS entries. We selected all the BAD_ADDRESSES and deleted them, but within minutes it was full again.  I knew it had to be some of the new equipment we had plugged in, this was disconnected and I used the PoSh below to see if any new BAD_ADDRESS entries emerged.

Get-DhcpServerv4Lease -ScopeId "192.168.221.0" | Where {$_.HostName -eq "BAD_ADDRESS"}

Isolated the problem to two new downstream Force 10 MXL switches that have DHCP enabled in the default VLAN. The commands below were issued on the switch to resolve the problem with the scope filling.

>interface VLAN 1
>no IP address DHCP
>do wr

The PoSh command above was used to make sure that no new BAD_ADDRESS entries existed.

Thursday, 12 February 2015

Troubleshooting intermittent pings

Troubleshooting intermittent pings can be a pain in the rear. Here are some steps I have used to isolate the issue.
I am working with a customer who is having a Hyper-V cluster, after getting the Network Adapters sorted out I noticed the RDP connectivity to the server was poor. A ping to the default gateway revealed high ping latency and a good handful of request time-outs.  



  • Updated the drivers - No change.
  • Changed the CAT6 cable - No change.
  • Disabled VMQ - No change.
  • Plugged my laptop in to the same cable - Same issue, Bingo! This turned out to be a red herring. I updated my drivers and plugged the power in and that resolved the laptop ping issue.
  • Tried another laptop on the same cable - It was fine, 1ms.
  • Tried another 1GbE NIC to eliminate the LBFO driver - still the same.
  • Tried a 10GbE - Seems to be stable, odd.
  • Tried another switch - Seems to be stable, odd.
  • Flatted the server, installed Windows 2012 R2 again and test the ping, it was fine, odd!
  • Repeated all the configuration steps one at a time each time testing the ping, still OK.
  • Joined the domain, BAM! Pings all over the shop.
  • Tried safe mode, Seems to be stable 1ms!
  • Removed the server from the domain, seems to be stable 1ms.
  • Added the server back to the domain, pings latent and intermittent again.
  • Stop the Base Filter Engine (stop-service BFE - force), seems to be stable 1ms.
  • Uninstall the Broadcom driver and use the OOB driver from Microsoft, seems to be stable 1ms.
Update: After creating some VMs the problem moved inside some VMs. The solution was to change the Broadcom 1GbE NICs for Intel x350-t NICs.

Hardware, Dell PowerEdge R720, 1GbE & 10GbE Broadcom NICs. Switch HP 5400

Monday, 15 December 2014

Disk performance stats are missing from task manager

By default basic disk IO stats are not available in Windows Task Manager. This counter can be useful for a quick peek at what the disk is doing. For a more detailed look you need to use Resource Monitor.


To enable the Disk statistic in taskmgr, execute this command from an elevated CMD prompt.

diskperf -y

Thursday, 25 September 2014

Windows servers keep resolving to a DHCP address

Windows servers with static IP addresses randomly loose their correct DNS IP address and start resolving to some random IP address for the DHCP scope.

This happens with Windows 2012 R2 DHCP and DNS servers. When a new server is connected to the network and powered up, it get's and DHCP address from the local DHCP server. After you fix a static IP address on the new server. It PINGs and DNS resolution works correctly, resolving the new IP address.
Later, on the hour normally. The new server starts to resolve to the old DHCP address. I checked the server to make sure that no Network Adapters have "Obtain and address automatically" but they did not.

Turns out that the 2012 DHCP updates/overwrites the DNS record to match the DHCP scope.

FIX: Find the rogue address within DHCP and delete it. On the new server issue an IPCONFIG /REGISTERDNS