Skip to content

Commit 83f4aa5

Browse files
committed
Updates for new release
1 parent 6806a2b commit 83f4aa5

13 files changed

+64
-59
lines changed

intune/agent_based/ms_intune_app_licenses.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8; py-indent-offset: 4; max-line-length: 100 -*-
33

4-
# Copyright (C) 2025 Christopher Pommer <cp.software@outlook.de>
4+
# Copyright (C) 2024, 2025 Christopher Pommer <cp.software@outlook.de>
55

66
# This program is free software; you can redistribute it and/or
77
# modify it under the terms of the GNU General Public License
@@ -94,7 +94,7 @@ def check_ms_intune_app_licenses(
9494
item: str, params: Mapping[str, Any], section: Section
9595
) -> CheckResult:
9696
license = section.get(item)
97-
if not license:
97+
if license is None:
9898
return
9999

100100
app_license_consumed_pct = round(
@@ -146,11 +146,15 @@ def check_ms_intune_app_licenses(
146146
f"{result_level}"
147147
)
148148

149-
result_details = (
150-
f"App: {license.app_name} ({license.app_publisher})\n - Type: {license.app_type}\n - "
151-
f"Assigned: {license.app_assigned}"
152-
f"\n - Total: {license.app_license_total}\n - Used: {license.app_license_consumed}"
153-
)
149+
app_details_list = [
150+
f"Name: {license.app_name}",
151+
f"Publisher: {license.app_publisher}",
152+
f"Type: {license.app_type}",
153+
f"Total: {license.app_license_total}",
154+
f"Used: {license.app_license_consumed}",
155+
f"Is assigned: {'yes' if license.app_assigned else 'no'}",
156+
]
157+
result_details = "\n".join(app_details_list)
154158

155159
yield Result(
156160
state=result_state,

intune/agent_based/ms_intune_apple_ade_tokens.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8; py-indent-offset: 4; max-line-length: 100 -*-
33

4-
# Copyright (C) 2025 Christopher Pommer <cp.software@outlook.de>
4+
# Copyright (C) 2024, 2025 Christopher Pommer <cp.software@outlook.de>
55

66
# This program is free software; you can redistribute it and/or
77
# modify it under the terms of the GNU General Public License
@@ -94,25 +94,24 @@ def check_ms_intune_apple_ade_tokens(
9494
item: str, params: Mapping[str, Any], section: Section
9595
) -> CheckResult:
9696
token = section.get(item)
97-
if not token:
97+
if token is None:
9898
return
9999

100100
params_levels_token_expiration = params.get("token_expiration")
101101

102-
token_expiration_datetime = datetime.fromisoformat(token.token_expiration)
103-
token_expiration_timestamp = token_expiration_datetime.timestamp()
104-
token_expiration_timestamp_render = render.datetime(int(token_expiration_timestamp))
102+
token_expiration_timestamp = datetime.fromisoformat(token.token_expiration).timestamp()
103+
token_expiration_timestamp_render = render.datetime(token_expiration_timestamp)
105104

106105
token_expiration_timespan = token_expiration_timestamp - datetime.now().timestamp()
107106

108-
result_details = (
109-
f"Expiration time: {token_expiration_timestamp_render}"
110-
f"\nToken name: {token.token_name}"
111-
f"\nToken ID: {token.token_id}"
112-
f"\nToken type: {token.token_type}"
113-
f"\nApple ID: {token.token_appleid}"
114-
)
115-
result_summary = f"Expiration time: {token_expiration_timestamp_render}"
107+
token_details_list = [
108+
f"Expiration time: {token_expiration_timestamp_render}",
109+
f"Token name: {token.token_name}",
110+
f"Token ID: {token.token_id}",
111+
f"Token type: {token.token_type}",
112+
f"Apple ID: {token.token_appleid}",
113+
]
114+
result_details = "\n".join(token_details_list)
116115

117116
if token_expiration_timespan > 0:
118117
yield from check_levels(
@@ -131,7 +130,7 @@ def check_ms_intune_apple_ade_tokens(
131130

132131
yield Result(
133132
state=State.OK,
134-
summary=result_summary,
133+
summary=f"Expiration time: {token_expiration_timestamp_render}",
135134
details=result_details,
136135
)
137136

intune/agent_based/ms_intune_apple_mdm_push_cert.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8; py-indent-offset: 4; max-line-length: 100 -*-
33

4-
# Copyright (C) 2025 Christopher Pommer <cp.software@outlook.de>
4+
# Copyright (C) 2024, 2025 Christopher Pommer <cp.software@outlook.de>
55

66
# This program is free software; you can redistribute it and/or
77
# modify it under the terms of the GNU General Public License
@@ -72,9 +72,8 @@ def check_ms_intune_apple_mdm_push_cert(params: Mapping[str, Any], section: Sect
7272
cert = section
7373
params_levels_cert_expiration = params.get("cert_expiration")
7474

75-
cert_expiration_datetime = datetime.fromisoformat(cert.cert_expiration)
76-
cert_expiration_timestamp = cert_expiration_datetime.timestamp()
77-
cert_expiration_timestamp_render = render.datetime(int(cert_expiration_timestamp))
75+
cert_expiration_timestamp = datetime.fromisoformat(cert.cert_expiration).timestamp()
76+
cert_expiration_timestamp_render = render.datetime(cert_expiration_timestamp)
7877

7978
cert_expiration_timespan = cert_expiration_timestamp - datetime.now().timestamp()
8079

intune/agent_based/ms_intune_apple_vpp_tokens.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8; py-indent-offset: 4; max-line-length: 100 -*-
33

4-
# Copyright (C) 2025 Christopher Pommer <cp.software@outlook.de>
4+
# Copyright (C) 2024, 2025 Christopher Pommer <cp.software@outlook.de>
55

66
# This program is free software; you can redistribute it and/or
77
# modify it under the terms of the GNU General Public License
@@ -95,24 +95,25 @@ def check_ms_intune_apple_vpp_tokens(
9595
item: str, params: Mapping[str, Any], section: Section
9696
) -> CheckResult:
9797
token = section.get(item)
98-
if not token:
98+
if token is None:
9999
return
100100

101101
params_levels_token_expiration = params.get("token_expiration")
102102

103-
token_expiration_datetime = datetime.fromisoformat(token.token_expiration)
104-
token_expiration_timestamp = token_expiration_datetime.timestamp()
105-
token_expiration_timestamp_render = render.datetime(int(token_expiration_timestamp))
103+
token_expiration_timestamp = datetime.fromisoformat(token.token_expiration).timestamp()
104+
token_expiration_timestamp_render = render.datetime(token_expiration_timestamp)
106105

107106
token_expiration_timespan = token_expiration_timestamp - datetime.now().timestamp()
108107

109-
result_details = (
110-
f"Expiration time: {token_expiration_timestamp_render}"
111-
f"\nToken name: {token.token_name}"
112-
f"\nToken ID: {token.token_id}"
113-
f"\nApple ID: {token.token_appleid}"
114-
f"\nState: {token.token_state}"
115-
)
108+
token_details_list = [
109+
f"Expiration time: {token_expiration_timestamp_render}",
110+
f"Token name: {token.token_name}",
111+
f"Token ID: {token.token_id}",
112+
f"Apple ID: {token.token_appleid}",
113+
f"State: {token.token_state}",
114+
]
115+
result_details = "\n".join(token_details_list)
116+
116117
result_summary = (
117118
f"Expiration time: {token_expiration_timestamp_render}, State: {token.token_state}"
118119
)

intune/agent_based/ms_intune_cert_connectors.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8; py-indent-offset: 4; max-line-length: 100 -*-
33

4-
# Copyright (C) 2025 Christopher Pommer <cp.software@outlook.de>
4+
# Copyright (C) 2024, 2025 Christopher Pommer <cp.software@outlook.de>
55

66
# This program is free software; you can redistribute it and/or
77
# modify it under the terms of the GNU General Public License
@@ -90,24 +90,26 @@ def discover_ms_intune_cert_connectors(section: Section) -> DiscoveryResult:
9090

9191
def check_ms_intune_cert_connectors(item: str, section: Section) -> CheckResult:
9292
connector = section.get(item)
93-
if not connector:
93+
if connector is None:
9494
return
9595

96-
connector_connection_last_datetime = datetime.fromisoformat(connector.connector_connection_last)
97-
connector_connection_last_timestamp = connector_connection_last_datetime.timestamp()
96+
connector_connection_last_timestamp = datetime.fromisoformat(
97+
connector.connector_connection_last
98+
).timestamp()
9899
connector_connection_last_timestamp_render = render.datetime(
99-
int(connector_connection_last_timestamp)
100+
connector_connection_last_timestamp
100101
)
101102

102-
result_summary = f"State: {connector.connector_state}"
103+
result_summary = f"State: {connector.connector_state}, Version: {connector.connector_version}"
103104

104-
result_details = (
105-
f"Connector name: {connector.connector_name}"
106-
f"\nConnector ID: {connector.connector_id}"
107-
f"\nConnector version: {connector.connector_version}"
108-
f"\nLast connected: {connector_connection_last_timestamp_render}"
109-
f"\nState: {connector.connector_state}"
110-
)
105+
connector_details_list = [
106+
f"Connector name: {connector.connector_name}",
107+
f"Connector ID: {connector.connector_id}",
108+
f"Connector version: {connector.connector_version}",
109+
f"Last connected: {connector_connection_last_timestamp_render}",
110+
f"State: {connector.connector_state}",
111+
]
112+
result_details = "\n".join(connector_details_list)
111113

112114
if connector.connector_state != "active":
113115
yield Result(

intune/graphing/ms_intune_app_licenses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8; py-indent-offset: 4; max-line-length: 100 -*-
33

4-
# Copyright (C) 2025 Christopher Pommer <cp.software@outlook.de>
4+
# Copyright (C) 2024, 2025 Christopher Pommer <cp.software@outlook.de>
55

66
# This program is free software; you can redistribute it and/or
77
# modify it under the terms of the GNU General Public License

intune/libexec/agent_ms_intune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8; py-indent-offset: 4; max-line-length: 100 -*-
33

4-
# Copyright (C) 2025 Christopher Pommer <cp.software@outlook.de>
4+
# Copyright (C) 2024, 2025 Christopher Pommer <cp.software@outlook.de>
55

66
# This program is free software; you can redistribute it and/or
77
# modify it under the terms of the GNU General Public License

intune/rulesets/ms_intune.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8; py-indent-offset: 4; max-line-length: 100 -*-
33

4-
# Copyright (C) 2025 Christopher Pommer <cp.software@outlook.de>
4+
# Copyright (C) 2024, 2025 Christopher Pommer <cp.software@outlook.de>
55

66
# This program is free software; you can redistribute it and/or
77
# modify it under the terms of the GNU General Public License

intune/rulesets/ms_intune_app_licenses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8; py-indent-offset: 4; max-line-length: 100 -*-
33

4-
# Copyright (C) 2025 Christopher Pommer <cp.software@outlook.de>
4+
# Copyright (C) 2024, 2025 Christopher Pommer <cp.software@outlook.de>
55

66
# This program is free software; you can redistribute it and/or
77
# modify it under the terms of the GNU General Public License

intune/rulesets/ms_intune_apple_ade_tokens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8; py-indent-offset: 4; max-line-length: 100 -*-
33

4-
# Copyright (C) 2025 Christopher Pommer <cp.software@outlook.de>
4+
# Copyright (C) 2024, 2025 Christopher Pommer <cp.software@outlook.de>
55

66
# This program is free software; you can redistribute it and/or
77
# modify it under the terms of the GNU General Public License

0 commit comments

Comments
 (0)