Long-running PowerShell Office 365 reports

(WIP)

PowerShell is our best friend when it comes to ad-hoc and/or scheduled reports in Microsoft 365. PnP team is doing great job providing more and more functionality with PnP PowerShell module for Office 365 SharePoint and Teams.

Small and medium business organizations are mostly good, but for large companies it might be a problem due to just huge amount of data stored in SharePoint. PowerShell reports on all users or all sites might run days… which is probably OK if you run this report once, but totally not acceptable if you need this report e.g. daily/weekly or on-demand.

How can we make heavy PowerShell scripts run faster?

Of course, you start with logic (algorithm) and leveraging full PowerShell functionality (e.g. PowerShell 7 parallelism or PnP batching).

(examples)

What if you did everything, but it still takes too long? You need something like brute force – the closer your code runs to your tenant – the better.
What are the option?
– Automation account runbook (+workflow)
– Azure Function Apps
– Azure VM in the region closest to your Tenant

Automation account runbook (+workflow)

Seemed like a good option, but not something Microsoft promotes. Even opposite – automation accounts support only PowerShell 5 (not 7), no plug-ins for VS Code and recently there were messages on some retirement or smth.

Meantime, I tested it – and did not find any significant increasing in speed. In a nutshell, what is behind this service? Same windows machines running somewhere in Azure .

TBC

References
PnP PowerShell

Exact Location of your SharePoint Online Microsoft Office 365 tenant

Quick answer: spin-up a few VMs in different Azure regions, then ping your SharePoint tenant. The moment you see 1ms ping you know the tenant exact location.

Full story

Microsoft says: “Customers should view tenant specific data location information in your Microsoft 365 Admin Center in Settings | Org settings | Organization Profile | Data location.
And it might look like:

That’s accurate to the geography (e.g. US, UE, AP), but not to the region (for instance – “Central US”, “UK West” or “Australia Southeast”).
In other words, If you know your data are in the US, you do not know where exactly – East/West/Central or South US.
Meantime when you create an Azure resource (e.g. Virtual Machine) – you can select specific region.

How do I know – where is my Microsoft 365 tenant actually located?

Can we just ping the tenant, analyze result and find Office 365 tenant region?
Luckily, SharePoint tenant is pinging with just
PS>ping tenantName.SharePoint.com
I have tested 5 regions and 4 different tenants:

ping from/to (ms)tenant 1 (US)tenant 2 (EU)tenant 3 (US)tenant 4 (US)
North Europe731796101
East US1833931
Central US221142323
West US631463633
South Central US3111211

So I figured it out:
My o365 tenants #3 and #4 regions are South Central US (Texas, San Antonio),
tenant #1 resides in East US.

Why do I need this?

Imagine you are running heavy reports against your tenant.
So probably you want your code running as close as possible to your tenant.
For this, you can spin-up a VM in Azure or use Azure Functions – just select proper region 🙂
(please check also “Long-running PowerShell reports optimization in Office 365“)

References:
Where your Microsoft 365 customer data is stored

SPO: Allow users to create modern pages

Microsoft: “Using modern pages in Microsoft SharePoint is a great way to share ideas using images, Office files, video, and more. Users can Add a page to a site quickly and easily, and modern pages look great on any device.
If you’re a global or SharePoint admin in Microsoft 365, you can allow or prevent users from creating modern pages. You can do this at the organization level by changing settings in the SharePoint admin center. If you allow the creation of site pages as the organization level, site owners can turn it on or off at the site level.

By default both
– Allow users to create new modern pages
– Allow commenting on modern pages
are turned on (enabled)

Tenant or SharePoint admin can find settings under
SharePoint Admin Center -> Settings -> Pages

How it looks like:

Site Pages are created under “Pages” Library.

Let us test it, with:
– (tenant-level) Allow users to create new modern pages: ON
– (tenant-level) Allow commenting on modern pages: ON
– web feature “Site Pages” – “Allows users to add new site pages to a site”: Activated

