Procedure to enrol Cdome Shield Roaming Agent

Please refer below script to enrol Cdome shield roaming agent using ITSM script procedure,

Script will do following functions one by one in order viz

  1. Download cDomeAgent (Roaming agent) from url=“https://shield.dome.comodo.com/api/agent/download
  2. install it in the windows devices
  3. Get client id(jey) from “C:\Program Files (x86)\COMODO\Shield Agent\client.id” or “C:\Program Files (x86)\COMODO\Shield Agent\client.id”

There are two cases which affect script efficiency,

  1. PC that is subject to provisioning have network that is already added to shield

In this case, all you have to do is to run the script and you’re done

After the network enrollment process, please also make sure all endpoints in protected networks are configured to use Shield DNS:

Preferred DNS server – 8.26.56.10

Alternate DNS server – 8.20.247.10

2.PC that is subject to provisioning have network that is not added to shield

After running the script on the device, you have to put in a client ID (key) that you obtained from script execution log, into shield portal manually, then you’re done.

After enrollment default profile will be auto applied. Please ensure desired profile set as default. Applied policies will override site-wide network rule.
It is preferable to add the network before running the script in devices.

Please refer below help guide section for more information
https://help.comodo.com/topic-434-1-…me-Shield.html


url="https://shield.dome.comodo.com/api/agent/download"



import os
import time
import ctypes

path=os.environ['TEMP']
filepath=path+r'\cShieldAgent.msi'
command= 'msiexec.exe /i  cShieldAgent.msi /qn'


class disable_file_system_redirection:
    _disable = ctypes.windll.kernel32.Wow64DisableWow64FsRedirection
    _revert = ctypes.windll.kernel32.Wow64RevertWow64FsRedirection
    def __enter__(self):
        self.old_value = ctypes.c_long()
        self.success = self._disable(ctypes.byref(self.old_value))
    def __exit__(self, type, value, traceback):
        if self.success:
            self._revert(self.old_value)

def Download(filepath,url):
    import urllib2
    import os        
    req = urllib2.Request(url, headers={'User-Agent' : "Magic Browser"})
    con = urllib2.urlopen(req)
    with open(filepath, 'wb') as f:
        while True:
            chunk=con.read(100*1000*1000)
            if chunk:
                f.write(chunk)
            else:
                break
    if os.path.exists(filepath):
        return filepath
    return False


Download(filepath,url)
print "Cdome shield Roaming agent has been downloaded from ",url


with disable_file_system_redirection():
        os.chdir(path)
        os.popen(command)
        time.sleep(5)      

print "Cdome shield Roaming agent has been installed"    

if 'PROGRAMW6432' in os.environ.keys():
    shieldpath="C:\Program Files (x86)\COMODO\Shield Agent\client.id"

else:
    shieldpath= "C:\Program Files\COMODO\Shield Agent\client.id"


with open(shieldpath, 'rb+') as fjob:
    clientid=fjob.read()

print "collecting client id from path",shieldpath
print "please refer Cdome shield client ID of the device as below"
print clientid


try:
    os.remove(filepath)    
except: 
    pass










Sample output

20170417-Automate-cdome–shield-roaming-agent-installation.json (2.77 KB)

I have attempted this procedure using a customised link and get the following returned.

Cdome shield Roaming agent has been downloaded from https://shield.dome.comodo.com/api/agent/download
Cdome shield Roaming agent has been installed
Traceback (most recent call last):
File “<string>”, line 59, in <module>
IOError: [Errno 2] No such file or directory: ‘C:\Program Files\COMODO\Shield Agent\client.id’

The agent installs, but the Client.ID file is not created. The client ID is in the ‘tray icon’ under about, however, Agent state remains unknown and doesn’t enforce content filtering controls that have been put in place.

Hello @curatrix_pl

We will analyze and let you clear out with this. Kindly please give us time.

Thank you.