Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows Server 2016 / The Disk is Offline Because of Policy Set by an Administrator

June 7, 2022 Windows 10Windows Server 2016

The Disk is Offline Because of Policy Set by an Administrator

On one of the servers running Windows Server 2016, an additional disk (not a system one) connected as a SAN LUN over FC gets offline after each restart of the server. If you open Disk Management console (diskmgmt.msc), you can see that this disk is in Offline state.

Windows Server 2016 Offline disk because of policy set by an administrator

To make the disk available in Windows, right-click it and take it online. You will have to do it after each server restart. I don’t think you are happy with that.

make disk online on windows server via disk management

First of all, I suspected that after a power outage in the server room, the storage systems booted later than the physical server. However, after a soft server reboot the disk went offline as well.

Note the popup message about a disconnected disk in the Disk Management:

Offline (The disk is offline because of policy set by an administrator).

As it turned out, this problem may appear in the failover cluster environments or virtual machines running Windows that have any shared disks can be accessed by several operating systems. It is related to the SAN Policy that appeared in Windows Server 2008. This policy controls automatic mounting of external disks and is used to protect shared disks available to multiple servers at once. By default, the Offline Shared (VDS_SP_OFFLINE_SHARED) policy is used for all SAN disks on Windows Server. You can change your SAN Policy to OnlineAll using Diskpart.

Run the command prompt as administrator and run the diskpart. In diskpart context, display the current SAN policy:

DISKPART> san

SAN Policy : Offline Shared

Change your SAN Policy:

DISKPART> san policy=OnlineAll

DiskPart successfully changed the SAN policy for the current operating system.

DISKPART set san polic to OnlineAll

View the current policy again:

DISKPART> san

SAN Policy : Online All

Select your disk (in our example, the disk index is 2):

DISKPART> select disk 2

You can view its attributes:

DISKPART> attributes disk

Make sure that the Read-Only attribute is not enabled. If it is, disable it, otherwise when trying to write something on the disk, you will see this message: The disk is write protected:

DISKPART> attributes disk clear readonly

Take the disk online:

DISKPART> online disk

DiskPart successfully onlined the selected disk
You can manage your disks not only in Diskpart, but also using the integrated PowerShell Storage module. For example, to take a disk online, run this command:

Set-Disk 2 -IsOffline 0

Close diskpart, restart your server and make sure that the disk is available after boot.

It turned out that the problem of unavailability of connected disks is typical not only for Windows Server, but also for all desktop Windows versions. For example, if you connect an external USB drive or an SSD in Windows 10, you can also see the following disk status (Offline – The disk is offline because of policy set by an administrator) in the Device Manager:

windows 10 usb/ssd disk is offline because of policy set by an administrator

In Windows 10, the issue with the offline disks is solved in the same way: you need to change the SAN policy. If the disk is new, you may need to initialize it and create file system partitions on it.

9 comments
0
Facebook Twitter Google + Pinterest
previous post
How to Backup Hyper-V Virtual Machines (Tutorial)
next post
VMWare: How to Find VMs by IP or MAC Address?

Related Reading

How to Connect VPN Before Windows Logon

November 14, 2023

Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

November 7, 2023

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

9 comments

Tom Schreur April 15, 2020 - 7:13 pm

Thank you. Helped immensely and solved my issue.

Reply
steve May 2, 2020 - 3:50 pm

Have been looking for this info for a long time, a long long time. Thank you.

Reply
Darrel Merkey July 10, 2020 - 6:40 pm

Did not work for me! It still says “Diskpart failed to clear disk Attributes.”

Reply
John July 29, 2020 - 2:07 pm

Great Resource and much cleaner than some others. Thank you!!!!!!!!!!!!!!!!

Reply
Dag S Hansen November 2, 2020 - 7:44 am

Ran into this problem when moving VMs from Hyper-V to VMWare and your post had us quickly fix the problem.

Reply
Shekhar December 23, 2020 - 11:28 am

Very helpful and precise..

Reply
Frustrated April 6, 2021 - 11:10 am

Just here to say thanks a ton, was pulling my hair out for a bit.

Reply
Darwin April 6, 2021 - 10:59 pm

I’m trying to fix corrupt hard drive for three days. I cant recover and reinstall windows because I cant create partition. It says write protected. I install windows on usb to access disk management the drive is offline so I search google and brought me here. Now I fixed and recover my files. Thank you…

Reply
Alfred April 24, 2023 - 10:25 am

Thank you immensely. It helped!!

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Booting Windows 7 / 10 from GPT Disk on BIOS (non-UEFI) systems
  • Removable USB Flash Drive as Local HDD in Windows 10 / 7
  • How to increase KMS current count (count is insufficient)
  • How to Disable UAC Prompt for Specific Applications in Windows 10?
  • How to Connect L2TP/IPSec VPN Server From Windows
  • Managing Printers and Drivers with PowerShell in Windows 10 / Server 2016
  • Managing Printers from the Command Prompt in Windows 10 / 8.1
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top