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.

PortalAddressWhat you set here on this license
Microsoft Entra admin centerentra.microsoft.comMFA 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 centeradmin.microsoft.comUsers and licenses, role assignment, password expiration, idle session timeout, security contacts
Microsoft Defender portalsecurity.microsoft.comDevice onboarding, antivirus and firewall policies, web content filtering, allow/block indicators, tamper protection, alerts, vulnerability management
Microsoft Intune admin centerintune.microsoft.comEndpoint 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

RoleUse it for
Global AdministratorFirst-time setup and tenant-wide switches only. Keep to two to four accounts.
Security AdministratorDay-to-day Defender work: policies, alerts, response actions
Security ReaderView-only access to devices, policies, alerts and reports

Confirm what the tenant is licensed for

  1. Go to admin.microsoft.com → Billing → Your products. You should see Microsoft Defender for Business and nothing that includes Intune or Entra ID P1.
  2. 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.
  3. 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.com domain, 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.

  1. Go to Entra ID → Overview → Properties.
  2. At the bottom, select Manage security defaults.
  3. 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.

  1. Go to Entra ID → Authentication methods → Policies.
  2. Select Passkey (FIDO2).
  3. Set Enable to on. Under Include, choose All users, or a group that holds your admins.
  4. Select Save.
  5. 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:

SettingSet toWhy
Users can register applicationsNoStops users creating app registrations that can hold credentials
Restrict non-admin users from creating tenantsYesStops shadow tenants created with work accounts
Users can create security groupsNoKeeps group-based access under admin control
Guest user access restrictionsGuest 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 centerYesHides 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 LinkedInNoAvoids 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.

  1. Go to Entra ID → Enterprise apps → Consent and permissions → User consent settings.
  2. 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.
  3. Select Save.
  4. Go to Consent and permissions → Admin consent settings.
  5. 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

  1. Go to Entra ID → External Identities → External collaboration settings.
  2. Under Guest invite settings, choose Only users assigned to specific admin roles can invite guest users.
  3. Select Save.

Step 1.6: Control who can join devices, and turn on LAPS

Go to Entra ID → Devices → Device settings and set:

SettingSet toWhy
Users may join devices to Microsoft EntraSelected, with a group of IT staffBy 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 EntraYesOff by default. Without Conditional Access this toggle is the only way to require it.
Maximum number of devices per userA sensible cap, such as 5 or 10Limits abuse of one account
Global administrator role is added as local administrator on the device during Microsoft Entra joinNoKeeps Global Admin credentials off workstations. Use LAPS for local admin access.
Registering user is added as local administrator on the device during Microsoft Entra joinNoneUsers no longer become local admins on PCs they join
Enable Microsoft Entra Local Administrator Password Solution (LAPS)YesLets 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 devicesYesRecovery 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

  1. Go to Entra ID → Roles & admins.
  2. Open Global Administrator and confirm the list is short: your named admin account and the two break-glass accounts.
  3. 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

  1. Go to Users → Active users and select the person.
  2. On the Account tab, under Roles, select Manage roles.
  3. Choose Admin center access, scroll down and expand Show all by category.
  4. Tick Security Administrator (listed under Security & Compliance) or Security Reader (listed under Read-only).
  5. Select Save changes.

Step 2.2: Keep licenses and accounts tidy

  1. Users → Active users: confirm every person with a work PC has the Defender for Business license.
  2. For anyone who has left, open the user and select Block sign-in, then remove the license.
  3. 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.

  1. Go to Settings → Org settings → Security & privacy.
  2. Select Password expiration policy.
  3. 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.

  1. Go to Settings → Org settings → Security & privacy.
  2. Select Idle session timeout.
  3. 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

  1. Go to Settings → Org settings → Services.
  2. Select User owned apps and services. Clear both boxes (access to the Office Store, and starting trials on behalf of the organization). Select Save.
  3. Select Self-service trials and purchases. For each product listed, choose Do not allow.
  4. Select User consent to apps and confirm it is off. It mirrors Step 1.4.

Step 2.6: Set the security contacts

  1. Go to Settings → Org settings → Organization profile → Organization information.
  2. Set Technical contact to a shared, monitored address such as admin@yourdomain, not one person’s mailbox.
  3. 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

  1. Health → Message center → Preferences: turn on email for the shared address, so upcoming security changes reach you.
  2. 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.

  1. Go to Settings → Endpoints. Under Device management, select Onboarding.
  2. For the operating system, select Windows 10 and 11.
  3. Under Connectivity type, select Streamlined.
  4. Under Deployment method, select Local script, then Download onboarding package.
  5. Copy the zip to the PC and extract it. You get WindowsDefenderATPLocalOnboardingScript.cmd.
  6. On the PC, open Command Prompt as administrator, run the script, and answer the prompt.
  7. 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.
  8. 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.

