sharepoint 2010 quota editing using client object model

How can access sharepoint 2010 site collection quota and edit it from windows form using client object model approach ?
thank you for your help
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Randy DownsOWNERCommented:

SP.UsageInfo object provides fields that are used to access information about site collection usage.

var context = new SP.ClientContext.get_current();
var site = context.get_site();
    function() {

        var siteUsageInfo = site.get_usage();                   

Open in new window

UKITAuthor Commented:
Thank you Randy,
can i update the site quota using the siteUsageInfo?

what i am trying to achieve is the following:

I will need to be able to edit the site collection quota via a tool developed using (object client model) or even as a visual web part, the reason for this requirement is because.
The user has not enough access to edit the site collection quota and should not have access as that would allow the user to have more access power, so the idea is that the user will run this tool under elevated privileges to only update site collections quotas.

if it is not possible using Client Object Model then is there a better idea ?
such as can i execute power shell command with parameters passed from my client object model windows form to read then update the site collection quota  on SharePoint from a remote computer that has no SharePoint installed ?  

or any other way that will give the user the ability to read the quota template then update it as if he was to go to central admin and manage quotas .
Randy DownsOWNERCommented:
Try this.

Gets or sets a quota for the site collection.

Uri uriNew = new Uri("http://Server_Name"); 
SPWebApplication oWebApp = SPWebApplication.Lookup(uriNew);

using(SPSite oSiteCollection = oWebApp.Sites["http://Site_Name"])
    oSiteCollection.Quota = SPWebService.ContentService.QuotaTemplates["Quota_Template_Name"]; 

Open in new window

IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

UKITAuthor Commented:
Thank you Randy,
this snippet is not Client Object Model this is to use in SharePoint right ?
Randy DownsOWNERCommented:
The snippet is C#. I couldn't find a way to do what you needed in Client Object Model.
UKITAuthor Commented:
I have managed to do it using the timer jobs, I mean by programmatically creating a timer job that runs under a specific identity and runs a only the quota updates.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
UKITAuthor Commented:
it is a rare request but it was a good experience, unfortunately all the other answers not leading me to achieve what I wanted to achieve which is a user can update the SharePoint site quota even if he / she does not have enough privileges to do so.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.