Step 1: Sign into Office admin portal via https://portal.office.com/
Step 2: Click on Admin and navigate to Exchange admin center.
Step 3: Select mail flow, select rules, select New (the plus button), and then select Create a new rule.
Step 4: In the Name box, specify a name for the rule, and then select More options.
Step 5: Under Apply this rule if, select Any attachment, and then select has executable content.
Step 6: Under Do the following, point to Block the message, and then select Reject the message without notifying anyone.
Step 7: Click Save.