Detecting Boot Camp installation with Casper

Not applicable

Scenario: 1000 deployed laptops. All users are admins.

Our AUP clearly states that they are not allowed to install Boot Camp
or virtualization software. I can (and have) easily detect a Parallels
or VMWare installation, but have not yet figured out how to detect if
the user has installed Boot Camp.

I've deleted the Boot Camp Assistant from the image, but a savvy user
will just get it from elsewhere.

How can I use Casper (v 7.2.1) to detect whether a machine has been boot-camped?

Thanks,

Damien Barrett
System Technician
Montclair Kimberley Academy
Montclair, NJ 07042
973-842-2812

4 REPLIES 4

ktrampe
New Contributor II

I would recommend running a script grepping diskutil list. Something like this:

diskutil list | grep "Microsoft"

The machines that I have bootcamp on returned partitions.

Hope this helps!
Kerry

Not applicable

I think you can do this with an extension attribute populated via a
script. You can use "diskutil list /dev/disk0" to bring up a list of the
partitions on the drive, which includes a column for type (HFS, etc.).
(I'm assuming that you don't have any fancy dual-drive laptops, so disk0
will always be the one and only internal startup disk.) I don't have any
Boot Camp partitions to check against, but I think you can then pipe the
diskutil output through sed/awk to pull out any NTFS/FAT partitions. You
could stop there and leave that as a flag for computers of interest, or
you could get fancy with some further scripting to check for the presence
of Windows OS files.

-Charlie

-------------------------------------
Charlie Smith
Desktop Engineer
Information Services Department (ISD)
MIT Lincoln Laboratory
244 Wood St. Lexington, MA 02420
Phone: 781.981.0854
E-mail: charlie.smith at ll.mit.edu
-------------------------------------

tlarkin
Honored Contributor

When I ran a dual boot image I would use the df command to see if there were NTFS partitions on any volume. I don't have an NTFS partition handy at the moment (my office has 5 Macs in it, and not a single install of Windows on them) but I basically just ran something like this

if [[ df | grep -c "NTFS" == 1 ]]

then echo "Windows detected" else echo "Windows not detected"

fi

That syntax could be super wrong since I don't have anything to test it with. Then I used dummy receipts but now with version 8 you can do extension attributes. You can also use diskutility command line as well.

Bukira
Contributor

!/bin/sh

echo "<result>diskutil list disk0 | grep disk0s3 | awk '{print $5}'</result>"

if you only have 1 parition normally this will output if you have a second parition together with its name, you could change to output the type

Criss

Criss Myers
Senior IT Analyst (Mac Services)
iPhone / iPad Developer
Apple Certified Technical Coordinator v10.5
LIS Development Team
Adelphi Building AB28
University of Central Lancashire
Preston PR1 2HE
Ex 5054
01772 895054