Check partitioning in script (cmd/vbscript) on Windows
We're deploying Bitlocker in our company. By default, all the computers
only have 1 partition on the main HDD, however some users have
repartitioned their drives (although they're not allowed to).
Now we could either enable Bitlocker on data drives or we could use this
opportunity to check the drive partitioning. Since multiple partitions
cause problems with our enterprise environment we chose the latter.
There are two allowed states:
1 active primary partition (spanning the entire HDD) with Windows on it
2 primary partitions - 1 300MB active and 1 spanning the rest of the drive
with Windows installed
Everything else is not allowed.
The way I see it, I need to identify the partition Windows is now running
from, find the HDD that partition is on and check partitioning on that
drive.
Unfortunately I have no idea how to do that in a script.
The target machines are running Windows 7 Enterprise. I can use windows
batch/VBScript/PowerShell. Perhaps some WQL in VBScript?
I'll be grateful for any advice.
No comments:
Post a Comment