User
Permissions
can create Pagecan edit pagecan Enable/Disable
page comments
can comment on Page
Full Control (Owner)YesYesYesYes
Edit (Member)YesYesYesYes
Read (Visitor)NoNoNoYes

There is a web feature “Site Pages” – “Allows users to add new site pages to a site”.
The feature is activated by default:

What if we disable this feature?
“New -> Page” has disappeared from “New” menu under “Site Contents” for Owners and Members…
From “Home” and “Pages” you still can see “New -> Page” options.
You can still create a new page from but if you try to create a page from Pages – “Sorry, something went wrong” “Cannot create a Site Page. Please have your administrator enable the required feature on this site.” :

Office 365 behavior, with:
– (tenant-level) Allow users to create new modern pages: ON
– (tenant-level) Allow commenting on modern pages: ON
– web feature “Site Pages” – “Allows users to add new site pages to a site”: Deactivated

User
Permissions
can create Pagecan edit pagecan Enable/Disable
page comments
can comment on Page
Full Control (Owner)Yes,
but only from “Home”
not from “Site Contents” or “Pages”
YesYesYes
Edit (Member)Yes,
but only from “Home”
not from “Site Contents” or “Pages”
YesYesYes
Read (Visitor)NoNoNoYes


If we disable feature “Site Pages” – “Allows users to add new site pages to a site” on the root web – it does not affect subsites (subwebs).

Can we Activate/Deactivate the feature “Site Pages” using PowerShell?

PowerShell

(TBP)

References
– Microsoft “Allow users to create and comment modern pages

See also:
Allow commenting on modern pages

Office 365 Search scopes

Search is everywhere in Microsoft 365. You can search from SharePoint, Teams, Delve, Yammer etc.

But! You cannot search for anything from everywhere!

Upd Oct 2025: Microsoft finished moving all services to cloud.microsoft and launched web-based Copilot and Search from m365.cloud.microsoft. E.g.
– Copilot: https://m365.cloud.microsoft/chat
– Search: https://m365.cloud.microsoft/search
What is interesting is search here works across all services – Exchange, SharePoint, Teams so from one place you can search content in emails, SharePoint pages, documents, lists, Teams chats.

Original article:

  • Search for your Teams chat messages works only in Teams.
  • But from Teams you cannot search for regular (non-group) sites and public teams sites
  • All descriptions are totally out of search (e.g. site description, library/list description – including Yammer groups, Teams and regular sites).
  • Public Team Sites content is not searchable from Teams and Yammer

So, what are the scopes of each search entry point in Office 365 and is there an entry point you can search for everything?

Search scopesSharePoint
Search center
SharePoint home
Office portal
Office desktop app
Delve
TeamsBing
SharePoint contentYesYesYes
Teams contentYesYesYesYes
Teams chats(*1)YesYes
Yammer contentYesYesYes
Yammer chat(*1)Yes
User profilesYesYes
Email
(*1) Microsoft announced they are working on bringing conversations (both Teams chats and Yammer) to SharePoint landing page first, then to Office home page.

Detailed:

ScopeOut of Scope
SharePoint Search Center– all sites content
(Teams, Yammer, regular),
– user profiles
– OneDrive
Teams chat
Yammer chat
SharePoint Landing Pagesame as SharePoint Search center
but Teams chats and Yammer Conversations are coming
same as SharePoint Search Center
Office.comsame as SharePoint
(Teams chats and Yammer Conversations are coming after SharePoint)
same as SharePoint
Delve
TeamsTeams content
Teams chat
OneDrive
Yammer
User Profiles
regular SharePoint sites
BingEverything* * except people profiles content
(e.g. about me)

Seems like the only tool you can search for EVERYTHING with is Microsoft Bing:

Update: there are rumors that Microsoft is decommissioning work search in Bing… Pity… But something tells me that decomm is due to lack of usage/popularity, so Microsoft will introduce something similar…

After Microsoft add Teams chats and Yammer conversations to SharePoint landing page search scope (then to Office home page) – it’ll be the best place to search from for everything.

More on Microsoft Search vs SharePoint Search and Microsoft Search RoadMap

