Arthur L Posted February 20, 2007 Share Posted February 20, 2007 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 More sharing options...
tAKTelapis Posted February 20, 2007 Share Posted February 20, 2007 (edited) 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 February 20, 2007 by tAKTelapis Link to comment Share on other sites More sharing options...
Arthur L Posted February 20, 2007 Author Share Posted February 20, 2007 Thanks for the immediate reply @tAKTelapis. I'll try it later. Link to comment Share on other sites More sharing options...
Arthur L Posted February 20, 2007 Author Share Posted February 20, 2007 sad to say, the script above didn't work as well Link to comment Share on other sites More sharing options...
Arthur L Posted February 20, 2007 Author Share Posted February 20, 2007 I have done some test and when I remotely deploy the script, it runs under the SYSTEM context. Link to comment Share on other sites More sharing options...
dabus Posted February 20, 2007 Share Posted February 20, 2007 (edited) 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 February 20, 2007 by dabus Link to comment Share on other sites More sharing options...
Arthur L Posted February 22, 2007 Author Share Posted February 22, 2007 thanks dabus, i'll give this a shot, although im quite puzzled how this works.. thanks a lot for the effort Link to comment Share on other sites More sharing options...
Arthur L Posted February 22, 2007 Author Share Posted February 22, 2007 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 More sharing options...
Arthur L Posted February 26, 2007 Author Share Posted February 26, 2007 hi guys help please thanks Link to comment Share on other sites More sharing options...
benched42 Posted March 13, 2007 Share Posted March 13, 2007 hi guys help please thanksHow 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now