Link to home
Start Free TrialLog in
Avatar of jdonaghe
jdonagheFlag for United States of America

asked on

Set Harddrive On/Offline

I am trying to replicate a manual process I am doing in the disk management section of a server I am working with.  The server is Windows 2008 R2 Standard.
1. I go into the Disk Management Section
2. Right click on a basic drive and select "Offline"
3. Change out my harddrive
4. Right click on the same basic drive and select "Online"

How can I replicate this process in VB.NET code?  Is it possible?
SOLUTION
Avatar of Shahan Ayyub
Shahan Ayyub
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jdonaghe

ASKER

Actually this partially solves my problem.  I was going to ask about Server 2003 after I got the 2008 problem solved.  This solution helps with 2003 because it disables the drive like I would in the device manager.  But when I checked the device manager in 2008, if I took the drive offline in the disk management it still showed being active in the device manager.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Although both these solutions did not replicate the exact steps I would take on the 2008 server, both solutions worked fine.  The only thing I found out was when I am ready to enable the drive again I had to wait 30 seconds to a minute to let the hardware recognize there was a drive there, then I would enable it.  Thanks for your help.