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=“
  2. install it in the windows devices
  3. Get client id(jey) from “C:\Program Files (x86)\COMODO\Shield Agent\” or “C:\Program Files (x86)\COMODO\Shield Agent\”

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 –

Alternate DNS server –

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…me-Shield.html


import os
import time
import ctypes

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:

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:
            if chunk:
    if os.path.exists(filepath):
        return filepath
    return False

print "Cdome shield Roaming agent has been downloaded from ",url

with disable_file_system_redirection():

print "Cdome shield Roaming agent has been installed"    

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

    shieldpath= "C:\Program Files\COMODO\Shield Agent\"

with open(shieldpath, 'rb+') as fjob:

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


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
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\’

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.