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!

No comments:

Post a Comment