4 Responses

  1. Barrie
    Barrie at |

    You could also use native Powershell disk commands to avoid cmd tools

    $offlinedisks = get-disk | where OperationalStatus -EQ offline

    foreach ($disk in $offlinedisks)

    {Set-Disk -Number $disk.Number -IsOffline $false

    Set-Disk -Number $disk.Number -IsReadOnly $false}

    Reply
    1. @vcdxnz001
      @vcdxnz001 at |

      Thanks Barrie, that's a great suggestion.

      Reply
  2. Windows Script for Marking All Disks Online — Long White Virtual Clouds | Farhan Parkar's Weblog

    […] via Windows Script for Marking All Disks Online — Long White Virtual Clouds […]

  3. Rob
    Rob at |

    Corrected version

    $offlinedisks = Get-Disk | Where-Object OperationalStatus -EQ ‘Offline’
    foreach ($disk in $offlinedisks)
    {
    Set-Disk -Number $disk.Number -IsOffline $false
    Set-Disk -Number $disk.Number -IsReadOnly $false
    }

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.