In the post-Onedrivemapper era where we have Files On Demand, there is still room for improvement in client side configuration of Onedrive for Business. Onedrive Known Folders isn’t up to par yet, doesn’t support any customization and there are situations where I want to be able to redirect local folders to other places than Onedrive like Teams or Sharepoint.
Therefore I present to you “Invoke-O4BAutoMount“; the ultimate Onedrive/Sharepoint/Teams sync and redirect solution in modern workplace scenario’s, no WebDav, just the NSG Onedrive Client and native Intune Management Extension:
I often need a tenant ID for a given customer, the usual method to get it is to log in to the Azure portal and find it there. But what if you want to get the tenant ID programmatically? Without actually logging in? And you only know the log in name of a user? Or just one of the customer’s domain names?
Then this’ll help you out!
Retrieves an Office 365 / Azure AD tenant ID for a given user login name (email address)
$tenantId = get-tenantIdFromLogin -Username email@example.com
the UPN of a user
author: Jos Lieben
$openIdInfo = Invoke-RestMethod "https://login.windows.net/$($Username.Split("@"))/.well-known/openid-configuration" -Method GET
Obviously, you can also get the tenant ID by just filling out bogus info in front of the user’s login (e.g. firstname.lastname@example.org), it’ll still work as only the domain part of the login is really used.
As my employer is a Microsoft Cloud Service Provider, we want to monitor the total storage available and the total storage used by all of the tenants we manage under CSP, including storage used by Sharepoint and Teams. This called for a script!
I slimmed down the resulting script to work for just a single tenant that you can use to generate an XLSX report of which of your sites / teams are nearing their assigned storage quota. You can either build your own alerting around this to raise site quota’s before your users upload too much data, or you can use it to buy additional storage from Microsoft before your tenant reaches the maximum quota 🙂