During an Exchange online management activity for one of our enterprise clients, I had to determine which mailboxes are on cloud and which ones still resides on-premise. After going through several PS commands, I had to come up with a customized basic script to get this done neatly. This script will run against Office 365 and check for the following.
Get licensed users, fetch Display Name, UPN and IsLicensed properties and format the output then export the result to an CSV file.
Connect to Exchange online PowerShell using Connect-ExchangeOnline and then run the following after customizing the output path to suit your environment.
If you remember classic SharePoint, it had that nice looking (and yet unreliable sometimes) feature called “SharePoint Site Structure” which was eventually deprecated as move & copy functions were introduced. This was very insightful to understand the site and content hierarchy across the entire SharePoint farm.
However, let’s assume you want to review your modern day SharePoint Online hierarchy every once in a while, and make sure your sites, libraries and lists are aligning to best practices as far as the depth of the site levels? Or, you just want to know what sort of sites exist in your site collection, we still have a manual way of getting those information out using a simple PowerShell script. This may not be the best sophisticated way of getting a handy report which can probably be obtained using a 3rd party tool.
Unless its a test environment, we rarely notice any Office 365 tenant without MFA enabled, so this script is Modern-Auth friendly and supports MFA. You can generate a basic report of all sites, libraries and lists in a specific site collection by defining the site collection name and CSV path to save it.
###Function to Get Lists and Libraries of a web
Write-host -f Yellow "Getting Lists and Libraries from site:" $Web.URL
###Get all lists and libraries
$Lists= Get-PnPList -Web $Web
foreach ($List in $Lists)
$Data = new-object PSObject
$Data | Add-member NoteProperty -Name "Site Name" -Value $Web.Title
$Data | Add-member NoteProperty -Name "Site URL" -Value $Web.Url
$Data | Add-member NoteProperty -Name "List Title" -Value $List.Title
$Data | Add-member NoteProperty -Name "List URL" -Value $List.RootFolder.ServerRelativeUrl
$Data | Add-member NoteProperty -Name "List Item Count" -Value $List.ItemCount
$Data | Add-member NoteProperty -Name "Last Modified" -Value $List.LastItemModifiedDate
$SiteInventory += $Data
###Get All Subwebs
$SubWebs = Get-PnPSubWebs -Web $Web
Foreach ($Web in $SubWebs)
$SiteInventory+= Get-SPOSiteInventory -Web $Web
$SiteURL = "https://sitename.sharepoint.com/sites/PWA"
$CSVFile = "C:\temp\filename.csv"
###Get Credentials to connect
#Connect to PNP Online
Connect-PnPOnline -Url $SiteURL -UseWebLogin
###Get the Root Web
$Web = Get-PnPWeb
###Call the function and export results to CSV file
Get-SPOSiteInventory -Web $Web | Export-CSV $CSVFile -NoTypeInformation
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
As you execute it, you’ll be prompted for credentials and the report will be generated (duration might depend on the number of site collections and the weight of each)
An uncommon but definitely one of those once in a while query from the HR or compliance/security leadership you will get is “Can we search for Microsoft Teams chat” in Office 365.
The answer depends on the type of content/period that you need. Here are some of the use cases I worked on (probably not the exact case as yours but you might get some clarity here about where to look for)
Teams stores an individual’s chat history in a hidden file in the users mailbox which is not accessible via OWA or Outlook. Users or Administrators cannot access these hidden files. Skype for Business used to archive these in the users mailbox which they could delete but we didn’t worry about that because our email archive still had a record of those IMs.
You can see in the following screenshot that I have tried to add the Internal IT channel mailbox in to the Outlook and obviously “Conversation History” is empty because it’s a hidden folder. So, with that in mind, we will have to dig in through a different way.
Scenario A: How to retrieve the conversation history of a particular Team/Channel?
First lets connect to Exchange online PowerShell to put up a foundation in to what we are looking for.
Login as a Global Admin
All the chat history from Microsoft Teams is saved into a mailbox with the name of the Team. So I’m looking for a mailbox called “Internal IT”. Easiest way is to fire up trusty PowerShell and run:
Let’s run this line to retrieve all the group mailboxes we have in this tenant.
I see all the shared mailboxes in my tenant. As you can see I find one called “Internal IT” as shown below.
Now this is the Channel I am interested in (Internal IT). This simply means that each channel has a dedicated database which brings the initial satisfaction ! We could surely get something out now.
With that in mind, we now know what is the address of the Team channel I need to look in to. And, here comes the e-Discovery content search for the rescue. Yes we can fetch the Teams chat history from there !
Head on to Compliance Admin blade from office 365 Admin center
Go to “e-Discovery”
Start by creating a new case here. Hit “+ Create a case” to begin
Give it a simple name and a description and save
Click on the blue “Open” button to get inside the case
It brings you to the search interface
From Searches, add the following search parameters.
You can customize your query to suite your needs and I have done it as below. Feel free to click that little “X” to close each parameter and add another to match your target result.
Use the “Add Conditions” button to refine your search criteria
I am not going to search based on a keyword so it’s going to be the participants parameter and the value is my target Team (Project Delivery)
From the locations, choose the following and unselect everything else.
You can further customize your search query to get a more refined search result but it’s totally up to you. My target is to get the entire chat history of “Project Delivery Team” Team chat.
Finally hit the search button and give it a few seconds/minutes (based on the content size of the tenant).
And, here we are ! It now shows me all the IM’s under this Team.
You can export the result in two ways, a report or the result
Also, it allows you to choose what you want to export.
Once done, click on the relevant export batch and download it.
When you download, there’ll be a small tool to obtain the batch. Make sure you are on the Microsoft Edge browser for this final task.
Warning: You must use Microsoft Edge or Internet Explorer to download search results or reports. Please switch to one of these browsers to download the content.
The following error means you are not using Microsoft Edge for this task. Just switch your browser and you should be good to go !
Yes you are right!. Setting this access right organization-wide is surely raises a major privacy concern specially when it comes to personal details (such as HR and Operation related events) in employee’s calendars.
However, there can be exceptional scenarios where business decides what they need, such as the pandemic situation the whole world face right now (COVID-19) as every organization prepares to work from home and allow people to interact online in more efficient and effective ways. In my case, one of our top level client badly needed to enable everyone’s calendar visible to everyone in the company to allow people to efficiently get in touch.
This is possible and exchange online has the capability to do it, but, make sure you do it for an absolute purpose. In Exchange online, you can set the default internal sharing policy for Office 365 user’s calendars using PowerShell. You may decide to set the default for all current users to Limited Details, then add exceptions for users whose calendar is to be kept to Availability (Free/Busy) only. There are various roles to define as per your need.
The AccessRights parameter in the PS command below specifies the permissions that you want to modify for the user on the mailbox folder. The values that you specify replace the existing permissions for the user on the folder.
You can specify individual folder permissions or roles, which are combinations of permissions. You can specify multiple permissions and roles separated by commas.
I am emphasizing again, DO NOT DO THIS Unless there is an absolute necessity.
For None-MFA environment (even though MFA is a fundamental and very common security requirement, there can be exceptional cases) – Amend the AccessRights parameter accordingly
Now let’s see how this works after changing the permissions. Details wise, this is how it shown now (looking at Chnau’s Calendar from Manoj’s Mailbox)
Private Events in Chanu’s Calendar (Only the date/time and Subject)
None Private Events in the Chanu’s Calendar (Shown Items in detail)
Attendees and response status
Item opened in full window
Here’s the full list of roles available to set. You can specify individual folder permissions or roles, which are combinations of permissions. You can specify multiple permissions and roles separated by commas.
CreateItems: The user can create items in the specified folder.
CreateSubfolders: The user can create subfolders in the specified folder.
DeleteAllItems: The user can delete all items in the specified folder.
DeleteOwnedItems: The user can only delete items that they created from the specified folder.
EditAllItems: The user can edit all items in the specified folder.
EditOwnedItems: The user can only edit items that they created in the specified folder.
FolderContact: The user is the contact for the specified public folder.
FolderOwner: The user is the owner of the specified folder. The user can view the folder, move the folder, and create subfolders. The user can’t read items, edit items, delete items, or create items.
FolderVisible: The user can view the specified folder, but can’t read or edit items within the specified public folder.
ReadItems: The user can read items within the specified folder.
The roles that are available, along with the permissions that they assign, are described in the following list:
Microsoft Teams currently doesn’t have the Forward chat option which sometimes makes it a little harder when you have to share a chat with someone else in the organization. There are valid use cases where we need to refer to a particular conversation in Teams and forward chat option would definitely be a handy add-in there. However, the new feature called “Share to Outlook” can also be used as a temporary alternative in such scenarios (not in all cases obviously).
In Teams, you now can forward a message embedded to an email. Let’s say i want to forward the following message to few people in my organization.
To do this, I can simply hover to your desired conversation and click on the three dots.
And, click on “Share to Outlook” option from the dropdown list.
The send email flyout will pop up. Simply add the recipients and customize the subject or body as required and send it out.
This may not be a replacement for message forwarding but at least an temporary alternative for situations where you need it the most.
This sounds like it comes under moderation feature of Teams, but it’s not. If you are trying to configure Teams owners to allow deleting chats sent by other members, you are on the right place. Microsoft Teams has moderation features but this doesn’t falls under that setting.
To configure moderation for Teams, you can refer to my previous article which will walk you through the moderation configuration.
Let’s have a look at this scenario. As you can see below, Neil is a member of the “Project Delivery” team and he sent a few messages in the Linda Scope channel. Let’s think about a situation where some users post inappropriately in a channel and the Team owner would like to take it out immediately (when there is no moderation enabled). At this point, its fair that an owner might need the control to manage this.
By default, owners won’t be able to delete these messages from the channel. As the following screenshot elaborates, Manoj is the Team owner and he has no ability to delete the message.
Here are the owners of this channel (obviously, Manoj is an owner here)
To empower owners of this Team with delete permission, we can simply turn it on from the Message Policy. Login to Office 365 an administrator and head on to “Teams Admin Centre”
Navigate to “Messaging Policies”
By default, there is only one Messaging Policy which is “Global ORG Wide” policy. You can use this policy if you want every Teams owner should be granted (applies to all existing and upcoming Teams) with this privilege.
Note: If you are editing the Default Global policy, it might take a few hours to apply the changes (right now, 24-48 hours)
Just leave it as it is and create a new custom policy if you are looking to grant this for certain owners only.
Give it a meaningful name and a small description to recognize. And ensure the first switch (Owners can delete sent messages) is turned “ON”
Once done, you should be able to see both policies listed down.
Now let’s navigate to “Users” blade and click on the target administrator who you want to grant this privilege and navigate to policies in that profile (remember, you need to repeat this for every owner individually)
Click on the “Edit” link on the right pane and assign the custom policy under ” Messaging Policy” dropdown as shown below.
Give it a few minutes and check the same scenario. Log in as a member and try to post a new message then try to delete that by logging from Owners account (for testing, it is ideal to have two browser profiles and both users logged in side by side so you could monitor the behavior in real time).
As you can see from the following screen shot, Manoj can now delete this Neil’s message as an owner. Which means, the policy has applied to Manoj Successfully.
And if I needed, I still could Undo it so the message will restore
If you are editing the Default Global policy, it might take a few hours to apply the changes (right now, 24-48 hours)
From the first look this error definitely sounds like “Office 365 ATP Safe links or Safe attachments” policy components blocking the files behind the scenes, but it’s not !. Well, it could be the same error in such scenarios but in my case, Safe Link or Safe Attachment policies were not the issue.
Scenario: Users trying to share content within the organization by uploading them to a OneDrive/SharePoint location chosen from the dropdown as attached to the Outlook email on the go.
Attach a file to email and upload it to OneDrive/SharePoint
Attach a file from SharePoint/OneDrive
Once added the cloud based file to the mail, this is how it looks. Then send it out
Emails are smoothly delivered to the recipients however, when they try to open them (by simply clicking on the URL), recipients get the above error (The page that you are trying to access cannot be loaded)
This happens only when:
Users use desktop application of Outlook (not happening in OWA, files are accessed in OWA without an issue)
Or, Attached the file in to OneDrive or SharePoint as shown below (not happening when file URL is pasted to Outlook email)
The environment had Office 365 ATP safe link and Safe attachment policies implemented properly. And the exceptions are added to trusted partners across the globe for this company (as a multi-national)
Resolution: Due to the criticality of this organization-wide behavior, I worked with Microsoft Support team towards a fix and here’s what we did.
We ran a fiddler session while opening the file from both OWA and Client App and reviewed the recording – OWA is working fine while outlook not able to access the wrapped URL. It looked like outlook API used for calling ATP is not functioning well.
Microsoft further analyzed by collecting below information and then engaged the Product Group:
Collect fiddler trace for both OWA and Outlook to make comparison
Copy the Wrapped URL from OWA and Outlook
Collect the corresponding message sample
As of now, Microsoft Product Group for ATP have not identified if it is a misconfiguration or product related bug, however, I receive constant responses stating that they are actively working towards a resolution. I will update this space as soon as I hear anything applicable towards a resolution/ETA.
Workaround: The only workaround for this is to request users to make use of Outlook Web whenever a file needs to be opened that is received via an email.
Sometimes emails hit the Quarantine state because the message is spam-ish or potentially malicious to be delivered to the end user (Admin quarantined). Usually when end users notify you regarding the legitimate email being quarantined, review section in Office 365 (https://protection.office.com/threatreview ) protection blade will help you to retrieve, review and release those legitimate messages to intended users. However, I faced an abnormal situation of “Internally shared emails were frequently quarantined for no valid reason”. And, they had no suspicious behavior/trend.
Whenever there is a legitimate email being quarantined, we can fetch it from the review section. Simply by typing the sender address or subject line will sort the message and allow us to review it and then take the necessary action.
These messages below are obvious Malwares and Phish. So this is not my concern at all ! O365 security is doing a great job here catching hundreds of malicious items daily !!
But how about these two cases?
Legitimate/genuine mails are admin quarantined – from a trusted partners or external vendors/customers being regularly admin quarantined even without reaching to end user spam folder?
Even internal emails shared within the organization being admin quarantined?
Whitelisting won’t fix this – Filling up your whitelist is not a good idea as “Whitelisting” and address or domain means, it will completely bypass the spam filter which is an obvious risk.
On the 1st case, the external domain is a very valid domain with a valid SPF and email content didn’t seem to match any suspicious trend policy. I can simply go ahead and release these messages if this happens occasionally but that’s not the best practice in this modern era. Adding these internal addresses is not recommended either (you should not add your own domain/emails to whitelist in Exchange online) .
Bottom-line is, those emails are marked as Phishing meaning that there’s a link somewhere in that email that’s broken and doesn’t go where it states it should. However, as I submitted these emails to Microsoft and raised a support ticket, I was informed that this is an issue Microsoft Spam team/product group is currently working diligently to fix this issue soon. Hence at this point of time, it is a waiting game and just a matter of baring with them during the process.
ETA: None as of now
I will update this post as soon as I receive a progress update from Microsoft support.
Security is a one of the most significantly improved areas of Microsoft Office 365. If you are using Exchange Online mailboxes under your Office 365 tenant or a consumer of standalone exchange online protection (EOP), your emails are protected either way.
Exchange online protection (a.k.a EOP) Is part of the Microsoft’s email safety roadmap which constantly evolves in a unmatched cross-product approach. As email usage has rapidly grown, so has the email security concerns. The idea behind EOP is to provide a range of comprehensive abilities in order to protect millions of users from Junk, phishing (fraudulent mail threats) and malware attacks which are some of the well-known types of email related abuses.
Exchange Online however, has the built in ability to protect you from many threats. Nevertheless, there could be some scenarios that you need to manually handle as an Exchange/Office 365 Administrator. The following article will show you on how to prevent receiving spamming emails from a specific address, domain because, there can be rare cases that one or few emails able to get through EOP and hit the user mailbox (again, very rarely).
In my case, it was the following email which arrived in few user mailboxes (looked obviously spam and the user immediately reported to me). At this point, we can make use of “Blocked Sender List” in Exchange to prevent this happening again. And, as EOP spam filtering learns from known spam and phishing threats and user feedback, it’s a great idea to submit these kind of messages to Microsoft so that they will use it to train the AI based component behind the EOP.
From: Sonia Luton <email@example.com>
There is something i need you to do for me. Let me know if you are available. I am going into a meeting with a limited access to phone calls, just reply my email and i will get back to you.
So the address is firstname.lastname@example.org and the domain is post.cz. From Office 365 Exchange Admin Centre, navigate to Exchange admin center and “Protection” –> “Spam Filter” . Click on the “default policy”
The following flyout will be opened. Navigate to “Blocked lists”
Click on the + icon to add a new blocked sender and insert the desired address.
Then let’s add the domain too for blocking.
Once added, the domain will be in the blocked list and Office 365 will entirely block any emails from this domain.
Save it and monitor your email traffic time to time to identify if it’s being blocked.
Microsoft Teams has recently hit 20M users and now undoubtedly one of the highest used productivity apps in the market. Not only the enterprises but also government and education sectors rapidly adopting Teams for their daily communication and collaboration needs as this simple handy tool is very effective and efficient.
Teams get even better this year with more new features planned to be rolled out. Let’s have a sneak peak at the highlighting ones.
1. Multi Window
A fantastic new feature which allows you to be more efficient specially during those meetings where you struggle to switch across. Multi-window experience is something critical for productivity apps such as Teams and its now scheduled to roll-out in early this year. Definitely the most awaited one for me personally as a heavy Teams user (in fact I never close Teams interface)
2. Private Channels
All teams are split up into channels, private channels allow you to have a private space within your team only visible to the people you gave permission to.
3. Message extensions
Another great addition to Teams. You can now easily start polls and surveys from the chat window and meetings, so you can have real-time feedback and answers from the audience just within Teams.
4. Pinned channels
With Pinned channels, you can pin your most-used or favorite channels and easily find them in the top left corner of the Teams interface.
5. Share to Teams – Outlook Integration
A Share to Teams button is now available on Outlook, you can also reply to Team conversations within Outlook.
6. Whiteboard Integrated
During a Teams meeting, with this new feature, you can open the Whiteboard and take notes as well as inviting people to the board after the meeting which would be a great addition for Teams rather than using other tools.
7. Live Captions
As participants are speaking in Teams meetings, their words will be captured in real time and appear underneath, so people can easily follow along by reading in a particular language.
8. Tasks Integrated
One of those many integrations coming in early 2020, Tasks will now be right within your Teams interface. You can access your Microsoft To Do, Outlook and Planner tasks all in one window from Teams and you can also choose the view that works for you among boards, lists, charts, and schedules.