def register(self, name, taskdef, flags=gdef.TASK_CREATE, userid=None, password=None, logonType=gdef.TASK_LOGON_NONE, ssid=None): """Register the task definition ``taskdef`` as a new task with ``name`` :rtype: :class:`Task` """ new_task = Task() if userid is None: userid = gdef.VARIANT() # Empty variant if password is None: password = gdef.VARIANT() # Empty variant if ssid is None: ssid = gdef.VARIANT() # Empty variant self.RegisterTaskDefinition(name, taskdef, flags, userid, password, logonType, ssid, new_task) return new_task
def run(self, params=None, flags=gdef.TASK_RUN_NO_FLAGS, sessionid=0, user=None): if params is None: params = gdef.VARIANT() # Empty variant result = gdef.IRunningTask() self.RunEx(params, flags, sessionid, user, result) return result
def create_folder(self, name): """Create a new sub-:class:`TaskFolder` with ``name``""" folder = TaskFolder() self.CreateFolder(name, gdef.VARIANT(), folder) return folder
def connect(self, server=None, user=None, domain=None, password=None): if server is None: server = gdef.VARIANT() # Empty variant if user is None: user = gdef.VARIANT() # Empty variant if domain is None: domain = gdef.VARIANT() # Empty variant if password is None: password = gdef.VARIANT() # Empty variant self.Connect(server, user, domain, password)