You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Quickstart: Automate onboarding of Microsoft Defender for Cloud using PowerShell
9
+
# Automate onboarding of Microsoft Defender for Cloud using PowerShell
10
10
11
11
You can secure your Azure workloads programmatically, using the Microsoft Defender for Cloud PowerShell module. Using PowerShell enables you to automate tasks and avoid the human error inherent in manual tasks. This is especially useful in large-scale deployments that involve dozens of subscriptions with hundreds and thousands of resources, all of which must be secured from the beginning.
12
12
13
13
Onboarding Microsoft Defender for Cloud using PowerShell enables you to programmatically automate onboarding and management of your Azure resources and add the necessary security controls.
14
14
15
-
This article provides a sample PowerShell script that can be modified and used in your environment to roll out Defender for Cloud across your subscriptions.
15
+
This article provides a sample PowerShell script that can be modified and used in your environment to roll out Defender for Cloud across your subscriptions.
16
16
17
17
In this example, we'll enable Defender for Cloud on a subscription with ID: d07c0080-170c-4c24-861d-9c817742786c and apply the recommended settings that provide a high level of protection, by enabling Microsoft Defender for Cloud's enhanced security features, which provides advanced threat protection and detection capabilities:
18
18
19
19
1. Enable [the enhanced security in Microsoft Defender for Cloud](enable-enhanced-security.md).
20
-
21
-
2. Set the Log Analytics workspace to which the Log Analytics agent will send the data it collects on the VMs associated with the subscription – in this example, an existing user defined workspace (myWorkspace).
22
20
23
-
3. Activate Defender for Cloud’s automatic agent provisioning, which [deploys the Log Analytics agent](working-with-log-analytics-agent.md).
21
+
1. Set the Log Analytics workspace to which the Log Analytics agent will send the data it collects on the VMs associated with the subscription – in this example, an existing user defined workspace (myWorkspace).
24
22
25
-
5. Set the organization’s [CISO as the security contact for Defender for Cloud alerts and notable events](configure-email-notifications.md).
23
+
1. Activate Defender for Cloud’s automatic agent provisioning, which [deploys the Log Analytics agent](working-with-log-analytics-agent.md).
26
24
27
-
6. Assign Defender for Cloud’s [default security policies](tutorial-security-policy.md).
25
+
1. Set the organization’s [CISO as the security contact for Defender for Cloud alerts and notable events](configure-email-notifications.md).
26
+
27
+
1. Assign Defender for Cloud’s [default security policies](tutorial-security-policy.md).
28
28
29
29
## Prerequisites
30
30
@@ -33,7 +33,7 @@ These steps should be performed before you run the Defender for Cloud cmdlets:
33
33
1. Run PowerShell as admin.
34
34
35
35
1. Run the following commands in PowerShell:
36
-
36
+
37
37
```powershell
38
38
Set-ExecutionPolicy -ExecutionPolicy AllSigned
39
39
```
@@ -71,11 +71,11 @@ These steps should be performed before you run the Defender for Cloud cmdlets:
71
71
```
72
72
73
73
1. Auto-provision installation of the Log Analytics agent on your Azure VMs:
You've successfully onboarded Microsoft Defender for Cloud with PowerShell.
106
106
107
107
You can now use these PowerShell cmdlets with automation scripts to programmatically iterate across subscriptions and resources. This saves time and reduces the likelihood of human error. You can use this [sample script](https://github.com/Microsoft/Azure-Security-Center/blob/master/quickstarts/ASC-Samples.ps1) as reference.
108
108
109
-
110
-
111
-
112
109
## See also
110
+
113
111
To learn more about how you can use PowerShell to automate onboarding to Defender for Cloud, see the following article:
0 commit comments