Fetch Drive Information of Windows devices
  • 02 Feb 2024
  • 1 Minute to read
  • PDF

Fetch Drive Information of Windows devices

  • PDF

Article summary

The following PowerShell script helps the IT Admins to remotely get the information about Drive(s) like the size, list of the contents stored on it, etc. on their managed Windows devices.

  1. Create a file on your desktop, for example, fetch_drive_info.ps1 and open it in a text editor like notepad++

  2. Copy the contents below to the file or click here to download the file.

    1. The details that are fetched are:

      1. Name: It lists the name of the drive.

      2. Used (GB): It lists the memory usage (in GB) by the drive.

      3. Free (GB): It lists the available memory space (in GB) in the drive.

      4. Provider: It lists the provider of the drive, which defines the logic that is used to access, navigate, and edit the drive to the computer.

      5. Root: It lists the root directory of the drive.

      6. CurrentLocation: It lists the path location at which the drive is stored on the device.

        Get-PSDrive
    2. You will be able to see the information in the Output tab in View Status report on the Scalefusion dashboard.

  3. Follow our guide to upload & publish the PowerShell script using Scalefusion Dashboard.

  1. You can also fetch details of a specific drive by mentioning the drive name. For example, if you would like to fetch information about the C drive, you can use the following script.

    1. Copy the contents below to the file or click here to download the file.

Set-Location C:\ 
Get-ChildItem

Please note that to use the PowerShell scripts, the Scalefusion MDM Agent Application must be installed on the device(s). Please follow our guide to publish and install the Scalefusion MDM Agent Application.

Notes:

  1. The scripts and their contents are sourced from various albeit authenticated Microsoft sources and forums.

  2. Please validate the scripts on a test machine before deploying them on all your managed devices.

  3. Scalefusion has tested these scripts, however, Scalefusion will not be responsible for any loss of data or system malfunction that may arise due to the incorrect usage of these scripts.


Was this article helpful?