You are not logged in.

Announcement

[2017.09.08] DeployStudio build v1.7.8 (checksum, release note).
[2016.08.26] DeployStudio build v1.6.19 (release note).
[2013.02.23] DeployStudio last universal build v1.5.17 (release note).

#1 2013-10-24 15:13:23

jelockwood
Member
Registered: 2009-11-11

Using DeployStudio to turn on Location Services?

I would like to have Location Services turned on during a workflow but I need this to take effect before DeployStudio then sets the computers network time server which (as desired) also causes the clock to be resynced during the workflow. This is so that the workflow step that sets the network time server and clock can use 'Current Location' to set the correct timezone.

A script to turn on location services is described here http://www.afp548.com/2013/07/30/enabling-location-services-programmatically/

Unfortunately this does not seem to work during the DeployStudio workflow and only works if run after the reboot, i.e. 'Postponed execution (command will be launched on first boot)'. This of course means it only gets run after the step that sets the network time server and hence clock. As I would also be doing a bind to Active Directory during the workflow which requires the correct time settings this is a problem.

Does anyone have any better ideas?

Offline

#2 2013-10-24 16:33:56

homerdjw
Member
From: London, England
Registered: 2013-01-24
Website

Re: Using DeployStudio to turn on Location Services?

Hi Jelockwood.

Why not write a script that will allow the location services to be turned on, then sets the NTP?

Bundle this into a payload free installer and run as a post-reboot workflow.

Hope that helps!

Darren

Offline

#3 2013-10-24 19:39:55

jelockwood
Member
Registered: 2009-11-11

Re: Using DeployStudio to turn on Location Services?

> homerdjw wrote:
>
> Hi Jelockwood.
>
> Why not write a script that will allow the location services to be turned on, then sets the NTP?
> Bundle this into a payload free installer and run as a post-reboot workflow.
> Hope that helps!
>
> Darren

I could do that but then I would also have to write a script to manually bind to AD as that has to be done after the clock is set correctly.

Offline

#4 2013-10-28 14:30:53

jelockwood
Member
Registered: 2009-11-11

Re: Using DeployStudio to turn on Location Services?

As it does not seem possible to do it before the NTP settings step, I think the approach I will use is as follows.

Make multiple copies of the workflow with most i.e. common steps in an inserted workflow
Have in the calling workflow steps to set the localizations i.e. keyboard layout etc., set the NTP setting - and specific timezone, and postponed execution of a script to set Location Services to on.

Offline

#5 2013-10-28 17:52:21

bryanzak
Member
Registered: 2013-10-06

Re: Using DeployStudio to turn on Location Services?

> jelockwood wrote:

> > homerdjw wrote:
>
> Hi Jelockwood.
>
> Why not write a script that will allow the location services to be turned on, then sets the NTP?
> Bundle this into a payload free installer and run as a post-reboot workflow.
> Hope that helps!
>
> Darren

I could do that but then I would also have to write a script to manually bind to AD as that has to be done after the clock is set correctly.
-----


Our bind script ties into the computer name to get the correct OU to bind to, but the core logic is super simple.... the following is not our entire script of course, but for Lion and later it should give you almost everything you need to bind...


timeServer="172.16.1.7"
alldomains="enable"
protocol="smb"
mobile="enable"
mobileconfirm="disable"
useuncpath="enable"
user_shell="/bin/bash"
preferred="-preferred xxxx"
admingroups="xxxx,yyyy"

SyncTime()
{
    echo -n "Updating current time: "
    ntpdate -u $timeServer | awk '/sec/ {print $(NF-1)}'
}

DeleteKerberos()
{
    echo "Deleting existing Kerberos configuration"
    rm -r -f /Library/Preferences/edu.mit.Kerberos
}

DisableMachinePassword()
{
    dsconfigad -passinterval 0
}

RestartDirectoryService_Lion()
{
    echo "Restarting Directory Service"
    killall opendirectoryd
}

ConfigureADOptions()
{
    echo "Configuring Advanced AD Options"
    dsconfigad -alldomains $alldomains -mobile $mobile -mobileconfirm $mobileconfirm -localhome enable $preferred
}

ConfigureADGroups()
{
    echo "Configuring Local Admins"
    dsconfigad -groups "$admingroups"
}


BindLion()
{
    SyncTime
    DeleteKerberos

    echo "Binding $computer_name to Active Directory"
    dsconfigad -add $domain -username "$my_network_name" -password "$my_network_pass" -computer $computer_name -ou "$ou"

    DisableMachinePassword

    ConfigureADOptions
    ConfigureADGroups   

    RestartDirectoryService_Lion   
}

Offline

Board footer

Powered by FluxBB