Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get scheduled task display name with filename #401

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(self, task_element: Element, task_path: TargetPath):
self.user_id = self.get_element("Principals/Principal/UserId")
self.logon_type = self.get_element("Principals/Principal/LogonType")
self.group_id = self.get_element("Principals/Principal/GroupId")
self.display_name = self.get_element("Principals/Principal/DisplayName")
self.display_name = self.get_element("Principals/Principal/DisplayName") or task_path.name
self.run_level = self.get_element("Principals/Principal/RunLevel")
self.process_token_sid_type = self.get_element("Principals/Principal/ProcessTokenSidType")
self.required_privileges = self.get_element("Principals/Principal/RequiredPrivileges")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_plugins_os_windows_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def assert_xml_task_properties(xml_task):
assert xml_task.user_id is None
assert xml_task.logon_type is None
assert xml_task.group_id == "S-1-5-4"
assert xml_task.display_name is None
assert xml_task.display_name == "test_xml.xml"
assert xml_task.run_level is None
assert xml_task.process_token_sid_type is None
assert xml_task.required_privileges is None
Expand Down