Microsoft Office 365 Search: Find what you need with Microsoft Search in Bing

It is possible customize Modern Microsoft Search pages with PnP Modern Search

Виртуальные страны

Почему бы не сделать виртуальные страны?Идея в том чтобы люди могли не сходя с места выбирать в какой стране жить.
Ситуация, когда общество расколото на две половины и каждая часть твёрдо стоит на своём и не желает идти на компромиссы напоминает мне что-то среднее между анекдотом когда два ковбоя бесплатно дерьма наелись и басней крылова “Лебедь, рак и щука”.
Я понимаю, если бы например одна партия имела перевес допустим в 80%, то она бы победила и вся страна, включая проигравшие 20% – забыли бы на 4-8 лет все обиды и вместе стали идти к светлому будущему, сообща и согласнованно строить новое лучшее общество.
Но ведь ситуация такая, что большого перевеса ни у кого нет уже долгое время. Страна разделена на две равные части и если одна выигрывает – то это не значит что другая соглашается с курсом – наоборот, другая остаётся при своих идеях, саботирует всё что только можно.
Получается чуть ли “Мы старый мир разрушим до основания а затем, мы наш мы новый мир построим. Кто был никем тот станет всем” каждые 4-8 лет.
Так почему бы каждой из этих половин не жить по тем законам, которые им нравятся? В нашем современном мире это должно быть технически осуществимо. Каждый человек раз в 4 года выбирает, по каким законам он хочет жить.
Если хочет, например, высокие налоги на бизнес, низкие налоги на зарплату, бесплатное образование, хорошую социальную защиту, ограничение на владение оружием и больше гражданский свобод – пусть живёт по законам виртуальной страны №1.
Если человек хочет запретить аборты и ЛГБТ браки, облегчить доступ к оружию, дорогую медицину и образование – пусть живёт в виртуальной стране номер два.
Тогда каждая виртуальная страна не будет тратить деньги на “разрушить старый мир и строить новый” каждые 4 года, а будет твёрдо идти в будущее своим курсом. Это же сколько денег можно сэкономить!
А конечная цель то у стран – одна – чтобы люди жили лучше. Средства достижения – разные. Вот и посмотрим, какая страна быстрее пойдёт к светлому будущему.
На возражение – “но ведь конкуренция между партиями – важная часть демократии и мы все видим к чему приводит партийные монополизм” – отвечу что а) Конкуренция не исчезает, а наоборот становится более честной, так как люди будут выбирать лидера не по голословным популистским заявлениям а по делам. Т.е. люди будут голосовать кошельком а не бумажками. иб) Монополизм (единоначалие, автократия) не всегда плохо. Плохо, когда это превращается в застой и отсутствие обратной связи на долгое время. Плохо, когда население не может “голосовать ногами”. В проектном менеджменте по-моему есть такое что демократия нужна на этапе выбора пути, а вот на этапе исполнения нужна “твёрдая рука”.
Я понимаю, что есть такие хитрецы, которые пока хорошо зарабатывают и не болеют – будут жить в одной стране, а в случае чего захотят переметнуться. Это можно сделать через “доплати”. В технологически развитой стране, где все транзакции электронные – это можно делать автоматически.
Трудности, конечно могут возникнуть например с внешней политикой или с армией. Полицейский же не должен думать – в какой виртуальной стране живёт человек прежде чем его защищать. Но вообще я думаю что все технические моменты можно решить, было бы желание.
Можно даже не две виртуальные страны сделать – а больше. Можно даже сделать мини-виртуальные страны и двойное – тройное виртуальное гражданство. Например, по отношению к внешней политике я выбираю страну В1, по здавоохранению я живу в стране Б5, и чту гражданский кодекс страны Г7.
И не обязательно в рамках одной физической…?

Microsoft Volume Licensing Programs

Корпоративные лицензии – это самый удобный для организаций способ лицензирования продуктов Microsoft.

