Skip to main content
Solved

FileVault User Add script Help


Did this topic help you find an answer to your question?
Show first post

Forum|alt.badge.img+6

Just a heads up with this script that there were changes to 10.10 and FileVault enablement, so this script won't work on 10.10 clients.


Forum|alt.badge.img+7
  • Contributor
  • December 18, 2014

HI there, yep it would appear that 10.10 has some differences, Derfiounder writes yup about it here https://derflounder.wordpress.com/category/filevault-2/ Hopefully Apple will sort it or it may be back to the drawing board with this... :(


Forum|alt.badge.img+1
  • New Contributor
  • February 12, 2015

Since I am just pretty opposed to giving up on an approach, I think the expect file works if you escapte the quotes for the expect commands, and then call the environment variables by name. In my testing, it looked something like this:

export LOCALPASSWORD
export USRNAME
expect -c "spawn sudo /usr/bin/fdesetup add -usertoadd "${USRNAME}"; expect ":"; send "Sekr3tPa$$W0Rd
" ; expect ":"; send "${LOCALPASSWORD}
"; expect eof"

edit notes: previous expect command had a dangling space after a semicolon, which was preventing matching


Forum|alt.badge.img+16
  • Valued Contributor
  • May 14, 2015

Any updates on this working under Yosemite?

I'm curious to see if this will work, but haven't spent very long working through the script provided by @stevewood to figure out how to apply @mrcamuti's modification.


Forum|alt.badge.img+7
  • Contributor
  • June 16, 2015

Yosemite has actually really messed this up for me, we are getting to the stage where we are going to need to upgrade all of the hardware soon and now we are being forced for SOX compliance on this. The amount of freelancers we have is going to make this a living hell having to manage each user and machine manually...

Anyone ever get any breakthrough with Yosemite and auto enabling AD accounts?


Forum|alt.badge.img+16
  • Valued Contributor
  • June 16, 2015

@Treger What we're planning on doing for now, and we haven't started our AD deployment just yet, is we have a non-admin local account. This is a backup account for users in the field who may not have authenticated to the machine but still need to use it. It's a non-admin account which has FileVault access. Fora user in the field they can log in and edit video and check web mail and upload files, but that's about it. But if they're in one of our offices they can use that account to unlock FileVault and then they can log out and back in with their NT account which gives them admin permissions and they can add their account to FileVault.

We'd rather have an AppleScript that they can use to enable their FileVault access than have them to the Security Pref Pane though.


Forum|alt.badge.img+7
  • Contributor
  • June 16, 2015

@cwaldrip for us, what I have done is on 10.9 the script in this post works great for auto enabling the user, they require to be on the network to log into the machine so on 10.9 it negated me having to have a local account for access, plus with the forked version of ADPassMon to sync the Keychain you loose the sync issues between that and the AD user accounnt password. Now with 10.10 the script does not work to auto enable accounts, I have options now one of them is what you mentioned above, however this comes with huge amounts of paperwork to be covered by SOX to make it compliant. So now I am stuck between having the manual labour of having to make sure each machine is setup or I am going to have stacks of paperwork to go through to cover SOX. I have not made my decision yet on which path I am going to take on this aspect but if I could get this script working on Yosemite I could dodge all these bullets... I am also still considering a backup account for access to the machine remotely but again, this I now have to take into account the SOX implications...


Forum|alt.badge.img+7
  • Contributor
  • June 16, 2015

The one issue I will state with the Apple Script is it is reliant on the user having the savvy to actually activate it, I don't know about you but mine are not so... I thought about serving a script through Self Service but I ran into the same issue where if the user "got busy" and forgot to enable thier account before leaving the building I am still going to get the offsite phone call to say "I cannot access my machine help me!!" at which point it would take up time again trying to explain how to access the machine, I went for the solid approach of just trying to get the whole process automated so we could avoid all the anguish.


mm2270
Forum|alt.badge.img+16
  • Legendary Contributor
  • June 16, 2015

I'm a little confused here. Some of you are talking about this not working in Yosemite. Are you talking about the script from JAMF?
I'm asking because I have a similar script utilized in Self Service by users to fix their FileVault password sync problems under 10.10. Its using an input plist with fdesetup and works fine, but it does require that the user know and enter their password(s) to work. (Using cocoaDialog to capture that)
So, what exactly doesn't work anymore here?


Forum|alt.badge.img+7
  • Contributor
  • June 17, 2015

Hi @mm2270

The part that is not working anymore is the script from JAMF that @stevewood modified to work in the AD environment, The Keychain issue is not really the end of the world, as I said with the forked version of ADPassMon this should resolve that part of it for me...


Forum|alt.badge.img+5
  • New Contributor
  • February 19, 2016

I came into an environment that had over 60 machines that needed the local account added to FV access and they all had different individual encryption keys. Thankfully, the keys are in the JSS. This post was a huge help in writing that script. Thanks!


Forum|alt.badge.img
  • New Contributor
  • June 20, 2017

A slight modification to stevewood's solution. Instead of writing the .plist to a file you can pipe to fvesetup thereby avoiding writing the passwords to a file:

echo '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Username</key>
<string>'$4'</string>
<key>Password</key>
<string>'$5'</string>
<key>AdditionalUsers</key>
<array>
    <dict>
        <key>Username</key>
        <string>'$userName'</string>
        <key>Password</key>
        <string>'$userPass'</string>
    </dict>
</array>
</dict>
</plist>' | fdesetup add -i

Forum|alt.badge.img+8
  • Valued Contributor
  • January 28, 2018

I am using the script marked as the answer in this thread but i have a problem, I can't imagine I'm the only one with this issue.

The lines that check if the user is enabled ...

userCheck=fdesetup list | awk -v usrN="$userName" -F, 'index($0, usrN) {print $1}'

Kind of falls over if there are multiple users with similar names.

The Scenario I am facing is this...... the following users are FV Enabled but the script gets confused when Fred logs in.
Fred
FredC
FredH

As it returns multiple names to the string, I am trying everything I can think of to mod this line to make it look for the exact name and the exact name only, but nothing seems to yield the exact results i need.

Anyone offer any help on this ?


Forum|alt.badge.img+8
  • Valued Contributor
  • January 28, 2018

as an addendum, what order the usernames appear in the userCheck string also makes a large difference as well.

HELP !!!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings