Retrieve Drives

 

Applies To: Windows Server 2012 Essentials

Retrieves a list of drives on the server.

URI Template

GET services/builtin/StorageManagement.svc/serverdrives/index/{index}/count/{count}

{index}
The numerical position of the first drive to be retrieved.

{count}
The number of drives to be retrieved.

Sample Request

GET https://www.contoso.com/services/builtin/StorageManagement.svc/serverdrives/index/0/count/2147483647 HTTP/1.1  
Accept: application/xml  
Cookie: ASP.NET_SessionId=********************  
Canary: *********************  
Host: domainname  

Sample Response

HTTP/1.1 200 OK  
Cache-Control: private  
Content-Length: 2355  
Content-Type: application/xml; charset=utf-8  
Server: Microsoft-IIS/8.0  
X-AspNet-Version: 4.0.30319  
X-Powered-By: ASP.NET  
X-Content-Type-Options: nosniff  
Date: Mon, 19 Dec 2011 06:39:38 GMT  
<PartialCollection_Of_DriveInfo  
    xmlns="http://contracts.microsoft.com/WindowsServerSolutions/2011/09/ManagementWebApi"  
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance">  
  <CollectionChunk>  
    <DriveInfo>  
      <Capacity>107217350656</Capacity>  
      <DataStatus>MountError</DataStatus>  
      <DiskID>74f58432-2df4-46ce-88e1-c6e1a406db5c</DiskID>  
      <DriveGuid>f43f274a-3b93-4a29-8287-f420588c40dc</DriveGuid>  
      <FileSystemType>NTFS</FileSystemType>  
      <ID>18f5c031-a305-4446-9d6f-f8f047a70ee7</ID>  
      <MountPoint/>  
      <Name>backup</Name>  
      <NextSnapshotTime>12/31/9999 11:59:59 PM</NextSnapshotTime>  
      <SnapshotsEnabled>false</SnapshotsEnabled>  
      <Status>Healthy</Status>  
      <SystemDrive>false</SystemDrive>  
      <UsedSpace>116244480</UsedSpace>  
    </DriveInfo>  
  </CollectionChunk>  
  <CollectionModified>2011-12-19T14:39:38.331881+08:00</CollectionModified>  
  <CollectionSize>4</CollectionSize>  
</PartialCollection_Of_DriveInfo>  

Error Codes

Error Code Error Message
400 One or more parameters are not valid.
401 Access is denied to the requested resource.
404 The path does not exist.

Remarks

The information that is obtained from calling this method can be used for the creation of shared folders.

See Also

Web Service Methods