How set hard quota to my site?

Hi all, 
I am setting the disk quota as following.
if (siteTemplate.ToLower() != MySiteHostTemplate.ToLower())
                    Int64 i64DiskSpace = diskspace;
                    SPTlogger.Debug("diskSpace: " + i64DiskSpace.ToString());
                    i64DiskSpace = (i64DiskSpace * 1024) * 1024;
                    SPQuotaTemplate quotaTemplate = null;
                    try
                        quotaTemplate = GetSPTQuotaTemplateByStorageMaxLevel(i64DiskSpace);
                        if (quotaTemplate == null)
                            //we are not supporting storagewarninglevel; setting it 90% of storagemaxlevel
                            long storagewarninglevel = (i64DiskSpace * 90) / 100;
                            long storagemaxlevelMB = (i64DiskSpace / 1024) / 1024;
                            string templateName = string.Format("{0}({1}MB)", i64DiskSpace, storagemaxlevelMB);
                            quotaTemplate = CreateSPTQuotaTemplate(templateName, i64DiskSpace, storagewarninglevel);
                        if (Site != null)
                            Site.Quota = quotaTemplate;
                    catch (Exception ex)
                        SPTlogger.Error("-------------------------ERROR-------------------------");
                        SPTlogger.Error("Error while fetching quota template: " + ex.Message);
                        if (Site != null)
                            Site.Quota.StorageMaximumLevel = i64DiskSpace;
                            Site.Quota.StorageWarningLevel = (i64DiskSpace * 90) / 100;
                // end setting disk quota template
                if (Site != null) Site.Close();
It is setting the disk quota. however during file upload, larger file are also being uploaded. What is missing here?
Tnanks,
Moohak

Hi,
The following code snippet for your reference:
SPSite siteCollection = new SPSite("http://MySiteCollection");
SPQuota quota = siteCollection.Quota;
quota.StorageMaximumLevel = 5242880; //bytes
quota.StorageWarningLevel = 5242880; //bytes
siteCollection.Quota = quota;
I suggest you debug your code or provide more code(like the GetSPTQuotaTemplateByStorageMaxLevel
and CreateSPTQuotaTemplate methods) for further research.
More information:
http://www.c-sharpcorner.com/uploadfile/anavijai/quota-templates-in-sharepoint-2010/
http://reality-tech.com/2012/09/04/programatically-setting-site-quota-templates/
Best Regards
Dennis Guo
TechNet Community Support

