Monthly Archives: May 2015

Get a list of all VM in a cluster, that dosen’t hve Limit CPU For migration set to true

Get a list of all VM in a cluster, that dosen’t hve Limit CPU For migration set to true:

Import-Module -Name "virtualmachinemanager"
Get-Vmmserver localhost
$hc = Get-VMHostCluster -Name CLUSTERNMAE
$hosts =get-vmhost -VMHostCluster $hc
foreach($h in $hosts) {
	get-vm -vmhost $h |Where { $_.LimitCPUForMigration –eq $FALSE } | select Name
}

 

Shring SQL log file

USE [TestDb]
GO
ALTER DATABASE [TestDb] SET RECOVERY SIMPLE WITH NO_WAIT
DBCC SHRINKFILE([TestDb_Log], 1)
ALTER DATABASE [TestDb] SET RECOVERY FULL WITH NO_WAIT
GO

 

Where TestDB, is the database name, and TestDB_Log is the SQL Log file name.