'Script created by Aomar Bahloul to Silence VMO deployment for Outlook 2013. 'Created by Aomar Bahloul ' Email bahloul@dsrsd.com ' You can run this script as a logon script, it will create a VMO profile for all users and silence the VMO first start Wizard. ' Make sure you replace do-cucpub-01.dsrsd.com with the FQDN of your unity server,line 74 and 75 and replace DC=dsrsd,DC=com with your domain info, line 111 On Error Resume next Const HKEY_CURRENT_USER = &H80000001 strComputer = "." Set WshShell = WScript.CreateObject("WScript.Shell") Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\default:StdRegProv") Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set fso = CreateObject("Scripting.FileSystemObject") 'Get the logged in user-name sUserName = WshShell.ExpandEnvironmentStrings("%username%") 'WScript.Echo sUserName 'Check if VMO is installed If fso.FileExists("C:\Program Files (x86)\Cisco Systems\ViewMail for Outlook\VMOAddIn.dll") Then 'Check if the user-name exist on AD If (GetAdsPath(sUserName)<>"Empty") Then Set oUser=GetObject(GetAdsPath(sUserName)) Else WScript.Quit End if 'Check if IpPhone filed is not empty If isnull(oUser.iPphone) then WScript.Quit Else 'Registry Settings strValueName="Phone" strValueName0="Host" strValueName1="PlaybackDevice" strValueName2="RecordDevice" strValueName3="RecordingCodec" strValueName4="SearchFolderVersion" strValueName5="Type" strValueName6="ViewMailCategory" strValueName7="VoiceMailRequiresUserNameAndPassword" strValueName8="VoiceMailSSOCxnFailOverMode" strValueName9="VoiceMailSSOStrictMode" strValueName10="HasRun" strValueName11="DefaultServer" strValueName12="VoiceMailReplywithText" strValue1="Telephone" strValue2="Telephone" strValue3="7" strValue4="3" strValue5="Connection8.5 SIB" strValue6="ViewMail" strValue7="0" strValue8="0" strValue9="0" strValue10="1" strValue12="1" sCN=oUser.cn sEmail=oUser.mail 'WScript.Echo sCN 'WScript.Echo sEmail strKeyPath="Software\Cisco Systems\ViewMail for Outlook\Profiles\Outlook\Servers\"&sEmail 'Check if if Phone is not empty oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName0,strValue0 'Relace do-cucpub-01.dsrsd.com with the FQDN of your unity server If (IsNull(strValue)Or strValue0<>"do-cucpub-01.dsrsd.com") then strValue0="do-cucpub-01.dsrsd.com" Else WScript.Quit End If strValue=oUser.iPphone 'Create outlook profile oReg.CreateKey HKEY_CURRENT_USER, strKeyPath oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName0,strValue0 oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName1,strValue1 oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName2,strValue2 oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName3,strValue3 oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName4,strValue4 oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName5,strValue5 oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName6,strValue6 oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName7,strValue7 oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName8,strValue8 oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName9,strValue9 'Silence the Wizard strKeyPath1="Software\Cisco Systems\ViewMail for Outlook\Profiles\Outlook\Wizard" oReg.CreateKey HKEY_CURRENT_USER, strKeyPath1 oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath1,strValueName10,strValue10 'Enable reply with Text strKeyPath2="Software\Cisco Systems\ViewMail for Outlook\VoiceMailReplywithText" oReg.CreateKey HKEY_CURRENT_USER, strKeyPath2 oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath2,strValueName12,strValue12 WScript.Quit End If End IF ' Query AD for iPPhone Function GetAdsPath(sUserName) ' Relace DC=dsrsd,DC=com with your AD domain settings LDAP_Name="LDAP://DC=dsrsd,DC=com" Set objConnection = CreateObject("ADODB.Connection") objConnection.Open "Provider=ADsDSOObject;" Set objCommand = CreateObject("ADODB.Command") objCommand.ActiveConnection = objConnection objCommand.CommandText = "SELECT adspath FROM '" & LDAP_Name & "' WHERE objectCategory='user' AND sAMAccountName='" & sUserName & "'" Set objRecordSet = objCommand.Execute IF objRecordSet.EOF Then GetAdsPath1="Empty" Else IF (objRecordset.Fields("adspath") <> "") then GetAdsPath1 = objRecordset.Fields("adspath") Else End If End If GetAdsPath=GetAdsPath1 objConnection.Close End Function