1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| option explicit
on error resume next
' Declare the variables
dim wshNet, wshShell, userName,UserObj, DomainName,ProfileOutlook,ObjFs,testcle,ServeurExchange
dim strcomputer,Arrvalues,CleReg,ObjRegistry
' Create a WshNet object
set wshNet = createObject("wscript.Network")
' Create a wshShell object
set wshShell = createObject("wscript.shell")
' Create an Object File System object
SET objFS=CreateObject ("Scripting.FileSystemObject")
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
UserName=WshNet.username
ServeurExchange="srv_intra"
' Config Outlook
If objfs.fileexists(WshShell.ExpandEnvironmentStrings("%systemroot%")+"\fonts\outlook.ttf") Then
TestCle=WshShell.RegRead("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\"+username+"\0a0d020000000000c000000000000046\000b0340")
If Err.number<>0 Then
Err.clear
ProfileOutlook=WshShell.ExpandEnvironmentStrings("%logonserver%")+"\NETLOGON\richProfile "+ServeurExchange+" "+ username+" "+ username
' msgbox(ProfileOutlook)
wshShell.run ProfileOutlook,,true
'Affectation du cache local
arrValues = Array(132,5,0,0)
CleReg="Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\"+username+"\13dbb0c8aa05101a9bb000aa002fc45a"
objRegistry.SetBinaryValue HKEY_CURRENT_USER, CleReg, "00036601", arrValues
Else
wscript.echo "Le profile outlook existe!"
End If
else
wscript.echo "Pas de outlook"
End IF |
Partager