From 5be088cf70f71f8f78ce0662dcbf30efe6c0fa6f Mon Sep 17 00:00:00 2001 From: David Laufer Date: Thu, 2 Aug 2018 11:18:56 +0300 Subject: [PATCH] Fixes --- ...-defender-advanced-threat-protection-sample-python.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/windows/security/threat-protection/windows-defender-atp/run-advanced-query-windows-defender-advanced-threat-protection-sample-python.md b/windows/security/threat-protection/windows-defender-atp/run-advanced-query-windows-defender-advanced-threat-protection-sample-python.md index b26196cbb3..01ac9c558a 100644 --- a/windows/security/threat-protection/windows-defender-atp/run-advanced-query-windows-defender-advanced-threat-protection-sample-python.md +++ b/windows/security/threat-protection/windows-defender-atp/run-advanced-query-windows-defender-advanced-threat-protection-sample-python.md @@ -56,9 +56,9 @@ aadToken = jsonResponse["access_token"] ``` where -- $tenantId: ID of the tenant on behalf of which you want to run the query (i.e., the query will be run on the data of this tenant) -- $appId: ID of your AAD app (the app must have 'Run advanced queries' permission to WDATP) -- $appSecret: Secret of your AAD app +- tenantId: ID of the tenant on behalf of which you want to run the query (i.e., the query will be run on the data of this tenant) +- appId: ID of your AAD app (the app must have 'Run advanced queries' permission to WDATP) +- appSecret: Secret of your AAD app ## Run query @@ -107,6 +107,8 @@ To iterate over the results do the below: for result in results: print(result) # Prints the whole result print(result["EventTime"]) # Prints only the property 'EventTime' from the result + + ``` @@ -120,6 +122,7 @@ output = csv.writer(outputFile) output.writerow(results[0].keys()) for result in results: output.writerow(result.values()) + outputFile.close() ```