FeatureSet toWhat it does
Automated InvestigationOnInvestigates alerts and fixes or recommends fixes on its own
Live ResponseOnEnables manual response actions: run a scan, isolate a device, stop and quarantine a file
Enable EDR in block modeOnLets Defender remove threats it detects even when another antivirus is the primary one
Allow or block fileOnNeeded for file indicators (Part 4)
Custom network indicatorsOnNeeded for URL, domain and IP indicators (Part 4)
Tamper protectionOnStops malware, and local admins, from switching off antivirus protection
Web content filteringOnNeeded for the web filtering policy (Part 4)
Device discoveryOnOnboarded PCs report other devices they see on the network that aren’t protected yet
Show user detailsOnShows names and titles from Entra on alerts
Preview featuresYour choiceEarly access to new features
Microsoft Intune connectionLeave offOnly 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.

  1. Go to Settings → Endpoints → Email notifications.
  2. On the Alerts tab, select Add item (or Add notification rule).
  3. Name the rule, choose the severities to notify on (at least Medium and High), and select Next.
  4. Enter the recipient addresses. Use the shared admin address or your ticketing system’s intake address. Select Send test email if offered, then Save.
  5. 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

  1. Go to Settings → Security center → Time zone and choose your local time zone, so alert times read correctly.
  2. 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:

  1. Go to Settings → Endpoints → Device management → Offboarding.
  2. 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.
  3. 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)

  1. Go to Endpoints → Configuration management → Device configuration.
  2. Select the Windows tab (it may read Windows clients).
  3. Under Next-generation protection, select the default policy, then Edit.
  4. On General information, select Next.
  5. On Device groups, keep the default group and select Next.
  6. On Configuration settings, check each setting against the table below, then select Next.
  7. On Review your policy, select Update policy.
SettingRecommendedWhat it does
Turn on real-time protectionOnFinds and stops malware as files are opened, downloaded or run
Block at first sightOnChecks never-seen files with Microsoft’s cloud within seconds and blocks bad ones
Turn on network protectionBlock modeBlocks 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)EnabledBlocks adware and bundled junk software
Scheduled scan typeQuickscanWeekly scan of the places malware usually hides
Day of week / Time of day to run a scheduled scanA time PCs are on, such as Wednesday middayA scan scheduled for 2 AM never runs on a laptop that’s shut
Use low performanceOffTurning it on skips archives and catch-up scans
Allow users to access the Windows Security appOnUsers can see status and run a scan, but can’t change your settings
Exclusions (process, file and folder)None unless a vendor requires oneEvery 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.

  1. Go to Endpoints → Configuration management → Device configuration → Windows tab.
  2. Expand Firewall, select the default policy, then Edit.
  3. On Configuration settings, confirm Domain network, Public network and Private network are each set to Block all.
  4. 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, or C:\Program Files\App\app.exe
  5. 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.

  1. Confirm Web content filtering is on in advanced features (Step 3.2) and network protection is in Block mode (Step 4.1).
  2. Go to Settings → Endpoints → Rules → Web content filtering and select + Add policy.
  3. Enter a name and description.
  4. 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.
  5. 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.

  1. Go to Settings → Endpoints → Rules → Indicators.

  2. Choose a tab: File hashes, IP addresses, URLs/Domains or Certificates.

  3. Select Add item.

  4. Indicator: enter the value (for example badsite.example) and an expiry date, or Never.

  5. Action: choose one and add a description.

    Indicator typeActions available
    URLs/Domains and IP addressesAllow, Audit, Warn, Block execution
    File hashesAllow, Audit, Block and remediate
    CertificatesAllow, Block and remediate
  6. Choose whether to generate an alert when it triggers, and set the alert title and severity.

  7. 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.

  1. In entra.microsoft.com, go to Entra ID → Groups → New group.
  2. Group type Security, a name such as Defender-Managed-PCs, membership type Assigned.
  3. Under Members, add the device objects for your onboarded PCs, then select Create. Start with the test PC only.

