# Identify LUN for each dt.entity.disk on a windows server

**URL:** <https://community.dynatrace.com/t/identify-lun-for-each-dt-entity-disk-on-a-windows-server/47225>\
**Category:** DQL\
**Tags:** dql, infrastructure-operations\
**Created:** [August 21, 2024, 4:34am UTC](https://community.dynatrace.com/t/identify-lun-for-each-dt-entity-disk-on-a-windows-server/47225 "2024-08-21T04:34:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlanFoley](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@AlanFoley](https://community.dynatrace.com/u/AlanFoley)\
**Post date:** [August 21, 2024, 4:34am UTC](https://community.dynatrace.com/t/identify-lun-for-each-dt-entity-disk-on-a-windows-server/47225/1 "2024-08-21T04:34:53Z")

</div>

Hi All

I have a simple DQL Disk query which provides basic Disk info - I need more 🙂

fetch dt.entity.disk  
| fieldsAdd belongs\_to[dt.entity.host]  
| filter belongs\_to[dt.entity.host] ==“HOST-xx”  
| filterOut startsWith(entity.name,“\\”)

I would like to know if the following info is accessible within Dynatrace

1. On a windows server to be able to identify the Logical Unit Number (LUN) for each drive as seen by the OS

2. Identify if the windows drive is physically on the server or is a mapped drive (excluding \\servername\folder type mappings)

If the info above is not accessible by default in Dynatrace how could it best be extracted within Dynatrace

Yes I can run a PowerShell script against each server to extract this but ideally I want to be able to consume this within Dynatrace

Any suggestions?

Appreciate the help

Thanks

Alan

---

<div class="post-metadata">

**Author:** ![MaciejNeumann](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@MaciejNeumann](https://community.dynatrace.com/u/MaciejNeumann)\
**Post date:** [November 29, 2024, 6:58am UTC](https://community.dynatrace.com/t/identify-lun-for-each-dt-entity-disk-on-a-windows-server/47225/2 "2024-11-29T06:58:47Z")

</div>

Hello&nbsp;[@AlanFoley](https://community.dynatrace.com/user/41772),

I’ve asked your questions our developers, and this is the information that they’ve provided:  
"&nbsp;1. On a Windows server to be able to identify the Logical Unit Number (LUN) for each drive as seen by the OS → not possible  
2. Identify if the Windows drive is physically on the server or is a mapped drive (excluding \\servername\folder type mappings) → not many options here other than what is already done&nbsp; (starts with “\\”). Alternatively, this condition can be checked:&nbsp;`verbatimFilesystem != ntfs && verbatimFilesystem != smb`  
In general, in Dynatrace&nbsp;`DISK`&nbsp;entity does not represent a physical device but rather a logical partition or a mount point on Linux. It’s not actually hardware monitoring but monitoring of the OS-related entities."

---

<div class="post-metadata">

**Author:** ![AlanFoley](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@AlanFoley](https://community.dynatrace.com/u/AlanFoley)\
**Post date:** [November 29, 2024, 9:01am UTC](https://community.dynatrace.com/t/identify-lun-for-each-dt-entity-disk-on-a-windows-server/47225/3 "2024-11-29T09:01:45Z")

</div>

Thank you for the feedback  
I can extarct the details as follows for Azure and then I will use ServiceNow to populate the LUN information into our CMDB - similar to the PowerShell command below

Use the following command to list disks and their LUNs:

**Azure PowerShell** :

Get-AzVM -ResourceGroupName \<ResourceGroupName\> -Name \<VMName\> |

Select-Object -ExpandProperty StorageProfile |

Select-Object -ExpandProperty DataDisks |

Select-Object Lun, Name

**Windows Server PowerShell** :

1. 
  - On the Windows VM, use:

Get-Disk | Select-Object Number, FriendlyName, OperationalStatus, Size,

@{Name=‘DriveLetters’;Expression={($\_ | Get-Partition).DriveLetter}},

@{Name=‘LUN’;Expression={$\_.UniqueId}}

---

<div class="post-metadata">

**Author:** ![AlanFoley](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@AlanFoley](https://community.dynatrace.com/u/AlanFoley)\
**Post date:** [November 29, 2024, 9:02am UTC](https://community.dynatrace.com/t/identify-lun-for-each-dt-entity-disk-on-a-windows-server/47225/4 "2024-11-29T09:02:10Z")

</div>

we can close this request