Similar Messages

  • How set-up time capsule as external hard drive

    How set-up a tme capsule as esternal hard drive

    Click here and follow the instructions. When it's on the Finder's desktop or in the sidebar, it's an external drive.
    (60835)

  • How to set security group as primary site collection admin and secondary site collection admin using powershell in sharepoint online site - office 365?

    How to set security group as primary site collection admin and secondary site collection admin using powershell in sharepoint online site - office 365?

    Hi,
    According to your description, my understanding is that you want to set security group as admin of primary and secondary site collection using PowerShell command in office 365.
    I suggest you can use the command below to set the group to site owner, then it will have the site collection admin permission.
    Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -Owner [email protected] -NoWait
    Here are some detailed articles for your reference:
    https://technet.microsoft.com/en-us/library/fp161394(v=office.15)
    http://blogs.realdolmen.com/experts/2013/08/16/managing-sharepoint-online-with-powershell/
    Thanks
    Best Regards
    Jerry Guo
    TechNet Community Support

  • How to set user quotas on a certain filesystem

    Hi
    It may be simple and easy question but I'm really new to this
    I need to know how to set user quotas on a certain file system in details
    I know it can be done easily in one step in Solaris ZFS
    but how is it done in Linux ?
    Thanks in Advance :)

    See also:
    How to set user quotas on a certain filesystem

  • How to create quota ftp on leopard server?

    1. can i create quota area on my external HD with out to make partition?
    2. can i do it with out home user on the server, for example: outside Users who don't have account on the server?
    OSX Server 10.5.6
    T.K.
    Benny
    www.Bmac.co.il

    i find that.
    Quotas are also part of Xsan: you can set hard and soft quotas for every user on the Xsan. A
    quota is the amount of space a user can take up on the SAN. A soft quota lets the user continue
    to save files but warns them that they are over their limit. When they reach the hard quota, they
    will not be able to save any more data until the SAN administrator gives them more space or
    they delete some files. When users near their quotas, they will be alerted.
    that is the only way?
    is it passable without Xsan?
    benny

  • How can I import my iWeb sites??????

    I had a crash trying to install Leopard.
    I have reinstalled the original OS with my new Intel iMac. BUT - how can I get my web sites back into iWeb? I REALLY do not want to have to recreate all these pages! It's insane! Is it just ME, or is there absolutely NO WAY to import my stuff in the folder (which I backed up, luckily)? Or do I have to recreate the sites YET AGAIN? Is there no way to make separate web sites so that they don't have to ALL be published in the same folder and have to save and resave and resave EVERYTHING over and over every time I do a new page, or update or whatever. It's maddening.
    Judie

    THANK YOU!
    I just checked it out and it sounds too good to be true.
    I won't do anything with it until I have Leopard installed, but it's great to know it's there and the PRICE IS RIGHT!
    Also, about my install: We bought a 5 pack license and made a copy for me. SOMEONE didn't verify the disk and it obviously had a glitch. When it was checked it got to about 30% and I got a message that the disk wouldn't work. So I clicked whatever buttons I was told to and then got the blue/grey screen. It sat there so long I had to turn it off with the button. Perhaps it was trying to reset everything to before I tried the install, I don't know. So, the problem wasn't necessarily Leopard and my computer, but the disk to start with and perhaps I compounded it by not waiting for 28 hours for it to fix itself <G>. Anyway, I have to kick myself for not doing a back up of EVERYTHING, and my famous last words were "Nothing ever screws up with a mac."
    Lesson learned. I will have a 500G hard drive next week and this will never happen again.
    I will also disconnect all peripherals as I saw some people suggested that was causing problems. But, what is MOST annoying after the data loss is all the TIME that it takes to do this. I have work to do on this darned machine!
    Thanks again for the RapidWeaver tip, tboelsklfte.
    Judie

  • How can i tell how much hard drive space my website is taking up on my computer?

    I have a website that i build through iweb and publish via mobile me.  i have about 200 podcasts on the site, and I am trying to figure out how much hard drive space this is taking up on my computer.  these files are not in itunes, and i'm not concerned about the space they are taking up in my cloud, i just want to know how much space on my computer they are taking up because i'm trying to decide if i should move my iweb site to a different computer to alleviate some space issues.  any help would be much appreciated.

    Check the size of the Domain.site2 file that is in your Users/Home/Library/Application Support/iWeb folder.  it contains all of the files used to create and publish your site.  I'm not sure if it copies the podcasts into it or not. You can open the domain package and do a search for them. Just don't move, rename or delete any files inside that package or your site is toast.
    OT

  • How to I get my Muse site to have a "Direct Link" to a section on my website.

    How to I get my Muse site to have a "Direct Link" to a section on my website. For example, if I am under the busniesscatayst I can direct some to an exact page in my site through an email or Facebook post: http://biteonfishing.businesscatalyst.com/buy-now.html  However, I can not perform the function when I am not including the Business Catalyst www.BiteOnFishing.com I want to make so I can send people to the link using www.BiteOnFishing.com/buy-now.html. Any advice is much appreciated.

    You need to point your domain name DNS to the Business Catalyst server and then set up the domain name in the Business Catalyst site admin.
    Adding a domain name to your site and taking site live

  • How to configure Search for a site in sharepoint 2013?

    Hi,
    I had a document library.
    1)I want to configure search so that I can search documents from previous month, quarterly, half year, year, and all documents is possible.
    2)Search results are organized with most recent documents at the top.
    3)Search results have year as refiner that can be used to show results only from specified year (In library we have field with year when document create)
    To achieve this what I have chane in site settings->search
    and what I have to write for Result Types, Query Rules
    Thanks

    Hi,
    Following are the steps you need to perform for creating the search center.
    http://blogs.technet.com/b/tothesharepoint/archive/2013/10/30/set-up-a-search-center-in-sharepoint-2013.aspx (About Search)
    1. Create the site collection by navigating to the CA(Central Admin) & select the Enterprise Search Center Template.
    2. Create Content Source -> Navigate to the Search Service application->Create the content source if the content comes from other content farm (if different farm accout  if it same add the site Collection URL in default Content Source. ( make
    sure the crawl account must have full read permission)
    http://blogs.technet.com/b/tothesharepoint/archive/2013/10/31/how-to-create-a-search-center-site-collection-and-enable-crawling-of-your-content-in-sharepoint-2013.aspx (Create
    Search Center)
    3. Once you add url in the content source and run the full crawl.
    4. Navigate to the Search center created at step 1 and try to search with the document name. you will see the document.
    http://blogs.technet.com/b/tothesharepoint/archive/2013/11/06/how-to-configure-the-search-results-web-part-to-use-a-new-result-source-in-sharepoint-2013.aspx (Go
    to the document Library and configure the result source)
    5. To configure the refiner please follow this post. You will see the modified refiner to refine your search http://blogs.technet.com/b/tothesharepoint/archive/2013/11/07/plan-to-use-refiners-on-a-search-results-page-in-sharepoint-2013.aspx)
    Let me know if you req. any other information.
    Regards,
    Basant Pandey
    http://sharepointfordeveloper.blogspot.com

  • How to apply CSS to Existing Site

    Help! I am a Macromedia Dreamweaver user. I manage a few simple sites on a volunteer basis. I was recently forced by a new computer purchase to upgrade to CS4 for Vista compatibility.
    I have never used Style Sheets. I've spent several hours this afternoon combing the web for instructions and found that most of the information assumes way more knowledge than I have, and the more basic articles seem to provide nice overviews of what CSS is and why one might want to use it, or possibly how to build a new site using CSS, but they have not answered my "how to" questions about my existing sites.
    My two most pressing unanswered question are these:
    1)  I seem to have successfully created a new CSS rule by selecting a section of text in the document, setting the Property Inspector to CSS and then naming the rule and choosing a font style and size (although the new rule dialog box never appeared - I did it all in the Property Inspector). Do I have to go through the whole site and apply this rule individually to each section of body text? The existing document has all the text set by its specific features (e.g. Arial Bold 10), not using "heading 1" "heading 2" etc.
    2) I do not use Dreamweaver to upload my finished documents. I use a site-managemet ftp page on my host server. Once I've created these CSS style rules, is there anyting that I need to upload besides my edited pages?
    Thank you in advance for help.

    If you are using the same font family, font size, colour, etc... you can use a separate style sheet and just use
    body {font-size:14px; font-family:arial, helvetica, sans-serif}
    this will make all your site the same body style.
    Do I have the book for you:  CSS in easy steps by Mike McGrath  isbn#1-84078-301-x
    It's a really good beginner's book to CSS.  And really easy to read!  Was a huge help to me in my beginnings of CSS.
    Also, www.lynda.com is a great resource.
    Hope this helps!
    You'll need to upload that extra css page with the rest of your site!
    Message was edited by: JulesN

  • How much hard disk space remains?

    Sorry, the Missing Manuel for Lion isn't available until the end of the month, but I have a lot of basic questions.
    With Snow Leopard when i opened a Finder window at the very bottom of the window pain was information on how much memmory was being used by whichever folder I had opened.  I know I can hit Tab to have a window pop up and tell me, but I liked that old feature built into the Window.  Is there a way to change the setting back so that when I open a finder window I get a reading on how much hard disk space is being used by X file? 

    Select Show Status Bar from the Finder's View menu. As far as space used by any one file that is listed under the Size column in the Finder when using List View.

  • How many Hard Drives ?

    I've been fortunate to receive a PowerMac G4 733mhz (Digital Audio) along with a Sony 20" CRT monitor at no cost and I'm looking to get all the performance that I can out of it.
    So far I've maxed out the RAM and added an iogear USB 2.0 card along with a SIIG Utra ATA 133/100 Pro controller card. The Radeon 9800 pro video card is a couple weeks away yet.
    I now have a 160gb and a 60gb as master/slave on the main board, and another 160gb on the controller card in which I'm adding another 80gb to tonight.
    I am wondering how many hard drives I can add before I have to start worrying about the power supply. Keep in mind that I'm going to be adding the video card in the future.
    I also see that SIIG card says OSX 10.1 or later, does this mean that I cannot connect a drive that boots into OS 9 to the card? Or a drive that may have Yellow Dog Linux?
    Thanks, I'd appreciate any input about this new project of mine.

    Hi-
    OK, let's talk power.... This is what we have to work with (may be slightly higher depending on PSU model):
    DA 338W PSU
    +5V=20A
    +3.3V=24A
    +28V=4.04A
    +12V=8A
    -12V=0.25A
    Total on combined +3.3V and +5V =126W @32A
    Of course, there is a big difference between idle and load power consumption, but I will list maximum power consumption values. Various requirements are:
    ATA/100 Hard drive- Read/Write, approx. 12.8W [email protected], [email protected]
    Optical Drive- Full Speed (42x) read, approx. 5.6W [email protected], 15.7W [email protected]
    Memory (per 512mb DIMM) 1-3W combined 3.3V,+5V,[email protected]
    PCI and AGP slots combined max +3.3V, +5V=62W, AGP (only) up to 20W
    Firewire Bus 15W+25V
    USB Bus 5v@500mA per port
    733mhz PPC processor 1.6V 15.6W (Idle) 22.0W (load)
    Fans (combined) +12V [email protected]
    As for the Radeon 9800 Pro, under full load, the power requirements are:
    +5V [email protected]
    +12V [email protected]
    +3.3V(AGP) [email protected]
    +5V (AGP) [email protected]
    +12V (AGP) [email protected]
    Points to consider (no particular order):
    -An ATA hard drive at idle, will still pull 7.2W and at Standby, will pull 1.4W.
    -Unless you are running 2 RAID sets, you would rarely, if ever, have 4 drives simultaneously in Read/Write.
    -One process that will push a system to the max is disc burning. Consider CPU at load, one, possibly two hard drives at Read/Write load, and the Optical drive at load. (For all who care, this is why we don't multi-task during burning). Without multi-tasking, the graphics power draw is minimal.
    -Weak point of early ATX PSU revisions was the 12V rail. The G4 PSU also has a weak +12V rail (only 8A).
    (Run a dual internal RAID, and try to burn a disc..... well, you better set the machine up as a headless server.....)
    -Total combined +3.3V, +5V wattage and ampherage is sufficient for most fully loaded system and bus combinations.
    -The power requirements of the 9800 Pro are all within the maximum limits of the various voltage rails of the OEM PSU.
    -A 237W PSU equipped Sawtooth will run without problems with two hard drives (one system, one storage), a 2.0ghz 7447 processor, USB 2.0 PCI, Radeon 9800 Pro and AC VGA fan. Additional hard drive (scratch drive), PCI cards, HDD fans and lighting overload the +12v rail for operation at load with disc burning. (we're talking about real life experience here...)
    -Hard drives are heat producers, and an external firewire connected housing can allow for better overall system operation by reducing interior clutter and heat production.
    -High interior temperatures reduce the ability of the PSU to cool itself, and thereby reduce it's ability to produce reliable power under load, in the heat.
    -Old ATA hard drives are power hogs and hot in comparison to current SATA drives. Switching to two larger SATA drives will reduce load requirements by 3-4W per drive, as well as reduce heat production. Required use off a SATA PCI controller card eliminates the capacity restriction of the native ATA controller. Switching to SATA saves space, power, and cooling needs.
    -And, final (random) thought to consider, a dual 500mhz Gigabit Ethernet (same PSU as the DA) will run two ATA drives simultaneously, burn a DVD, with a 9800 Pro installed, without any problems whatsoever. The same machine will run 3D graphics intensive games at enjoyable framerates, without problem. Internet video, on line games, etc., are all enjoyable, with reasonable performance for the given CPU speed. All uses of the machine are without problem, with the added graphics benefit provided by the 9800 Pro (Yep, another real life experience).
    Now, you decide....

  • Question. How do I update / modify my site? Do I work with the original file "modify"?

    How do I update / modify my site? Do I work with the original file "modify"?

    Not sure why modify is in quotes ... but yes you work with the original and then publish again or export the HTML again.

  • Setting disk quota on Mac server for Active Directory users

    I'm having trouble setting disk quotas for Active Directory users with home folders on our Mac server.
    I've enabled disk quotas on the disk I'm putting home folders on, and I can set disk quotas for local users on the server just fine. But it doesn't seem to work for Active Directory users. I've tried setting disk quotas via Workgroup Manager and via the command line using edquota. But when I use the repquota command there is no quota entry for the AD user. I've run quotacheck and that didn't help either.
    I also understand there's a setquota command but there's no man page on how that works.
    Has anyone got disk quota for AD users working.
    Better still has someone got a shell or perl script for setting quotas they could post.
    Thanks
    - Cameron

    sorry.. I am soooooo stupid... I have to activate "File Sharing" as well.. for the user everything was already pre-activated, not for the AD users, I just saw the Time Machine checkbox grayed out ...

  • How do i switch from top sites view to normal view

    how do i switch from top sites view to normal view

    Visit the site you want it to be the Homepage.
    Safari > Preferences > General
    Homepage:
    Click the "Set to Current Page" button.
    New windows open with:
    Click the popup menu box and select "Homepage"
    New tabs open with:
    Click the popup menu box and select "Homepage"
    http://support.apple.com/kb/PH11857

Maybe you are looking for

  • How do I get rid of someone else's apps on my account?

    A few months ago I synched my new iPhone with my computer at work. It seems that, unknown to me at the time, someone had used the itunes on my computer to update their iPad. Suddenly, I had one million apps on my phone that I had never downloaded. It

  • Delete a page in a document

    I have a 2 page document, I want to delete the first page. I tried deleting everything off of it, but it shows blank page. I tried going to the beginning of the second page and deleting, nothing happens. Ipad   iOS 4    

  • How  to set some fields of a table, not fields form ..

    Hi, I have a form based on a table with a few fields and others fields on the same table whose don't appear in the form. I want to set the others fields of this table and i use the following code (ex) : p_session.set_value( p_block_name => 'DEFAULT',

  • Using apple ID and itune cards

    Can you create an Apple ID with out putting in a physical address and will it work with itunes and pre paid itunes cards and free stuff at apps store.

  • Call of duty modern warfare 3

    Why isin't 'Call of duty modern warfare 3' compatible for mac honestly do you know how much money you would get on Mac Apple Store then people won't want a windows anymore since most of the people or young people use windows for games honestly Mac ca