none
List all Top Level Site Collections in Sharepoint 2013 - Getting 401 Unauthorized when calling SiteData web service - GetContent of type VirtualServer as a non-admin? RRS feed

  • Question

  • On SharePoint 2013 I'm trying to call /_vti_bin/SiteData.asmx soap web service with payload which will list all Top level site collections in a root sharepoint site:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.microsoft.com/sharepoint/soap/">
       <soapenv:Header/>
       <soapenv:Body>
          <soap:GetContent>
             <soap:objectType>VirtualServer</soap:objectType>
             <soap:retrieveChildItems>true</soap:retrieveChildItems>
             <soap:securityOnly>false</soap:securityOnly>
          </soap:GetContent>
       </soapenv:Body>
    </soapenv:Envelope>

    You can then take that Content Database entry and send another GetContent soap request to get a list of all sites. Example:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.microsoft.com/sharepoint/soap/">
       <soapenv:Header/>
       <soapenv:Body>
          <soap:GetContent>
             <soap:objectType>ContentDatabase</soap:objectType>
             <soap:objectId>{952cf00a-81af-440c-bd7c-5e91d15ac75d}</soap:objectId>
             <soap:retrieveChildItems>true</soap:retrieveChildItems>
             <soap:securityOnly>false</soap:securityOnly>
          </soap:GetContent>
       </soapenv:Body>
    </soapenv:Envelope>

    But i'm getting a 401 error during the first request every time because I do not have access with my site collection admin account.

    But my SharePoint administrator can call this fine.

    Can you help me figure out how to give my non-admin account permission to call this service?

    Sunday, December 3, 2017 10:55 PM

Answers

  • Are you sure?

    I went into:

    Sharepoint central administration ->  Manage web applications -> Select the root web app -> Permission Policy

    I added a new policy with only two permissions:

    * Check "Site Collection Auditor"
    * Check View application page



    Assigned this to my user now I can call that.

    Monday, December 4, 2017 3:24 PM

All replies

  • You can not do this unless you have the admin permission.

    Justin Liu Office Servers and Services MVP, MCSE
    Senior Software Engineer
    Please Vote and Mark as Answer if it helps you.

    Monday, December 4, 2017 1:23 AM
  • Are you sure?

    I went into:

    Sharepoint central administration ->  Manage web applications -> Select the root web app -> Permission Policy

    I added a new policy with only two permissions:

    * Check "Site Collection Auditor"
    * Check View application page



    Assigned this to my user now I can call that.

    Monday, December 4, 2017 3:24 PM
  • Hi,

    Thank you for your feedback.

    You can mark your solution  as answer so it would help other community members find the helpful information quickly.

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, December 6, 2017 1:12 AM