КОРПОРАТИВНЫЕ ЛИЦЕНЗИИ
Это именные, непередаваемые, неисключительные лицензии, которые выпускаются компанией Microsoft индивидуально для каждого клиента.
Поставляются в виде запечатанного конверта, в котором находится документ с указанием наименования компании-обладателя лицензии, списка лицензированных продуктов и других реквизитов. Срок поставки электронных ключей составляет 2-5 дней, лицензий в бумажном виде – 7-10 дней.

VLSC (VOLUME LICENSING SERVICE CENTER)
С практической точки зрения большую ценность представляет доступ к сайту VLSC – Volume Licensing Service Center. При покупке корпоративных лицензий Microsoft клиент получает доступ через этот сайт к дистрибутивам продуктов и их ключам. Доступ к сайту открывается обычно в течение 2-3 дней после покупки. Доступ к сайту VLSC сначала предоставляется сотруднику, который отвечает за лицензирование (например, системный администратор или юрист), позже он может предоставить доступ и другим сотрудникам организации.

По Корпоративным лицензиям можно купить только актуальную на текущий момент версию продукта (например, Windows 10, Windows Server 2019, SharePoint 2019), но корпоративная лицензия обычно включает право Downgrade, т.е. возможность пользоваться предыдущими версиями продукта.
Дистрибутивы и ключи к предыдущим версиям также доступны на VLSC.

Виды корпоративного лицензирования
Open License (OLP) – простой выкуп лицензий на конкретные продукты в собственность:
– Можно купить столько лицензий, сколько надо, но обычно не менее 5 шт. в первом закупе (в дальнейшем от 1 шт.)

Open Value (OV) – выкуп лицензий в собственность с оплатой в рассрочку на 3 года, равномерными платежами:
– Цена включает SA, но в дальнейшем SA покупать не обязательно ( т.е. в первые 3 года SA оплачено, далее – опция )
– Начальные затраты ниже, чем у OLP
– Есть скидки «за стандартизацию», т.е. при покупке лицензий на весь парк ПК – цены ниже

Open Value Subscription (OVS) – аренда лицензий с ежегодной оплатой (подписка на лицензии):
– Минимальные начальные затраты
– Право пользоваться всегда самыми последними версиями ПО ( т.е. SA всегда входит в цену )
– Можно увеличивать количество лицензий, уменьшать или отказываться от лицензий в зависимости от потребностей
– Оплата происходит раз в год – надо просто посчитать количество используемых лицензий и оплатить их. При этом, например, вновь купленные в течение года компьютеры тоже будут считаться лицензированными. Есть продукты по которым
– Возможен выкуп лицензий в постоянное пользование по истечении 3-х лет аренды
– Требуется “стандартизация”, т.е. лицензирование всех ПК ( Windows или CAL или Office )

ЧТО ТАКОЕ SA
SA – Software Assurance. Купив к продукту SA, клиент получает возможность использовать все новые версии продукта, выпускаемые в течение действия подписки. А также для некоторый продуктов ряд дополнительных преимуществ, таких как право на использование второй копии на личном домашнем компьютере, право использования ПО в виртуальной среде, право переноса лицензий в частное или публичное облако и т.п.
SA продаётся как подписка, т.е. на ограниченный срок (2-3года), который можно постоянно продлевать.

Open Licensing programs хорошо подходят организациям от 5 до 250 сотрудников.
Менее 5 сотрудников – проще купить “коробки” – box/retail версии продуктов.
Более 250 сотрудников – организация имеет право на EA – Enterprise Agreement.

Подробнее об Open Programs на сайте Microsoft:
What are the Microsoft Open Programs?

Какую помощь оказывают партнёры Microsoft по лицензированию:
Support Provided by Licensing Solution Partners

Microsoft Licensing

Как купить Microsoft

  • Office Suite (Word, Excel, PowerPoint)
  • Office 365 (SharePoint, Teams, Exchange etc.)
  • Azure cloud subscription

Option 1: прямо на сайте Microsoft :
Office 365 for Home
Office 365 for Business
Azure subscription (начать бесплатно)

Option 2: через партнёров Microsoft :
Find a Microsoft Solution provider
Top 200 Partners