1

I have to check whether a given node contains any dynamic disk or not and get the list of dynamic disk using Power Shell script. I am not supposed to use diskpart command. Any other solutions other than diskpart will be appreciated.

1
  • We can't write a whole script for you. Please use the answer of @Midacts and try to create a script. If you struggle anywhere we can help. Commented Mar 12, 2020 at 12:06

2 Answers 2

2

https://social.technet.microsoft.com/Forums/windowsserver/en-US/cd7c0327-3fe9-45fc-a177-5a9927d468f3/does-the-getdisk-funtion-only-return-basic-disks?forum=winserverpowershell

Get-WmiObject Win32_DiskPartition -filter "Type='Logical Disk Manager'" | Select-Object *

Sign up to request clarification or add additional context in comments.

5 Comments

There are other types also which tend to Dynamic disk, below I have listed all possible value of "Type" of a partition.
"Unused", "12-bit FAT", "Xenix Type 1", "Xenix Type 2", "16-bit FAT", "Extended Partition", "MS-DOS V4 Huge", "Installable File System", "PowerPC Reference Platform", "UNIX", "NTFS", "Win95 w/Extended Int 13", "Extended w/Extended Int 13", "Logical Disk Manager", "Unknown"
reddit.com/r/PowerShell/comments/4dmicj/… Seems like you'd just want to add the other 'Types' you'd want to filter.
but I don't know which type belongs to dynamic and which belong to basic
the link uses 'Logical Disk Manager'
0

you may use also diskpart utility, which is easily scriptable (I worked with it in Python) the idea is that when you perform diskpart and then list disk, output will be like:

Disk ###  Status         Size     Free     Dyn  Gpt
--------  -------------  -------  -------  ---  ---

Disk 0 Online 476 GB 0 B *

So you'll see all dynamic disks marked with asterisk under "Dyn"

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.