mirror of
https://github.com/MicrosoftDocs/windows-itpro-docs.git
synced 2025-06-22 13:53:39 +00:00
Merge branch 'master' into lsaldanha-4620497-batch14
This commit is contained in:
@ -21,13 +21,17 @@ ms.topic: article
|
||||
|
||||
[!INCLUDE [Microsoft 365 Defender rebranding](../../includes/microsoft-defender.md)]
|
||||
|
||||
|
||||
**Applies to:**
|
||||
- [Microsoft Defender for Endpoint](https://go.microsoft.com/fwlink/p/?linkid=2146631)
|
||||
- [Microsoft 365 Defender](https://go.microsoft.com/fwlink/?linkid=2118804)
|
||||
|
||||
> Want to experience Microsoft Defender for Endpoint? [Sign up for a free trial.](https://www.microsoft.com/microsoft-365/windows/microsoft-defender-atp?ocid=docs-wdatp-exposedapis-abovefoldlink)
|
||||
|
||||
[!include[Microsoft Defender for Endpoint API URIs for US Government](../../includes/microsoft-defender-api-usgov.md)]
|
||||
|
||||
[!include[Improve request performance](../../includes/improve-request-performance.md)]
|
||||
|
||||
|
||||
Run advanced queries using Python, see [Advanced Hunting API](run-advanced-query-api.md).
|
||||
|
||||
In this section, we share Python samples to retrieve a token and use it to run a query.
|
||||
@ -48,9 +52,9 @@ tenantId = '00000000-0000-0000-0000-000000000000' # Paste your own tenant ID her
|
||||
appId = '11111111-1111-1111-1111-111111111111' # Paste your own app ID here
|
||||
appSecret = '22222222-2222-2222-2222-222222222222' # Paste your own app secret here
|
||||
|
||||
url = "https://login.windows.net/%s/oauth2/token" % (tenantId)
|
||||
url = "https://login.microsoftonline.com/%s/oauth2/token" % (tenantId)
|
||||
|
||||
resourceAppIdUri = 'https://api.securitycenter.windows.com'
|
||||
resourceAppIdUri = 'https://api.securitycenter.microsoft.com'
|
||||
|
||||
body = {
|
||||
'resource' : resourceAppIdUri,
|
||||
@ -80,7 +84,7 @@ where
|
||||
```
|
||||
query = 'RegistryEvents | limit 10' # Paste your own query here
|
||||
|
||||
url = "https://api.securitycenter.windows.com/api/advancedqueries/run"
|
||||
url = "https://api.securitycenter.microsoft.com/api/advancedqueries/run"
|
||||
headers = {
|
||||
'Content-Type' : 'application/json',
|
||||
'Accept' : 'application/json',
|
||||
|
Reference in New Issue
Block a user