Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8222079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:09:16+00:00 2026-06-07T14:09:16+00:00

I am tasked with writing a report that pulls data out of a the

  • 0

I am tasked with writing a report that pulls data out of a the “Storage Space Allocation” section within various SharePoint sites. I am able to screen scrape the general “Document Libraries” values by performing a general GET call, but I cannot programmatically obtain the “Lists” values. When I navigate to the SharePoint site (*/_layouts/storman.aspx) “Document Libraries” is the default selection. I think I need to send a POST call in order to change it to “Lists” [then I can scrape the values]. Creating the appropriate POST call is becomine a hassle because SharePoint does not seem to recognize my key/value pair (or maybe I’m not supplying all of the necessary parameters?).

I tried this code, but no luck – only the “Document Libraries” data is returned.

using (System.Net.WebClient client = new System.Net.WebClient() { UseDefaultCredentials = true })
{
    NameValueCollection myQueryStringCollection = new NameValueCollection();
    myQueryStringCollection.Add(queryParameterName, queryParameterValue);

    client.QueryString = myQueryStringCollection;

    return client.DownloadString(url);
}

I also tried this (alongside other ideas):

private static string GetWebResponse(string url, NameValueCollection parameters)
{
    var httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
    httpWebRequest.UseDefaultCredentials = true;
    httpWebRequest.ContentType = "application/x-www-form-urlencoded";
    httpWebRequest.Method = "POST";

    var sb = new StringBuilder();
    foreach (var key in parameters.AllKeys)
        sb.Append(key + "=" + parameters[key] + "&");
    sb.Length = sb.Length - 1;

    byte[] requestBytes = Encoding.UTF8.GetBytes(sb.ToString());
    httpWebRequest.ContentLength = requestBytes.Length;

    using (var requestStream = httpWebRequest.GetRequestStream())
    {
        requestStream.Write(requestBytes, 0, requestBytes.Length);
        requestStream.Close();
    }

    Task<WebResponse> responseTask = Task.Factory.FromAsync<WebResponse>(httpWebRequest.BeginGetResponse, httpWebRequest.EndGetResponse, null);
    using (var responseStream = responseTask.Result.GetResponseStream())
    {
        var reader = new StreamReader(responseStream);
        return reader.ReadToEnd();
    }
}

Viewing the source code of the _layouts/storman.aspx page, I can see the name/value pair i need to send is ct100$PlaceHolderMain$m_filterDropdown and Lists respectively. I determined this by this view source code:

<select name="ctl00$PlaceHolderMain$m_filterDropdown" id="ctl00_PlaceHolderMain_m_filterDropdown" class="ms-viewselect">
<option selected="selected" value="Document Libraries">Document Libraries</option>
<option value="Documents">Documents</option>
<option value="Lists">Lists</option>
<option value="Recycle Bin">Recycle Bin</option>
</select>

Any ideas on how to get the List values from this page?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:09:18+00:00Added an answer on June 7, 2026 at 2:09 pm

    I finally figured this out…

    I have to send every name/value query parameter pair that SharePoint is expecting. To complicate matters, I must first perform a GET request in order to obtain the __REQUESTDIGEST, __VIEWSTATE, __EVENTVALIDATION values that SharePoint is expecting. Also, all parameters must be UrlEncoded when I send them back to SharePoint.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm tasked with writing an application that acts as a central storage point for
I have been tasked with writing an installer with a silverlight out of browser
So I'm tasked with writing a few SQL queries that involve finding the highest
Suppose you are tasked with writing a web application that must store configuration information
I have been tasked with writing an ADP application using Access. The back-end data
I've been tasked with writing a data collection program for a Unitech HT630 ,
I am tasked with writing a program that, given a search term and the
I've been tasked with writing a web service that can be called from one
I've recently been tasked with writing a Sage import tool that imports Quantity Price
I'm tasked with 2 things that I'm not seeing support for. Writing a script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.