I wanted a way to set some properties with spark without overwriting the users preferences. Here is the solution I came up with.
There are a few assumptions made. First you have powershell install on the workstation, that spark.properties is in the same location for everyone.
create a powershell script with the following, and then run it at logon script via GPO.
$updates=@{
'ssoEnabled'='true'
'server'='xmppserver.com'
'autoLoginEnabled'='true'
'toasterPopup'='true'
'windowTakesFocus'='true'
}
(Get-Content $env:APPDATA\spark\spark.properties) |
ForEach-Object{
$key=$_.Split('=')[0]
if($val=$updates[$key]){
'{0}={1}' -f $key,$val
}else{
$_
}
} |
Set-Content $env:APPDATA\spark\spark.properties
That's it. Hope this helps