Powershell script to set quota for users

PowerShell script exchange

Powershell script to set quota for users

Veeam Logoby hyvokar » Mon Sep 28, 2015 10:55 am

Hi!

Is it possible to alter quotas with powershell? I would need to set quotas automatically via script.
Bed?! Beds for sleepy people! Lets get a kebab and go to a disco!
MS MCSA, MCITP, MCTS, MCP
VMWare VCP5-DCV
Veeam VMCE
hyvokar
Service Provider
 
Posts: 254
Liked: 15 times
Joined: Fri Nov 21, 2014 10:05 pm

Re: Powershell script to set quota for users

Veeam Logoby v.Eremin » Mon Sep 28, 2015 2:18 pm 1 person likes this post

Sure, it is.

Code: Select all
$Tenant = Get-VBRCloudTenant -Name "Name of user"
$Resources = $Tenant.Resources[0]
$NewQuota = Set-VBRCloudTenantResource -CloudTenantResource $Resources -Quota "New value in GB"
Set-VBRCloudTenant -CloudTenant $Tenant -Resources $NewQuota


Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Powershell script to set quota for users

Veeam Logoby hyvokar » Tue Sep 29, 2015 3:50 am

Thanks! :)
Bed?! Beds for sleepy people! Lets get a kebab and go to a disco!
MS MCSA, MCITP, MCTS, MCP
VMWare VCP5-DCV
Veeam VMCE
hyvokar
Service Provider
 
Posts: 254
Liked: 15 times
Joined: Fri Nov 21, 2014 10:05 pm

Re: Powershell script to set quota for users

Veeam Logoby v.Eremin » Tue Sep 29, 2015 10:32 am

You're welcome.

By the way, $Tenant.Resources returns array of quotas assigned to a given tenant. That's why I've used [0] to select the first quota.

If a tenant happens to have multiple quotas given to him, you should play with number in bracket to select the appropriate quota. (enumeration starts from zero, [0], [1], etc.)

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests