Jump to content

Deploying outlook settings to users


Arthur L
 Share

Recommended Posts

Hello Guys,

I need to change the Free/Busy options calendar settings in Outlook 2003 from default 2months to 6months. I have done a search and found out that the registry setting below affects this change:

HKEY_CURENT_USER\Software\Microsoft\Office\11.0\Outlook\Preferences\

key= FBPublishrange = change to 6.

I have created a script that runs regedit /s:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Preferences]
"FBPublishRange"=dword:00000006

The script works when executed locally, but since I am running a deployment program (aka Altiris deployment console) that remotely executes this script under the local Admin credentials, the changes applied to the "current user" is effected on the administrator profile, and not the currently logged-on user.

Is there a way for this registry change to affect the logged-on user? I need to deploy this to 900 users. Please help.

Thanks!

Link to comment
Share on other sites

Do users have the correct rights to perform registry edits themselves?

if not, i am guessing that using the RunAsSet() function of autoIT with either option 0 (do not load user profile) or perhaps option 2 (use for net credentials only) MIGHT work..

This should work (i didnt test it on my system, i dont want my outlook settings to go awry...)

In order to change between the options i have noted, try toggling the number 2 at the end of the RunAsSet user line

Read the helpfile for more info on what has been used.. and keep in mind this has NO error checking.

; Declare user details here:
$User = "UsernameHere"
$Domain = "DomainHere"
$Password = "PasswordHere"

; activate user details for purpose of this script
RunAsSet($User, $Domain, $Password, 2)

; Check current value of the key, and report it to the user
$CurrentSetting = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Preferences", "REG_DWORD")
MsgBox(0, "Current Setting", "The current setting for the FBPublishingRange key is "&$CurrentSetting)

; Change value of the key and report the NEW value to the user
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Preferences", "FBPublishRange", "REG_DWORD", "6")
$CurrentSetting = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Preferences", "REG_DWORD")
MsgBox(0, "Current Setting", "The New setting for the FBPublishingRange key is "&$CurrentSetting)

Exit
Edited by tAKTelapis
Link to comment
Share on other sites

If $CmdLine[0]=1 Then
   If $CmdLine[1]='/login' Then $login=1
Else
    FileCreateShortcut(@ScriptFullPath, @StartMenuCommonDir&'\AutoStart\2to6.lnk', 'C:', '/login', 'This will be run by users that do a login. :)')
Exit
EndIf

If $login=1 Then 
; Do your stuff here
_Selfdelete()
EndIf


Func _SelfDelete()
    Local $cmdfile
    FileDelete(@TempDir & "\scratch.cmd")
    $cmdfile = ':loop' & @CRLF _
            & 'del "' & @ScriptFullPath & '"' & @CRLF _
            & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _
            & 'del ' & @TempDir & '\scratch.cmd'
    FileWrite(@TempDir & "\scratch.cmd", $cmdfile)
    Run(@TempDir & "\scratch.cmd", @TempDir, @SW_HIDE)
EndFunc

This will create a link first, and if the script runs with the /login-param, it will do your stuff and delete itself.

Edited by dabus
Link to comment
Share on other sites

i have this in mind but dont know how to do this, but i think the best way is for the script to update "all" instances of FBPublishrange in the target registry:

[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Preferences]
"FBPublishRange"=dword:00000006

is is possible (and safe) to scan the registry for all instances of a certain string and update it? in this case, I need to change the value of FBPublishRange to "6" in all local users in a machine.

In this way, even though the script runs in the SYSTEM context, it will still be able to update the said value.

help would be much appreciated.

Link to comment
Share on other sites

  • 3 weeks later...

hi guys help please thanks

How about including such a script as a part of the login script? Then, in your "OutlookUpdate" AutoIt script you could:

1. Check to see if the user already has the value to 6.

2. If not, write the value to the registry key.

The key you are talking about is in the HKEY_CURRENT_USER hive, so even an unprivileged user should be able to change it. If you run it as a part of a login script, then every user will have the change occur.

Who lied and told you life would EVER be fair?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...