Skip to content

Instantly share code, notes, and snippets.

@mrik23
mrik23 / EOL-RemoveAllMailboxFolderPermissions.ps1
Created December 12, 2017 11:32
Exchange Online PowerShell script to remove added permissions on all foldders of an user's mailbox. Can be used with Exchange Online PowerShell module with MFA.
<#
.SYNOPSIS
EOL-RemoveAllMailboxFolderPermissions.ps1
.DESCRIPTION
A script to remove permissions from all folders present in a particular user mailbox.
.OUTPUTS
Console output for progress.
{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"debugMode": true,
"elmType": "div",
"attributes": {
"class": {
"operator": "?",
"operands": [
{
"operator": "==",
{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"debugMode": true,
"elmType": "div",
"children": [
{
"elmType": "span",
"style": {
"padding-right": "8px"
},
{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"debugMode": true,
"elmType": "div",
"txtContent": "@currentField",
"attributes": {
"class": {
"operator": "?",
"operands": [
{
{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"debugMode": true,
"elmType": "div",
"txtContent": {
"operator": "+",
"operands": [
{
"operator": "toString()",
"operands": [
"This is a test." | Out-File ([Environment]::GetFolderPath("Desktop") + "\test.txt")
{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"debugMode": true,
"elmType": "div",
"txtContent": "@currentField",
"attributes": {
"class": {
"operator": "?",
"operands": [
{
{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"debugMode": true,
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": {
"operator": "?",
"operands": [
{
{
"$schema": {
"description": "schema of the JSON",
},
"debugMode": {
"description": "Is this JSON in debug mode?",
},
"elmType": {
"description": "The type of element to create",
},
{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"debugMode": true,
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "blue",
"color": "white",
"padding-left": "10px"
}