search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Posted in Virtual Machine Manager, Windows Powershell | No Comment | 1,911 views | 12/08/2013 14:17

You can set User Role Quota for each Cloud Profile in SCVMM 2012 SP1.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$UserRoles = "BackOffice","CallCenter"
foreach ($UserRole in $UserRoles)
{
	$UserRole = Get-SCUserRole $UserRole
	$Clouds = "DMZ Cloud","Prod Cloud","Test Cloud"
	foreach ($Cloud in $Clouds)
	{
	   $MyCloud = Get-SCCloud $Cloud
	   $CloudUsage = Get-SCCloudUsage -Cloud $MyCloud -UserRole $UserRole
	   $CPUCount = $CloudUsage.CPUUsageCount
	   $Memory = $CloudUsage.MemoryUsageMB
	   $VMCount = $CloudUsage.VMUsageCount
	   [int]$NewCPUCount = [int]$CPUCount + 40;
	   [int]$NewMemory = [int]$Memory + 81920;
	   [int]$NewVMCount = [int]$VMCount + 10;
	   Get-SCUserRoleQuota -UserRole $UserRole -Cloud $MyCloud | Set-SCUserRoleQuota -CPUCount $NewCPUCount -MemoryMB $NewMemory -VMCount $NewVMCount
	}
}

That will set on all profiles on $UserRoles array.


Posted in Virtual Machine Manager, Windows Powershell, Windows Server | No Comment | 2,455 views | 26/07/2013 15:56

You can set User Role Quota for each Cloud Profile in SCVMM 2012 SP1.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$UserRoles = "BackOffice","CallCenter","ExchangeTeam"
foreach ($UserRole in $UserRoles)
{
	$UserRole = Get-SCUserRole $UserRole
	$Clouds = "DMZ Cloud","Prod Cloud","Test Cloud"
	foreach ($Cloud in $Clouds)
	{
		$MyCloud = Get-SCCloud $Cloud
		$CPUCount = (Get-VM -Cloud $MyCloud | Where UserRole -like "$UserRole" | Measure-Object -Property CPUCount -Sum).Sum
		$Memory = (Get-VM -Cloud $MyCloud | Where UserRole -like "$UserRole" | Measure-Object -Property Memory -Sum).Sum
		$VMCount = (Get-VM -Cloud $MyCloud | Where UserRole -like "$UserRole").Count
		[int]$NewCPUCount = [int]$CPUCount + 40;
		[int]$NewMemory = [int]$Memory + 81920;
		[int]$NewVMCount = [int]$VMCount + 10;
		Get-SCUserRoleQuota -UserRole $UserRole -Cloud $MyCloud | Set-SCUserRoleQuota -CPUCount $NewCPUCount -MemoryMB $NewMemory -VMCount $NewVMCount
	}
}

That will set on all profiles on $UserRoles array.