Change Hostnames to UPPER case in SCVMM

Sometimes, when adding new hosts to SCVMM, for unknown reasons, they end up being a mix of upper and lower case.
Theres a couple of descriptions around, about how to fix it with SQL scripts. It seems they only change the names in tbl_ADHC_Hosts table, not those in tbl_ADHC_AgentServer.
This code changes it for both. If you want it to change them all to lower, replace “UPPER” with “LOWER” 😉
Make sure you take a backup of VirtualManagerDB first.
Restart SCVMMService afterwards (A refresh in the console should be enough).


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

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

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

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

Result :

vmmuppercase

Ensure data drives are brought online in sysprep’ed VHDX deployments

When deploying multidisk templates in VMM, secondary disks aren’t brougt online.
Before running Sysprep from MDT task sequence, insert “Run Command Line ..” “cmd /c echo san policy=OnlineAll  | Diskpart”

SAN-Policy

Or from a CMD.exe prompt :
SAN-Policy-cmd

If using a PS prompt, make sure the “echo” is enclosed in quotes :

SAN-Policy-PS

 

 

SCVMM error : 23351 : The input string “” for the FirstBootDevice parameter cannot be parsed and may be invalid.

After importing an exported Generation 2 template in VMM, the following error occurs when trying to deploy :
The input string “” for the FirstBootDevice parameter cannot be parsed and may be invalid.
Make sure the string uses one of the following formats: “SCSI,BusId(integer),LunId(integer)” or “NIC,SlotId(integer)”
ID: 23351

This can be fixed up in Powershell like this :

Import-Module virtualmachinemanager
Get-SCVMTemplate -Name 'TEMPLATEXXX'  | Set-SCVMTemplate -FirstBootDevice 'SCSI,0,0'