Microsoft Defender Advanced Threat Protection seems to be becoming the defacto leader in the A/V industry, at least when Windows is concerned, but other OS’es seem to be following quickly 🙂
At one of my international customers, many different locations and departments exist and we’d like to group devices in MDATP based on their primary user so we can assigned different administrators automatically, and apply different web filtering policies.
MDATP has the following options available for grouping:
These membership rules don’t say anything about the user, and the machine domains are all cloud native (no hybrid joins). So we need to use Tags to gain flexible targeting in MDATP.
The following PowerShell script can be scheduled as an Azure Runbook to automatically tag all your MDATP devices based on the ‘Company’ attribute of the device’s primary user. It could also be modified easily to e.g. parse a user’s group membership or UPN’s domain.
Version 4.04 OnedriveMapper now automatically reconnects drives (of any type) when the cookie expires. No more ‘broken’ mappings! The script is smart enough to detect if its just a connectivity issue (= do nothing) or an actual drive issue.
All improvements since 4.00:
Auto Remap (automatically reconnect disconnected drives)
Block the IE firstrun wizard properly
Bugfix: properly handle existing shortcuts instead of throwing an error
Increase Converged Drive (single mapping with sub-mappings) reliability
For an Azure Managed Application Marketplace scenario, I needed to get information about the user logon domains and the company name of any tenants that purchased our Managed Application through the Azure Marketplace.
Azure Marketplace only has a CRM and a CRUD connection, these don’t send more than some basic name/email/company name and subscription ID’s, and thus the CRM and CRUD operations are hard to match up against one another and to really know who you’re dealing with.
With the following PS snippets, you can get all information from all tenants that have a link with you through Azure Lighthouse / Azure Marketplace:
The ‘tenantCategory’ property will have a value of Home if you have an active account in that tenant (as a guest user for example). If lighthouse / CSP is the only authorization, it will say “ProjectedBy”. Both is also possible (tenantCategory is not a json array though, it is ‘seperated’ by a comma).
For a customer use case in an Azure Marketplace Managed Application scenario, I needed the ability to translate the (customers’) Azure Subscription ID (which is known to the publishing tenant) to a tenant ID. Using Get-AzSubscription, Lighthouse subscriptions don’t show the true tenant ID of the other tenant, but only show your own tenant ID.
The following PS function can retrieve the tenant ID for you (without authentication):
With version 4.00 OnedriveMapper now fully supports ‘Modern’ Authentication!
As I wrote started this script in my early programming days and there’s a lot of crap code in there I also finally cleaned up a little, reducing the total number of lines by ~50% 🙂
The result is a much faster, leaner script that will map and/or redirect to anything in Office 365 for any of your users. MFA? Not a problem. External MFA? Also not a problem. Conditional Access? Totally fine.
Some older rarely used legacy features were removed, and login is only silent if no MFA / SSO is configured for IE.
The older version (3.X) will remain in my git repo but will not be actively maintained.