What you can configure and where
A tenant with only Defender for Business has two things to secure: identities, using the free tier of Entra ID, and devices, using Defender’s own policies. Four admin portals cover it. Everything Intune, Conditional Access or Microsoft 365 Apps would normally do is out of reach and is listed at the end.
| Portal | Address | What you set here on this license |
|---|---|---|
| Microsoft Entra admin center | entra.microsoft.com | MFA for everyone (security defaults), sign-in methods, what users and apps are allowed to do, who can join devices, LAPS, admin roles |
| Microsoft 365 admin center | admin.microsoft.com | Users and licenses, role assignment, password expiration, idle session timeout, security contacts |
| Microsoft Defender portal | security.microsoft.com | Device onboarding, antivirus and firewall policies, web content filtering, allow/block indicators, tamper protection, alerts, vulnerability management |
| Microsoft Intune admin center | intune.microsoft.com | Endpoint security node only: attack surface reduction rules and controlled folder access. Defender delivers these to onboarded devices; the rest of Intune needs an Intune license. |
Work through the parts in order. Parts 1 to 5 are the GUI. Parts 6 and 7 repeat the same settings in PowerShell and add the device settings no portal can push on this license.
Portal menus move often. If a label here doesn’t match, use the search box at the top of the portal with the setting’s name.
Before you start
You need a Global Administrator account for the first pass, a test user, and one test PC. After setup, do day-to-day work with smaller roles.
Roles to use
| Role | Use it for |
|---|---|
| Global Administrator | First-time setup and tenant-wide switches only. Keep to two to four accounts. |
| Security Administrator | Day-to-day Defender work: policies, alerts, response actions |
| Security Reader | View-only access to devices, policies, alerts and reports |
Confirm what the tenant is licensed for
- Go to
admin.microsoft.com→ Billing → Your products. You should see Microsoft Defender for Business and nothing that includes Intune or Entra ID P1. - Go to Users → Active users, open each person, and check that Licenses and apps has Defender for Business ticked. Devices are only covered for licensed users.
- Go to
entra.microsoft.com→ Overview. The License line should read Microsoft Entra ID Free.
Set up the admin accounts first
- Use a named admin account with no mailbox for admin work, separate from your daily account.
- Create two emergency (“break-glass”) Global Administrator accounts on the tenant’s
.onmicrosoft.comdomain, each with a FIDO2 security key stored offline. - Write down today’s settings before you change them. A screenshot of each page is enough.
Part 1: Entra admin center (identity)
This part protects sign-ins and limits what an ordinary or compromised account can do. Everything here is included in Entra ID Free. Sign in at entra.microsoft.com.
The left menu’s top node is Entra ID in current tenants. Older screenshots and some tenants show it as Identity.
Step 1.1: Turn on security defaults (MFA for everyone)
Security defaults are the only way to enforce MFA without Conditional Access. They are all-or-nothing: you can’t exclude a user or an app.
- Go to Entra ID → Overview → Properties.
- At the bottom, select Manage security defaults.
- Set Security defaults to Enabled and select Save.
What this enforces:
- Every user must register for MFA with an authenticator app.
- Administrators are asked for MFA at every sign-in. Other users are asked when Microsoft judges the sign-in risky or new.
- Older sign-in protocols that can’t do MFA are blocked.
- Anyone opening the Azure portal, Entra admin center, Azure PowerShell or Azure CLI must complete MFA.
Before you enable it, make sure nothing still signs in with a password only, such as a scanner or script using a user account. Tenants created since late 2019 usually have this on already.
Step 1.2: Enable passkeys and security keys
Passkeys can’t be phished, and they are what your admin and break-glass accounts should use.
- Go to Entra ID → Authentication methods → Policies.
- Select Passkey (FIDO2).
- Set Enable to on. Under Include, choose All users, or a group that holds your admins.
- Select Save.
- Each admin then registers a key at
mysignins.microsoft.com/security-info→ Add sign-in method → Passkey or Security key.
On the same Policies page, once everyone uses the Authenticator app, open SMS and Voice call and turn them off. Those are the methods attackers intercept most easily.
Step 1.3: Restrict what ordinary users can do
By default any user can register apps, create a new tenant and browse the directory. Tighten that.
Go to Entra ID → Users → User settings and set:
| Setting | Set to | Why |
|---|---|---|
| Users can register applications | No | Stops users creating app registrations that can hold credentials |
| Restrict non-admin users from creating tenants | Yes | Stops shadow tenants created with work accounts |
| Users can create security groups | No | Keeps group-based access under admin control |
| Guest user access restrictions | Guest user access is restricted to properties and memberships of their own directory objects (most restrictive) | Guests can’t list your users and groups |
| Restrict access to Microsoft Entra admin center | Yes | Hides the admin pages from non-admins. Microsoft notes this is friction, not a security boundary. |
| Allow users to connect their work or school account with LinkedIn | No | Avoids sharing directory data with LinkedIn |
Select Save.
Step 1.4: Stop users granting apps access to company data
A common attack is a fake app that asks a user to “allow access”. Remove that choice from users and route requests to an admin.
- Go to Entra ID → Enterprise apps → Consent and permissions → User consent settings.
- Under User consent for applications, choose Do not allow user consent. The middle option, Allow user consent for apps from verified publishers, for selected permissions, is Microsoft’s recommended minimum if blocking everything is too strict.
- Select Save.
- Go to Consent and permissions → Admin consent settings.
- Set Users can request admin consent to apps they are unable to consent to to Yes, choose who reviews requests, and select Save. It can take up to an hour to start working.
This only affects future requests. Review what’s already been granted under Enterprise apps → All applications, opening each app’s Permissions page.
Step 1.5: Limit guest invitations
- Go to Entra ID → External Identities → External collaboration settings.
- Under Guest invite settings, choose Only users assigned to specific admin roles can invite guest users.
- Select Save.
Step 1.6: Control who can join devices, and turn on LAPS
Go to Entra ID → Devices → Device settings and set:
| Setting | Set to | Why |
|---|---|---|
| Users may join devices to Microsoft Entra | Selected, with a group of IT staff | By default any user can join a device. A stolen password could enroll an attacker’s PC. |
| Require Multifactor Authentication to register or join devices with Microsoft Entra | Yes | Off by default. Without Conditional Access this toggle is the only way to require it. |
| Maximum number of devices per user | A sensible cap, such as 5 or 10 | Limits abuse of one account |
| Global administrator role is added as local administrator on the device during Microsoft Entra join | No | Keeps Global Admin credentials off workstations. Use LAPS for local admin access. |
| Registering user is added as local administrator on the device during Microsoft Entra join | None | Users no longer become local admins on PCs they join |
| Enable Microsoft Entra Local Administrator Password Solution (LAPS) | Yes | Lets devices store rotating local admin passwords in Entra. Devices also need the client settings in Part 7. |
| Restrict users from recovering the BitLocker key(s) for their owned devices | Yes | Recovery keys are handed out by IT only |
Select Save. The two local-administrator settings only affect devices joined afterwards.
Step 1.7: Review admin roles
- Go to Entra ID → Roles & admins.
- Open Global Administrator and confirm the list is short: your named admin account and the two break-glass accounts.
- For people who only work in the Defender portal, open Security Administrator or Security Reader and select Add assignments.
Already on, nothing to configure
- Smart lockout locks out repeated bad-password attempts. Changing its thresholds needs Entra ID P1.
- Global banned password list blocks common weak passwords. A custom list needs P1.
- Sign-in logs are under Entra ID → Monitoring & health → Sign-in logs. The free tier keeps about 7 days, so look weekly.
Part 2: Microsoft 365 admin center (organization settings)
This portal handles users, licenses and a few tenant-wide switches. Sign in at admin.microsoft.com. If the left menu is short, select Show all.
Step 2.1: Assign security roles
- Go to Users → Active users and select the person.
- On the Account tab, under Roles, select Manage roles.
- Choose Admin center access, scroll down and expand Show all by category.
- Tick Security Administrator (listed under Security & Compliance) or Security Reader (listed under Read-only).
- Select Save changes.
Step 2.2: Keep licenses and accounts tidy
- Users → Active users: confirm every person with a work PC has the Defender for Business license.
- For anyone who has left, open the user and select Block sign-in, then remove the license.
- Users → Deleted users: check nothing unexpected is waiting to be restored.
Step 2.3: Set the password expiration policy
Microsoft recommends passwords that don’t expire when MFA is on. Forced changes push people towards weaker passwords.
- Go to Settings → Org settings → Security & privacy.
- Select Password expiration policy.
- Tick Set passwords to never expire (recommended) and select Save.
Step 2.4: Turn on idle session timeout
This signs people out of the Microsoft web portals after a period of inactivity. That includes the admin centers you use in this guide.
- Go to Settings → Org settings → Security & privacy.
- Select Idle session timeout.
- Tick the box to turn it on, choose a period (1 or 3 hours is common), and select Save.
A Global Administrator has to turn it on the first time. It covers web apps only, not desktop or mobile apps. Limiting it to unmanaged devices needs Conditional Access, so on this license it applies to every device.
Step 2.5: Stop users signing up for apps and trials
- Go to Settings → Org settings → Services.
- Select User owned apps and services. Clear both boxes (access to the Office Store, and starting trials on behalf of the organization). Select Save.
- Select Self-service trials and purchases. For each product listed, choose Do not allow.
- Select User consent to apps and confirm it is off. It mirrors Step 1.4.
Step 2.6: Set the security contacts
- Go to Settings → Org settings → Organization profile → Organization information.
- Set Technical contact to a shared, monitored address such as
admin@yourdomain, not one person’s mailbox. - In
entra.microsoft.com→ Entra ID → Overview → Properties, set Technical contact and Global privacy contact to the same address. The privacy contact is who Microsoft notifies about a breach.
Step 2.7: Watch for Microsoft’s notices
- Health → Message center → Preferences: turn on email for the shared address, so upcoming security changes reach you.
- Health → Service health: check here first when something stops working.
Part 3: Defender portal (onboarding and core settings)
No policy reaches a PC until that PC is onboarded. Do this part first, on one test PC, before touching policies. Sign in at security.microsoft.com.
The first time you open the portal, a setup wizard may offer to assign roles, set up email alerts and onboard devices. You can use it or skip it; the steps below cover the same ground.
Step 3.1: Onboard Windows devices
Devices must run Windows 10 or 11 Pro, Business or Enterprise. Home edition isn’t supported.
- Go to Settings → Endpoints. Under Device management, select Onboarding.
- For the operating system, select Windows 10 and 11.
- Under Connectivity type, select Streamlined.
- Under Deployment method, select Local script, then Download onboarding package.
- Copy the zip to the PC and extract it. You get
WindowsDefenderATPLocalOnboardingScript.cmd. - On the PC, open Command Prompt as administrator, run the script, and answer the prompt.
- Back on the Onboarding page, copy the command under Run a detection test and run it on the PC in an administrator Command Prompt. An alert should appear in the portal within about 10 minutes.
- Go to Assets → Devices and confirm the PC is listed.
Microsoft suggests the local script for up to about 10 devices at a time. For more, choose Group Policy as the deployment method in step 4 instead. That package’s script has no prompt, so it can also be pushed silently by Action1 or another RMM tool.
The onboarding package identifies your tenant. Keep it somewhere only admins can reach.
Step 3.2: Turn on the advanced features
Go to Settings → Endpoints → General → Advanced features. Set each switch as below, then select Save preferences.
| Feature | Set to | What it does |
|---|---|---|
| Automated Investigation | On | Investigates alerts and fixes or recommends fixes on its own |
| Live Response | On | Enables manual response actions: run a scan, isolate a device, stop and quarantine a file |
| Enable EDR in block mode | On | Lets Defender remove threats it detects even when another antivirus is the primary one |
| Allow or block file | On | Needed for file indicators (Part 4) |
| Custom network indicators | On | Needed for URL, domain and IP indicators (Part 4) |
| Tamper protection | On | Stops malware, and local admins, from switching off antivirus protection |
| Web content filtering | On | Needed for the web filtering policy (Part 4) |
| Device discovery | On | Onboarded PCs report other devices they see on the network that aren’t protected yet |
| Show user details | On | Shows names and titles from Entra on alerts |
| Preview features | Your choice | Early access to new features |
| Microsoft Intune connection | Leave off | Only useful with an Intune license |
Live Response for Servers and Live Response unsigned script execution aren’t available in Defender for Business.
Tamper protection changes how you work. Once it’s on, scripts and local admins can no longer turn off real-time protection, cloud protection or behavior monitoring on a PC. That is the point, but it also means those settings must come from the portal policies in Part 4.
Step 3.3: Set up email notifications
Without these, nobody finds out about an alert unless they happen to open the portal.
- Go to Settings → Endpoints → Email notifications.
- On the Alerts tab, select Add item (or Add notification rule).
- Name the rule, choose the severities to notify on (at least Medium and High), and select Next.
- Enter the recipient addresses. Use the shared admin address or your ticketing system’s intake address. Select Send test email if offered, then Save.
- Open the Vulnerabilities tab and repeat, to be told when new vulnerabilities affect your devices.
Step 3.4: Set the time zone and check device discovery
- Go to Settings → Security center → Time zone and choose your local time zone, so alert times read correctly.
- Go to Settings → Device discovery and confirm Standard discovery is selected. Discovered devices appear under Assets → Devices with onboarding status Can be onboarded.
Step 3.5: Know how to offboard
When a PC is retired or leaves the company:
- Go to Settings → Endpoints → Device management → Offboarding.
- Select Windows 10 and 11, choose Local script, and download the package. Offboarding packages expire after about 30 days, so download a fresh one each time.
- Run the script on the PC as administrator.
The device stops reporting. Its past data stays in the portal for the retention period.
Part 4: Defender portal (protection policies)
Defender for Business ships with two default policies, antivirus and firewall, that apply to every onboarded Windows device from day one. This part reviews those, then adds web filtering, indicators and attack surface reduction rules.
How policies reach devices
- Policies are assigned to device groups. A default group holds every onboarded Windows device.
- You create a custom device group inside the policy wizard: on the Device groups step, choose + Create new group, name it, and pick the devices.
- A device gets only one policy of each type. If two antivirus policies target the same PC, it receives the one highest in the list and ignores the rest. Put specific policies above general ones.
Start by editing the default policies. Create extra policies only when some PCs need different settings.
Step 4.1: Review the antivirus policy (next-generation protection)
- Go to Endpoints → Configuration management → Device configuration.
- Select the Windows tab (it may read Windows clients).
- Under Next-generation protection, select the default policy, then Edit.
- On General information, select Next.
- On Device groups, keep the default group and select Next.
- On Configuration settings, check each setting against the table below, then select Next.
- On Review your policy, select Update policy.
| Setting | Recommended | What it does |
|---|---|---|
| Turn on real-time protection | On | Finds and stops malware as files are opened, downloaded or run |
| Block at first sight | On | Checks never-seen files with Microsoft’s cloud within seconds and blocks bad ones |
| Turn on network protection | Block mode | Blocks connections to phishing and malware sites from any app. Required for web filtering and URL indicators outside Edge. |
| Action to take on potentially unwanted apps (PUA) | Enabled | Blocks adware and bundled junk software |
| Scheduled scan type | Quickscan | Weekly scan of the places malware usually hides |
| Day of week / Time of day to run a scheduled scan | A time PCs are on, such as Wednesday midday | A scan scheduled for 2 AM never runs on a laptop that’s shut |
| Use low performance | Off | Turning it on skips archives and catch-up scans |
| Allow users to access the Windows Security app | On | Users can see status and run a scan, but can’t change your settings |
| Exclusions (process, file and folder) | None unless a vendor requires one | Every exclusion is a blind spot. Add the narrowest one that fixes the problem. |
To give some PCs different settings, select Add under Next-generation protection instead of editing the default, and assign it to a new device group.
Step 4.2: Review the firewall policy
The default blocks all inbound connections on every network type and allows outbound. Keep that, and add exceptions only where something breaks.
- Go to Endpoints → Configuration management → Device configuration → Windows tab.
- Expand Firewall, select the default policy, then Edit.
- On Configuration settings, confirm Domain network, Public network and Private network are each set to Block all.
- To allow or block something specific, under Custom rules select + Add rule and fill in:
- Name and Description
- Profile: Domain, Public or Private network
- Remote address type: IP or Application file path
- Value: for example
192.168.1.0/24,192.168.1.10-192.168.1.20, orC:\Program Files\App\app.exe
- Select Create rule, then Next, then Update policy (or Create policy for a new one).
You can have up to 150 custom rules. To switch one off without deleting it, edit it and set Enable rule to Off.
Step 4.3: Set up web content filtering
This blocks websites by category, in Edge, Chrome, Firefox and other browsers. Defender for Business allows one policy, and it applies to everyone.
- Confirm Web content filtering is on in advanced features (Step 3.2) and network protection is in Block mode (Step 4.1).
- Go to Settings → Endpoints → Rules → Web content filtering and select + Add policy.
- Enter a name and description.
- Expand each parent category and tick what to block. A common starting set:
- Adult content: all
- High bandwidth: Peer-to-peer
- Legal liability: all (includes hacking, hate and illegal content)
- Leave Uncategorized unticked. It covers newly registered and parked domains and causes many false blocks.
- Apply the policy to all devices and save.
Changes can take up to two hours to reach PCs. To watch traffic before blocking anything, save the policy with no categories ticked: that is an audit-only policy. Results appear under Reports → Web protection.
Step 4.4: Allow or block specific sites and files (indicators)
Indicators are your manual allow and block list. Use them to block a known bad site or file, or to unblock a site that web filtering wrongly caught. In Defender for Business an indicator applies to all devices.
-
Go to Settings → Endpoints → Rules → Indicators.
-
Choose a tab: File hashes, IP addresses, URLs/Domains or Certificates.
-
Select Add item.
-
Indicator: enter the value (for example
badsite.example) and an expiry date, or Never. -
Action: choose one and add a description.
Indicator type Actions available URLs/Domains and IP addresses Allow, Audit, Warn, Block execution File hashes Allow, Audit, Block and remediate Certificates Allow, Block and remediate -
Choose whether to generate an alert when it triggers, and set the alert title and severity.
-
Review the summary and select Save.
An Allow indicator for a URL overrides a web content filtering block, which is how you make a single exception. To add many at once, use Import on the same page with the sample CSV it provides.
Step 4.5: Attack surface reduction rules and controlled folder access
Attack surface reduction (ASR) rules block behaviours malware relies on, such as stealing passwords from memory. Microsoft’s Defender for Business pages say to set these up in the Intune admin center, which opens on this tenant even without an Intune license; Defender then delivers the policy to onboarded devices.
First, make a group of devices in Entra. The policy is assigned to an Entra security group, not a Defender device group.
- In
entra.microsoft.com, go to Entra ID → Groups → New group. - Group type Security, a name such as
Defender-Managed-PCs, membership type Assigned. - Under Members, add the device objects for your onboarded PCs, then select Create. Start with the test PC only.
Then create the policy.
- In
intune.microsoft.com, go to Endpoint security → Attack surface reduction and select Create policy. - Platform: choose Windows. Don’t choose Windows 10 and later; profiles for that platform only work on Intune-enrolled devices.
- Profile: choose Attack Surface Reduction Rules, then Create.
- Enter a name, then Next.
- On Configuration settings, set Microsoft’s three standard protection rules to Block. They rarely disrupt users:
- Block credential stealing from the Windows local security authority subsystem
- Block abuse of exploited vulnerable signed drivers
- Block persistence through WMI event subscription
- Set the rules you’re unsure about to Audit, so they log without blocking. Good ones to audit first:
- Block executable content from email client and webmail
- Block all Office applications from creating child processes
- Block execution of potentially obfuscated scripts
- Use advanced protection against ransomware
- Block untrusted and unsigned processes that run from USB
- For ransomware protection, scroll to Enable Controlled Folder Access and choose Audit Mode first. Move to Enabled after a week or two of clean reports.
- Select Next, skip scope tags, and on Assignments add the
Defender-Managed-PCsgroup. - Select Next, then Create.
Check it arrived. After an hour or so, in the Defender portal go to Reports → Attack surface reduction rules and open the Configuration tab. The test PC should show the rules. If it shows nothing after a day, the policy isn’t reaching devices on your tenant; set the same rules with the PowerShell in Part 7 instead.
If your Defender portal has Endpoints → Configuration management → Endpoint security policies, you can create the same policy there without leaving the portal.
Review audit results on the Detections tab of the same report. When a rule shows no legitimate activity being caught, edit the policy and move it from Audit to Block. Use the Add exclusions tab sparingly.
Part 5: Defender portal (monitoring and response)
Policies prevent; this part is where you see what got through and act on it. Nothing here needs setup beyond Part 3. It’s a tour of the pages to check, and how often.
| Page | Where | Check | What to do there |
|---|---|---|---|
| Incidents | Investigation & response → Incidents & alerts → Incidents | Daily, and on every alert email | Open each incident, read the attack story, assign it, and close it with a classification |
| Action center | Investigation & response → Action center | Daily | Approve or reject fixes waiting under Pending; review what was done under History |
| Devices | Assets → Devices | Weekly | Look for devices with high risk or exposure level, sensors not reporting, and discovered devices that aren’t onboarded |
| Vulnerability management | Endpoints → Vulnerability management → Recommendations | Weekly | Work the list from the top: it ranks fixes by how much risk they remove |
| Software inventory | Endpoints → Vulnerability management → Inventories | Monthly | Spot outdated or unexpected software |
| Secure Score | Exposure management → Secure score | Monthly | Follow Recommended actions for identity and device settings you’ve missed |
| Reports | Reports → Endpoints | Monthly | Device health, web protection, firewall, and attack surface reduction reports, plus the monthly security summary |
Respond to a threat on a device
- Go to Assets → Devices and select the device.
- Use the actions at the top right of the device page (some are under the ⋯ menu):
| Action | Use it when |
|---|---|
| Run antivirus scan | You suspect something and want a quick or full scan now |
| Isolate device | The PC is likely compromised. It’s cut off from the network but stays connected to Defender so you can keep investigating. Select Release from isolation when it’s clean. |
| Stop and quarantine file (from a file’s page or an alert) | A specific file is malicious and running |
| Add indicator (from a file’s page) | You want that file blocked everywhere from now on |
| Collect investigation package | You need logs and running-process details for a deeper look |
Every action is recorded in Action center → History, and most can be undone from there.
Reduce alert noise
If a known-safe tool keeps raising the same alert, tune it instead of ignoring the queue.
- Open the alert and select Tune alert (older portals call it Create suppression rule).
- Choose the conditions that identify the safe activity, as narrowly as possible.
- Choose to hide or auto-resolve matching alerts, and save.
Review tuning rules under Settings → Microsoft Defender XDR → Alert tuning.
What you won’t find
Defender for Business has no advanced hunting, so you can’t run custom queries across device data, and it keeps less history than Defender for Endpoint Plan 2.
Part 6: PowerShell for tenant settings
Most of Parts 1 and 2 can be scripted with the Microsoft Graph PowerShell module, which is useful when you set up several tenants the same way. The Defender portal’s policies have no PowerShell module of their own; what Defender offers instead is a web API, covered at the end of this part.
| Setting | PowerShell? |
|---|---|
| Security defaults, passkeys, user permissions, app consent, guest invites | Yes, below |
| LAPS toggle and MFA-to-join | Yes, below (beta endpoint) |
| Role assignments, password expiry, device groups in Entra | Yes, below |
| Idle session timeout, self-service trials, admin consent reviewers | Use the GUI |
| Antivirus, firewall and web filtering policies; advanced features; email notifications | Defender portal only |
| Indicators; device list; device actions | Defender API, below |
| ASR rules, controlled folder access | On each device, Part 7 |
Step 6.1: Install the module and connect
Run this on your admin workstation in PowerShell 7 or Windows PowerShell 5.1. The install is large and takes a few minutes.
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes @(
'Policy.Read.All'
'Policy.ReadWrite.SecurityDefaults'
'Policy.ReadWrite.Authorization'
'Policy.ReadWrite.AuthenticationMethod'
'Policy.ReadWrite.DeviceConfiguration'
'RoleManagement.ReadWrite.Directory'
'Domain.ReadWrite.All'
'Group.ReadWrite.All'
'Device.Read.All'
'User.Read.All'
)
Get-MgContext | Select-Object Account, TenantId # confirm you're in the right tenantA browser window asks you to sign in with MFA. The first time, it also asks you to consent to the permissions listed; sign in as a Global Administrator for that. When you’re finished, run Disconnect-MgGraph.
Step 6.2: Security defaults
# Check
(Get-MgPolicyIdentitySecurityDefaultEnforcementPolicy).IsEnabled
# Turn on
Update-MgPolicyIdentitySecurityDefaultEnforcementPolicy -BodyParameter @{ isEnabled = $true }Step 6.3: Enable passkeys (FIDO2)
Update-MgPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration `
-AuthenticationMethodConfigurationId 'Fido2' `
-BodyParameter @{
'@odata.type' = '#microsoft.graph.fido2AuthenticationMethodConfiguration'
state = 'enabled'
}
# See every method and whether it's on
Get-MgPolicyAuthenticationMethodPolicy |
Select-Object -ExpandProperty AuthenticationMethodConfigurations |
Select-Object Id, StateUse the same command with 'Sms' or 'Voice' and state = 'disabled', changing the @odata.type to #microsoft.graph.smsAuthenticationMethodConfiguration or #microsoft.graph.voiceAuthenticationMethodConfiguration.
Step 6.4: Restrict user permissions and guest invitations
This matches Steps 1.3 and 1.5.
# Look before you change
Get-MgPolicyAuthorizationPolicy |
Select-Object AllowInvitesFrom, GuestUserRoleId -ExpandProperty DefaultUserRolePermissions
Update-MgPolicyAuthorizationPolicy -BodyParameter @{
allowInvitesFrom = 'adminsAndGuestInviters' # only admins and the Guest Inviter role
guestUserRoleId = '2af84b1e-32c8-42b7-82bc-daa82404023b' # most restrictive guest access
defaultUserRolePermissions = @{
allowedToCreateApps = $false
allowedToCreateSecurityGroups = $false
allowedToCreateTenants = $false
allowedToReadBitlockerKeysForOwnedDevice = $false
}
}Step 6.5: Block user consent to apps
This matches Step 1.4. The script removes only the entries that let users consent for themselves and keeps anything else that’s set.
$current = (Get-MgPolicyAuthorizationPolicy).DefaultUserRolePermissions.PermissionGrantPoliciesAssigned
$current # note this down so you can put it back
$keep = @($current | Where-Object { $_ -notlike 'ManagePermissionGrantsForSelf.*' })
Update-MgPolicyAuthorizationPolicy -BodyParameter @{
permissionGrantPolicyIdsAssignedToDefaultUserRole = $keep
}To allow consent only for low-risk permissions from verified publishers instead, add 'ManagePermissionGrantsForSelf.microsoft-user-default-low' to $keep before the update.
Step 6.6: Turn on LAPS and require MFA to join devices
This matches part of Step 1.6. This setting lives on Graph’s beta endpoint and must be sent back whole, so the script reads the policy, changes two values and writes it back. Beta endpoints can change; if this errors, use the GUI.
$uri = 'https://graph.microsoft.com/beta/policies/deviceRegistrationPolicy'
$policy = Invoke-MgGraphRequest -Method GET -Uri $uri
$policy.Remove('@odata.context')
$policy.localAdminPassword.isEnabled = $true
$policy.multiFactorAuthConfiguration = 'required'
Invoke-MgGraphRequest -Method PUT -Uri $uri -ContentType 'application/json' `
-Body ($policy | ConvertTo-Json -Depth 10)Step 6.7: Assign and audit admin roles
# Give someone the Security Administrator role
$user = Get-MgUser -UserId 'jordan@yourdomain.com'
$role = Get-MgRoleManagementDirectoryRoleDefinition -Filter "displayName eq 'Security Administrator'"
New-MgRoleManagementDirectoryRoleAssignment -PrincipalId $user.Id -RoleDefinitionId $role.Id -DirectoryScopeId '/'
# List every Global Administrator
$ga = Get-MgRoleManagementDirectoryRoleDefinition -Filter "displayName eq 'Global Administrator'"
Get-MgRoleManagementDirectoryRoleAssignment -Filter "roleDefinitionId eq '$($ga.Id)'" |
ForEach-Object { (Get-MgDirectoryObject -DirectoryObjectId $_.PrincipalId).AdditionalProperties.userPrincipalName }Step 6.8: Password expiry and license check
# Never expire, per domain
Get-MgDomain | ForEach-Object {
Update-MgDomain -DomainId $_.Id -PasswordValidityPeriodInDays 2147483647
}
# Which licenses the tenant has, and how many are used
Get-MgSubscribedSku | Select-Object SkuPartNumber, ConsumedUnits,
@{ n = 'Total'; e = { $_.PrepaidUnits.Enabled } }Step 6.9: Create the device group for Step 4.5
$group = New-MgGroup -DisplayName 'Defender-Managed-PCs' -MailEnabled:$false `
-MailNickname 'defender-managed-pcs' -SecurityEnabled
# Add one device by name
$device = Get-MgDevice -Filter "displayName eq 'PC-PILOT01'"
New-MgGroupMember -GroupId $group.Id -DirectoryObjectId $device.IdStep 6.10: The Defender API (indicators and device list)
Defender for Business includes Microsoft’s Defender for Endpoint API. It needs an app registration, which acts as a service account.
Create the app registration (GUI, once):
- In
entra.microsoft.com, go to Entra ID → App registrations → New registration. Name itDefender-Automationand select Register. - Open API permissions → Add a permission → APIs my organization uses, search for WindowsDefenderATP, and choose Application permissions.
- Tick Ti.ReadWrite.All (manage indicators) and Machine.Read.All (list devices). Select Add permissions, then Grant admin consent.
- Open Certificates & secrets → New client secret. Copy the secret value now; it’s shown once. Store it in your password manager.
- From Overview, note the Application (client) ID and Directory (tenant) ID.
That secret can change what your devices block. Give it a short expiry and never save it in a script file.
$tenantId = '<tenant id>'
$clientId = '<application id>'
$secret = Read-Host 'Client secret' -AsSecureString
$token = (Invoke-RestMethod -Method Post `
-Uri "https://login.microsoftonline.com/$tenantId/oauth2/v2.0/token" `
-Body @{
client_id = $clientId
client_secret = [System.Net.NetworkCredential]::new('', $secret).Password
scope = 'https://api.securitycenter.microsoft.com/.default'
grant_type = 'client_credentials'
}).access_token
$headers = @{ Authorization = "Bearer $token" }
$api = 'https://api.securitycenter.microsoft.com/api'
# List onboarded devices
(Invoke-RestMethod -Uri "$api/machines" -Headers $headers).value |
Select-Object computerDnsName, osPlatform, healthStatus, onboardingStatus, lastSeen
# Block a domain on every device
$indicator = @{
indicatorValue = 'badsite.example'
indicatorType = 'DomainName' # or Url, IpAddress, FileSha256, FileSha1
action = 'Block' # or Allowed, Audit, Warn, BlockAndRemediate (files)
title = 'Blocked: badsite.example'
description = 'Phishing site reported on 2026-12-03'
severity = 'Medium'
generateAlert = $true
} | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "$api/indicators" -Headers $headers `
-ContentType 'application/json' -Body $indicator
# List current indicators
(Invoke-RestMethod -Uri "$api/indicators" -Headers $headers).value |
Select-Object indicatorValue, indicatorType, action, expirationTimePart 7: PowerShell for device settings
These scripts run on each PC, as administrator or SYSTEM. They cover the settings no portal can push on this license, and they let you check that portal policies arrived. Push them with Action1, another RMM tool, or a GPO startup script. Test each on the pilot PC first.
All the Defender cmdlets (Get-MpComputerStatus, Set-MpPreference and so on) are built into Windows.
Step 7.1: Health check
Run this to see whether a PC is onboarded and protected. It changes nothing.
$s = Get-MpComputerStatus
$onboard = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows Advanced Threat Protection\Status' -ErrorAction SilentlyContinue
[pscustomobject]@{
Computer = $env:COMPUTERNAME
Onboarded = ($onboard.OnboardingState -eq 1)
SenseService = (Get-Service Sense -ErrorAction SilentlyContinue).Status
AntivirusMode = $s.AMRunningMode # want: Normal
RealTimeProtection = $s.RealTimeProtectionEnabled # want: True
TamperProtected = $s.IsTamperProtected # want: True
SignatureAgeDays = $s.AntivirusSignatureAge # want: 0 or 1
NetworkProtection = (Get-MpPreference).EnableNetworkProtection # 1 = block, 2 = audit, 0 = off
ControlledFolders = (Get-MpPreference).EnableControlledFolderAccess # 1 = on, 2 = audit, 0 = off
FirewallProfilesOn = ((Get-NetFirewallProfile | Where-Object Enabled).Name -join ', ')
BitLocker = (Get-BitLockerVolume -MountPoint $env:SystemDrive).ProtectionStatus
}Step 7.2: Attack surface reduction rules
Use this if the portal policy in Step 4.5 doesn’t reach your devices, or if you’d rather not depend on it. The three standard protection rules go straight to block. The rest start in audit.
$block = @(
'9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2' # Block credential stealing from LSASS
'56a863a9-875e-4185-98a7-b882c64b5ce5' # Block abuse of exploited vulnerable signed drivers
'e6db77e5-3df2-4cf1-b95a-636979351e5b' # Block persistence through WMI event subscription
)
$audit = @(
'be9ba2d9-53ea-4cdc-84e5-9b1eeee46550' # Block executable content from email client and webmail
'd4f940ab-401b-4efc-aadc-ad5f3c50688a' # Block all Office applications from creating child processes
'3b576869-a4ec-4529-8536-b80a7769e899' # Block Office applications from creating executable content
'75668c1f-73b5-4cf0-bb93-3ecf5cb7cc84' # Block Office applications from injecting code into other processes
'd3e037e1-3eb8-44c8-a917-57927947596d' # Block JavaScript or VBScript from launching downloaded executable content
'5beb7efe-fd9a-4556-801d-275e5ffc04cc' # Block execution of potentially obfuscated scripts
'92e97fa1-2edf-4476-bdd6-9dd0b4dddc7b' # Block Win32 API calls from Office macros
'b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4' # Block untrusted and unsigned processes that run from USB
'c1db55ab-c21a-4637-bb3f-a12568109d35' # Use advanced protection against ransomware
)
foreach ($id in $block) { Add-MpPreference -AttackSurfaceReductionRules_Ids $id -AttackSurfaceReductionRules_Actions Enabled }
foreach ($id in $audit) { Add-MpPreference -AttackSurfaceReductionRules_Ids $id -AttackSurfaceReductionRules_Actions AuditMode }
# Show what's set: 1 = block, 2 = audit, 6 = warn, 0 = off
$p = Get-MpPreference
0..($p.AttackSurfaceReductionRules_Ids.Count - 1) | ForEach-Object {
[pscustomobject]@{ Rule = $p.AttackSurfaceReductionRules_Ids[$_]; Action = $p.AttackSurfaceReductionRules_Actions[$_] }
}To move a rule from audit to block later, run the Add-MpPreference line again for that ID with Enabled.
See what the audit rules would have blocked:
# 1121 = blocked, 1122 = audited
Get-WinEvent -LogName 'Microsoft-Windows-Windows Defender/Operational' -MaxEvents 500 |
Where-Object Id -in 1121, 1122 |
Select-Object TimeCreated, Id, Message -First 20The same detections also appear in the Defender portal under Reports → Attack surface reduction rules.
Step 7.3: Controlled folder access (ransomware protection)
This stops unknown programs changing files in Documents, Pictures, Desktop and similar folders. Start in audit: it commonly blocks older or unsigned business software.
Set-MpPreference -EnableControlledFolderAccess AuditMode # later: Enabled
# Allow a trusted program that gets flagged
Add-MpPreference -ControlledFolderAccessAllowedApplications 'C:\Program Files\Vendor\app.exe'
# Protect an extra folder
Add-MpPreference -ControlledFolderAccessProtectedFolders 'D:\CompanyData'Audit and block events are IDs 1124 and 1123 in the same event log as above.
Step 7.4: LAPS client settings
This pairs with the Enable LAPS switch from Step 1.6. The PC then rotates its local administrator password and stores it in Entra.
$key = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\LAPS'
New-Item -Path $key -Force | Out-Null
Set-ItemProperty $key BackupDirectory 1 -Type DWord # 1 = Microsoft Entra ID
Set-ItemProperty $key PasswordAgeDays 30 -Type DWord
Set-ItemProperty $key PasswordLength 16 -Type DWord
Set-ItemProperty $key PasswordComplexity 4 -Type DWord
Invoke-LapsPolicyProcessingRead a password back from your admin workstation:
Connect-MgGraph -Scopes 'Device.Read.All', 'DeviceLocalCredential.Read.All'
Get-LapsAADPassword -DeviceIds 'PC-PILOT01' -IncludePasswords -AsPlainTextIn the GUI, the same passwords are under Entra ID → Devices → Overview → Local administrator password recovery.
Step 7.5: BitLocker with the recovery key saved to Entra
The PC needs a TPM and must be Entra joined. The script saves the recovery key to Entra before encrypting, so a failed upload never leaves you with a locked disk and no key.
$drive = $env:SystemDrive
$vol = Get-BitLockerVolume -MountPoint $drive
if ($vol.VolumeStatus -eq 'FullyDecrypted') {
Add-BitLockerKeyProtector -MountPoint $drive -RecoveryPasswordProtector | Out-Null
$recovery = (Get-BitLockerVolume -MountPoint $drive).KeyProtector |
Where-Object KeyProtectorType -eq 'RecoveryPassword' | Select-Object -First 1
BackupToAAD-BitLockerKeyProtector -MountPoint $drive -KeyProtectorId $recovery.KeyProtectorId -ErrorAction Stop
Enable-BitLocker -MountPoint $drive -EncryptionMethod XtsAes256 -UsedSpaceOnly -TpmProtector
} else {
"BitLocker status on ${drive}: $($vol.VolumeStatus)"
}Confirm the key is stored: in entra.microsoft.com, open the device under Entra ID → Devices → All devices and select BitLocker keys.
Step 7.6: Lock in SmartScreen for Microsoft Edge
Web content filtering blocks through SmartScreen in Edge. These policies stop users switching it off or clicking past its warnings.
$key = 'HKLM:\SOFTWARE\Policies\Microsoft\Edge'
New-Item -Path $key -Force | Out-Null
Set-ItemProperty $key SmartScreenEnabled 1 -Type DWord
Set-ItemProperty $key SmartScreenPuaEnabled 1 -Type DWord
Set-ItemProperty $key PreventSmartScreenPromptOverride 1 -Type DWordCheck on the PC at edge://policy.
Step 7.7: Useful one-liners
Update-MpSignature # fetch the latest antivirus definitions now
Start-MpScan -ScanType QuickScan # run a quick scan now
Get-MpThreatDetection | Select-Object -First 10 # recent detections on this PC
Get-MpPreference | Select-Object Exclusion* # any antivirus exclusions in effectWhat tamper protection will refuse
With tamper protection on (Step 3.2), Set-MpPreference commands that try to turn off real-time protection, cloud protection or behavior monitoring are silently ignored. Change those in the portal policy. The scripts above aren’t affected.
Verify it all worked
Run through this once after setup, then every quarter. Each line names the part that sets it.
Identity
- A test user signing in from a private browser window is made to register and use MFA (1.1)
- Your admin account signs in with a passkey or security key (1.2)
- A test user can’t open
entra.microsoft.comuser lists or register an app (1.3) - A test user asked to approve a third-party app sees a request-approval prompt, not a consent button (1.4)
- Only the two break-glass accounts and your named admin account hold Global Administrator (1.7)
- Break-glass accounts were tested and their keys are stored offline
Devices
- Every company PC appears under Assets → Devices with a recent last-seen time (3.1)
- The detection test raised an alert and an email arrived (3.1, 3.3)
- The health check script shows real-time protection on, tamper protected, network protection 1 (7.1)
- A blocked category site shows a block page in Edge and in a second browser (4.3)
- A test indicator blocks its site within two hours, then is removed (4.4)
- The ASR report’s Configuration tab lists your rules on each PC (4.5 or 7.2)
- Each PC has a LAPS password and a BitLocker key visible in Entra (7.4, 7.5)
- A non-admin user on a PC can’t turn off virus protection in Windows Security (3.2)
Operations
- Someone is named to check incidents daily and recommendations weekly (Part 5)
- Message center and alert emails go to a shared address, not one person (2.7, 3.3)
- Leavers are blocked from sign-in and their PCs offboarded (2.2, 3.5)
What you can’t configure on this license
These need a license the tenant doesn’t have. The last column is the nearest substitute.
| Feature | Needs | Substitute on this license |
|---|---|---|
| Conditional Access (MFA rules by app, location or device; excluding break-glass accounts) | Entra ID P1 | Security defaults (1.1) |
| Self-service password reset for users | Entra ID P1 or Microsoft 365 Business Standard and up | Admins reset passwords; admins themselves can self-reset |
| Custom banned passwords, lockout thresholds, named locations | Entra ID P1 | Built-in defaults |
| Risky sign-in and risky user detection, just-in-time admin roles | Entra ID P2 | Weekly review of sign-in logs |
| Dynamic groups | Entra ID P1 | Assigned groups (6.9) |
| Intune configuration profiles, compliance policies, app deployment, update rings | Intune | Action1 or GPO, plus Part 7 scripts |
| Intune LAPS, BitLocker and account protection policies | Intune | Part 7 scripts |
| Device control (USB restrictions) from the portal | Intune-managed devices | GPO or registry |
| Edge management service (cloud browser policy) | A plan with Microsoft 365 Apps | Registry policies (7.6) |
| More than one web filtering policy, or per-group indicators | Defender for Endpoint | One tenant-wide policy (4.3) |
| Advanced hunting, longer data retention | Defender for Endpoint Plan 2 | Reports and incident pages |
| Email and Teams protection (Safe Links, anti-phishing) | Exchange Online plus Defender for Office 365 | Not applicable without Microsoft mail |
Microsoft 365 Business Premium includes Entra ID P1, Intune, Defender for Business and Defender for Office 365 Plan 1. If a client needs more than two or three rows of this table, that upgrade usually costs less than maintaining the workarounds.
Sources
Microsoft documentation, checked on the date at the top. Portal labels change often; the setting names are more stable than the menu paths.
Defender for Business
- Set up, review and edit security policies and settings
- Onboard devices
- Advanced feature settings
- Next-generation protection policies
- Firewall
- Device groups
- Web content filtering
- Attack surface reduction rules
- Roles and permissions
- Overview and comparison with Defender for Endpoint
- Frequently asked questions
Defender for Endpoint
- Security settings management for devices not enrolled in Intune
- Create indicators for files and indicators overview
Entra ID and Microsoft 365
- Security defaults
- Default user permissions
- Configure user consent and admin consent workflow
- Manage device identities and device settings
- Windows LAPS in Microsoft Entra ID
- Self-service password reset licensing
- Idle session timeout
- Graph: update security defaults and update device registration policy
Not checked against a Microsoft page today: the Part 5 menu paths, the external collaboration and self-service trial steps, the Defender API script, and the Part 7 scripts (rule IDs, BitLocker and SmartScreen settings). They follow Microsoft’s documented cmdlets and APIs as I know them, but test each on the pilot PC or a test tenant before rolling out.
One open point: Microsoft’s Defender for Business pages say attack surface reduction rules need Intune, while its Defender for Endpoint page lists them as deliverable to devices not enrolled in Intune. Step 4.5 tells you how to see which applies to your tenant, and Step 7.2 works either way.