This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Update the WriteSecurity to change the item level permissions | |
//Set the Edit property to Create items and edit items that were created by the user | |
// 1 - Create and edit all items | |
// 2 - Create items and edit items that were created by the user | |
// 3 - None | |
import { sp, Web } from "@pnp/sp/presets/all"; | |
(async () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mgt-get resource="/me/messages" version="beta" scopes="mail.read" max-pages="2"> | |
<template> | |
<div style="background-color:#eee;padding:8px 30px;"> | |
<div class="email" data-for="email in value" style="padding:20px; background-color:#fff"> | |
<h3>{{ email.subject }}</h3> | |
<h4> | |
<mgt-person person-query="{{email.sender.emailAddress.address}}" view="oneline" person-card="hover"> | |
</mgt-person> | |
</h4> | |
<div data-if="email.bodyPreview" class="preview" innerHtml>{{email.bodyPreview}}</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$outputfilepath = "< OUTPUT PATH WITH FILENAME.csv >" | |
Write-host 'ensure logged in' | |
$m365Status = m365 status | |
if ($m365Status -eq "Logged Out") { | |
m365 login | |
} | |
# Fetch all AAD users from Microsoft 365 | |
$allusers = m365 aad user list --properties 'displayName,userPrincipalName,accountEnabled' -o json | ConvertFrom-Json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- THIS CODE USES THE MICROSOFT GRAPH TOOLKIT --> | |
<!-- USE THE MICROSOFT GRAPH TOOLKIT EDITOR WEBPART FOR BETTER RESULT --> | |
<!-- REFERENCE LINK: http://www.ktskumar.com/2021/06/spfx-microsoft-graph-toolkit-show-all-application-registrations-in-sharepoint/ --> | |
<style type="text/css"> | |
table { | |
border-collapse: collapse; | |
margin: 0; | |
padding: 0; | |
width: 100%; | |
table-layout: fixed; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Export all webpart or control information from all pages in a SharePoint site to CSV format | |
### | |
$outputfilepath = "<Output fodler>\webparts.csv" | |
$weburl = "https://contoso.sharepoint.com" | |
#Validate login in | |
$m365Status = m365 status | |
if ($m365Status -eq "Logged Out") { | |
m365 login | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// POST request Call | |
function RestRequest(url, params) { | |
var req = new XMLHttpRequest(); | |
return new Promise(function(resolve, reject) { | |
req.onreadystatechange = function() { | |
if (req.readyState != 4) // Loaded | |
return; | |
if (req.status >= 200 && req.status < 300) { | |
resolve(req); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* **** RUN THIS SNIPPET in Browser Developer Console to see the output **** */ | |
// POST request Call | |
function RestRequest(url, params) { | |
var req = new XMLHttpRequest(); | |
return new Promise(function(resolve, reject) { | |
req.onreadystatechange = function() { | |
if (req.readyState != 4) // Loaded | |
return; | |
if (req.status >= 200 && req.status < 300) { | |
resolve(req); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* **** RUN THIS SNIPPET in Browser Developer Console to see the output **** */ | |
// POST request Call | |
function RestRequest(url, params) { | |
var req = new XMLHttpRequest(); | |
return new Promise(function(resolve, reject) { | |
req.onreadystatechange = function() { | |
if (req.readyState != 4) // Loaded | |
return; | |
if (req.status >= 200 && req.status < 300) { | |
resolve(req); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Host '****** Export All Flow run histories into CSV ******' | |
#Provide Ouput Folder Path | |
$outputPath = "<Output Folder Path>" | |
$timestamp = Get-Date -Format "yyyymmddhhmmss" | |
$flowhistoryValues = @() | |
$environmentId = $(m365 flow environment list --query "[?contains(name,'Default')]" -o json | ConvertFrom-Json).Name | |
$flows = m365 flow list --environment $environmentId -o json | ConvertFrom-Json |