' ' $Id: //websites/unixwiz/unixwiz.net/webroot/evo/evo-setup-services.vbs#1 $ ' ' written by : Stephen J. Friedl ' Software Consultant ' Tustin, California USA ' http://www.unixwiz.net/evo/evo-logon-service.html ' ' This VBScript program uses WMI to program the service logon ' account information for the Evolution Registration Daemon: this ' is required after a version upgrade, and it requires that it ' be configured with the account name and password of interest. ' ' *This is a security risk* - use with caution. ' Dim networkServiceUser, networkServicePass Dim localServiceUser, localServicePass Dim user, pass, ok networkServiceUser = "NT AUTHORITY\NetworkService" networkServicePass = "-unused-" localServiceUser = "NT AUTHORITY\LocalService" localServicePass = "-unused-" Set objWMIService = GetObject( _ "winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set colServiceList = objWMIService.ExecQuery( _ "Select * from Win32_Service " & _ "where DisplayName LIKE 'Evolution%'") newline = chr(13) & chr(10) msg = "" For Each objservice in colServiceList ok = 1 select case objservice.DisplayName case "Evolution Request Broker" user = networkServiceUser pass = networkServicePass case "Evolution Request Processor" user = localServiceUser pass = localServicePass case "Evolution Remote Relay" user = localServiceUser pass = localServicePass case "Evolution API Adapter" user = localServiceUser pass = localServicePass case else ok = 0 ' don't change the others End select If ok = 1 then r = objService.Change( , , , , , , user, pass) if r = 0 then msg = msg & "Updated logon for " & objService.DisplayName & " with " & user else msg = msg & "ERROR: could not update logon for " & objService.DisplayName End If msg = msg & newline End If Next WScript.Echo msg