Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 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.

12 comments
4
Facebook Twitter Google + Pinterest
previous post
How to Backup Hyper-V Virtual Machines (Tutorial)
next post
Get-MessageTrackingLog: Search Message Tracking Logs on Exchange Server

Related Reading

Change BIOS from Legacy to UEFI without Reinstalling...

April 21, 2025

Uninstalling Windows Updates via CMD/PowerShell

April 18, 2025

Allowing Ping (ICMP Echo) Responses in Windows Firewall

April 15, 2025

How to Pause (Delay) Update Installation on Windows...

April 11, 2025

How to Prefer IPv4 over IPv6 in Windows...

April 9, 2025

12 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
LOUASSIER March 23, 2024 - 4:55 pm

Merci, génial ça faisait des mois que je cherchais cette solution.

Reply
Thomas December 23, 2024 - 5:20 pm

i want all usb devices to be offline by default, how can I set this? basically setting so i can connect to a VM, I don’t want the Host OS to see any drives plugged in, this is for security reasons. a basic sandbox.

Reply
Serg January 6, 2025 - 7:55 am

Try to change the default SAN policy to Offline All:

Specifies that all newly discovered disks except the startup disk are offline and read-only by default.

diskpart
DISKPART> san
DISKPART> san policy=offlineAll

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

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

  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Booting Windows from GPT Disk on BIOS (non-UEFI) Computer
  • Removable USB Flash Drive as Local HDD in Windows
  • How to increase KMS current count (count is insufficient)
  • How to Disable UAC Prompt for Specific Applications in Windows
  • How to Connect L2TP/IPSec VPN Server From Windows
  • Managing Printers and Drivers on Windows with PowerShell
  • How to Install Only Specific Apps in Office 2021/2019 or Office 365
Footer Logo

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


Back To Top