Then create the policy.

  1. In intune.microsoft.com, go to Endpoint security → Attack surface reduction and select Create policy.
  2. Platform: choose Windows. Don’t choose Windows 10 and later; profiles for that platform only work on Intune-enrolled devices.
  3. Profile: choose Attack Surface Reduction Rules, then Create.
  4. Enter a name, then Next.
  5. 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
  6. 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
  7. 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.
  8. Select Next, skip scope tags, and on Assignments add the Defender-Managed-PCs group.
  9. 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.

PageWhereCheckWhat to do there
IncidentsInvestigation & response → Incidents & alerts → IncidentsDaily, and on every alert emailOpen each incident, read the attack story, assign it, and close it with a classification
Action centerInvestigation & response → Action centerDailyApprove or reject fixes waiting under Pending; review what was done under History
DevicesAssets → DevicesWeeklyLook for devices with high risk or exposure level, sensors not reporting, and discovered devices that aren’t onboarded
Vulnerability managementEndpoints → Vulnerability management → RecommendationsWeeklyWork the list from the top: it ranks fixes by how much risk they remove
Software inventoryEndpoints → Vulnerability management → InventoriesMonthlySpot outdated or unexpected software
Secure ScoreExposure management → Secure scoreMonthlyFollow Recommended actions for identity and device settings you’ve missed
ReportsReports → EndpointsMonthlyDevice health, web protection, firewall, and attack surface reduction reports, plus the monthly security summary

Respond to a threat on a device

  1. Go to Assets → Devices and select the device.
  2. Use the actions at the top right of the device page (some are under the ⋯ menu):
ActionUse it when
Run antivirus scanYou suspect something and want a quick or full scan now
Isolate deviceThe 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 packageYou 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.

  1. Open the alert and select Tune alert (older portals call it Create suppression rule).
  2. Choose the conditions that identify the safe activity, as narrowly as possible.
  3. 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.

SettingPowerShell?
Security defaults, passkeys, user permissions, app consent, guest invitesYes, below
LAPS toggle and MFA-to-joinYes, below (beta endpoint)
Role assignments, password expiry, device groups in EntraYes, below
Idle session timeout, self-service trials, admin consent reviewersUse the GUI
Antivirus, firewall and web filtering policies; advanced features; email notificationsDefender portal only
Indicators; device list; device actionsDefender API, below
ASR rules, controlled folder accessOn 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 tenant

A 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, State

Use 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
  }
}

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.Id

Step 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):

  1. In entra.microsoft.com, go to Entra ID → App registrations → New registration. Name it Defender-Automation and select Register.
  2. Open API permissions → Add a permission → APIs my organization uses, search for WindowsDefenderATP, and choose Application permissions.
  3. Tick Ti.ReadWrite.All (manage indicators) and Machine.Read.All (list devices). Select Add permissions, then Grant admin consent.
  4. Open Certificates & secrets → New client secret. Copy the secret value now; it’s shown once. Store it in your password manager.
  5. 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, expirationTime

Part 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 20

The 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-LapsPolicyProcessing

Read a password back from your admin workstation:

Connect-MgGraph -Scopes 'Device.Read.All', 'DeviceLocalCredential.Read.All'
Get-LapsAADPassword -DeviceIds 'PC-PILOT01' -IncludePasswords -AsPlainText

In 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 DWord

Check 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 effect

What 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.com user 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.

FeatureNeedsSubstitute on this license
Conditional Access (MFA rules by app, location or device; excluding break-glass accounts)Entra ID P1Security defaults (1.1)
Self-service password reset for usersEntra ID P1 or Microsoft 365 Business Standard and upAdmins reset passwords; admins themselves can self-reset
Custom banned passwords, lockout thresholds, named locationsEntra ID P1Built-in defaults
Risky sign-in and risky user detection, just-in-time admin rolesEntra ID P2Weekly review of sign-in logs
Dynamic groupsEntra ID P1Assigned groups (6.9)
Intune configuration profiles, compliance policies, app deployment, update ringsIntuneAction1 or GPO, plus Part 7 scripts
Intune LAPS, BitLocker and account protection policiesIntunePart 7 scripts
Device control (USB restrictions) from the portalIntune-managed devicesGPO or registry
Edge management service (cloud browser policy)A plan with Microsoft 365 AppsRegistry policies (7.6)
More than one web filtering policy, or per-group indicatorsDefender for EndpointOne tenant-wide policy (4.3)
Advanced hunting, longer data retentionDefender for Endpoint Plan 2Reports and incident pages
Email and Teams protection (Safe Links, anti-phishing)Exchange Online plus Defender for Office 365Not 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

Defender for Endpoint

Entra ID and Microsoft 365

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.