-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsmoe-exsync-check-at-logon.vbs
More file actions
24 lines (21 loc) · 1018 Bytes
/
smoe-exsync-check-at-logon.vbs
File metadata and controls
24 lines (21 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
' Script checks for the presence of an Outlook profile
' prior to running ExSync
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath2010 = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"
strKeyPath2013 = "Software\Microsoft\Office\15.0\Outlook\Profiles"
strKeyPath2016 = "Software\Microsoft\Office\16.0\Outlook\Profiles"
strValueName = "DefaultProfile"
objRegistry.GetStringValue HKEY_CURRENT_USER,strKeyPath2010,strValueName,dwValue
objRegistry.EnumKey HKEY_CURRENT_USER,strKeyPath2013, arrSubKeys2013
objRegistry.EnumKey HKEY_CURRENT_USER,strKeyPath2016, arrSubKeys2016
If IsNull(dwValue) AND IsNull(arrSubKeys2013) AND IsNull(arrSubKeys2016) Then
' Wscript.Echo "No Outlook Profile Exists"
Else
call signature()
End If
Function signature()
Set wshShell = WScript.CreateObject ("WSCript.shell")
wshshell.run """\\EXCHANGE\Signatures\exsync.exe""", 6, True
End Function