#76441 - 2003-08-19 08:10 PM
Outlook Profile UDF
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I only have win2k and outlook 2k, what would be missing for other common environments: code: OutlookProfile('test','S:\ModProf',,'ExchangeMail',@userid) function OutlookProfile($ProfileName, $ModProfDir, optional $default, Optional $ExchangeServer, optional $account, Optional $ldapServer) dim $tempfile, $defaultprofile $tempfile = '%temp%\modprof.prf' $DefaultProfile = ReadValue('HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles', "DefaultProfile") $default = iif($default and not $DefaultProfile = $ProfileName,'Yes','No') if not keyexist('HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\'+$ProfileName) copy '$ModProfDir\modprof.prf' $tempfile $ = WRITEPROFILESTRING ($tempfile, 'General', "Custom", "1") $ = WRITEPROFILESTRING ($tempfile, 'General', "ProfileName", $ProfileName) $ = WRITEPROFILESTRING ($tempfile, 'General', "DefaultProfile", $default) $ = WRITEPROFILESTRING ($tempfile, 'General', "OverwriteProfile", "Append") $ = WRITEPROFILESTRING ($tempfile, 'General', "DefaultStore", "Service2") $ = WRITEPROFILESTRING ($tempfile, 'General', "UniqueService", "Yes") $ = WRITEPROFILESTRING ($tempfile, 'Service List', "Service1", "Microsoft Outlook Client") $ = WRITEPROFILESTRING ($tempfile, 'Service List', "Service3", "Outlook Address Book") $ = WRITEPROFILESTRING ($tempfile, 'Service3', "Ben", "True") if $ExchangeServer and $account $ = WRITEPROFILESTRING ($tempfile, 'Service List', "Service2", "Microsoft Exchange Server") $ = WRITEPROFILESTRING ($tempfile, 'Service2', "HomeServer", $ExchangeServer) $ = WRITEPROFILESTRING ($tempfile, 'Service2', "MailBoxName", $account) endif if $ldapServer $ = WRITEPROFILESTRING ($tempfile, 'Service List', "Service4", "Microsoft LDAP Directory") $ = WRITEPROFILESTRING ($tempfile, 'Service4', "LDAPServer", $ldapServer) $ = WRITEPROFILESTRING ($tempfile, 'Service4', "SearchBase", right(join(split($ldapServer,'.'),',dc='),-1)) endif SHELL 'cmd /c $ModProfDir\modprof.exe -P $tempfile -x' sleep 1 DEL $tempfile ENDIF endfunction
Top
#76443 - 2003-08-19 08:17 PM
Re: Outlook Profile UDF
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
we have more than 1 mailserver. some people have access to the ldap server. some people have more than 1 profile.
Top
#76445 - 2003-08-19 08:40 PM
Re: Outlook Profile UDF
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I see your point... and I'm looking at it again.
Top
#76448 - 2003-08-20 02:30 PM
Re: Outlook Profile UDF
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Jooel, You trying to get me to simplify the FAQ too - Outlook/Exchange Configuration ? Yes, I know it is overkill. IIRC, we talked about using the ORK to do this as well. I think this this process is supported under a GPO as well. Kent
Top
#76450 - 2003-08-20 02:53 PM
Re: Outlook Profile UDF
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
code: function OutlookProfile($ProfileName, $ModProfDir, $ExchangeServer, $account, optional $default) dim $tempfile, $defaultprofile $WMSProfiles = 'HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles' $tempfile = '%temp%\modprof.prf' $DefaultProfile = ReadValue($WMSProfiles, "DefaultProfile") $default = iif($default and not $DefaultProfile = $ProfileName,'Yes','No') if not keyexist($WMSProfiles+'\'+$ProfileName) copy '$ModProfDir\modprof.prf' $tempfile $ = WRITEPROFILESTRING ($tempfile, 'General', "ProfileName",$ProfileName) $ = WRITEPROFILESTRING ($tempfile, 'Service2',"HomeServer", $ExchangeServer) $ = WRITEPROFILESTRING ($tempfile, 'Service2',"MailBoxName",$account) SHELL 'cmd /c $ModProfDir\modprof.exe -P $tempfile -x' if not @error $OutlookProfile=1 else exit @error endif sleep 1 DEL $tempfile ENDIF if $default='Yes' $=writeValue($WMSProfiles,'DefaultProfile',$ProfileName,REG_SZ) endif endfunction
Top
#76451 - 2003-08-20 03:10 PM
Re: Outlook Profile UDF
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
you still left the iif like it was. well, I took the liberty to change your latest:function OutlookProfile ($ProfileName , $ModProfDir , $ExchangeServer , $account , optional $default )
dim $tempfile
$WMSProfiles = 'HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles'
$tempfile = '%temp%\modprof.prf'
if not keyexist ($WMSProfiles +'\' +$ProfileName )
copy '$ModProfDir\modprof.prf' $tempfile
$ = WRITEPROFILESTRING ($tempfile , 'General' , "ProfileName" ,$ProfileName )
$ = WRITEPROFILESTRING ($tempfile , 'Service2' ,"HomeServer" , $ExchangeServer )
$ = WRITEPROFILESTRING ($tempfile , 'Service2' ,"MailBoxName" ,$account )
SHELL 'cmd /c $ModProfDir\modprof.exe -P $tempfile -x'
if @error
exit @error
endif
sleep 1
DEL $tempfile
endif
if $default
$ = writeValue ($WMSProfiles ,'DefaultProfile' ,$ProfileName ,REG_SZ )
if @error
exit @error
endif
endif
endfunction
anyway, got another question... what if there is profile with same name but with wrong values?
_________________________
! download
KiXnet
Top
#76452 - 2003-08-20 03:41 PM
Re: Outlook Profile UDF
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
users are too stupid to create a profile on their own... and if so, they usually leave the profile name as default (MS Exchange Settings, Default Outlook Settings)
Top
Moderator: Glenn Barnas , NTDOC , Arend_ , Jochen , Radimus , Allen , ShaneEP , Ruud van Velsen , Mart
0 registered
and 1821 anonymous users online.