Skip to content

Instantly share code, notes, and snippets.


Rajesh Sitaraman rjesh-git

View GitHub Profile
View Get-Teams.ps1
## Run this in PowerShell as Administrator
## Install PnP PowerShell Module
Install-Module -Name PnP.PowerShell -AllowClobber
Import-Module PnP.PowerShell -Force
## Change YourOffice365Domain with yours, enter the global admin creds when prompted
Connect-PnPOnline -Url
## Gets all Teams in tenant
View Get-IgniteContent.ps1
# Author Rajesh Sitaraman
# @rjesh |
Download Ignite 2019 session presentation slides and videos.
PS C:\> .\Get-IgniteContent.ps1 -DownloadPath /Users/rajeshsitaraman/src/public/share/IG-2019 -Keyword "AI"
PS C:\> .\Get-IgniteContent.ps1 -DownloadPath /Users/rajeshsitaraman/src/public/share/IG-2019 -Keyword "Teams" -IncludeVideos
View computer-vision-output.json
"categories": [
"name": "others_",
"score": 0.00390625
"name": "outdoor_",
"score": 0.01953125,
"detail": {
rjesh-git /
Created May 2, 2019
Office365 CLI hide Teams creation prompt
# Login to SharePoint online team site as owner
o365$ spo login
# set TeamifyHidden property as True
o365$ spo propertybag set --webUrl --key TeamifyHidden --value True
rjesh-git / addClientSideWebPart.ps1
Last active Mar 8, 2018
Add Client Side WebPart using PnP PoSh
View addClientSideWebPart.ps1
function ConvertTo-Hashtable {
param (
process {
if ($null -eq $InputObject) {
rjesh-git / uploadImage.html
Last active Feb 22, 2018
Upload Image from CEWP/Script Editor
View uploadImage.html
<script type="text/javascript" src="//"></script>
<script type="text/javascript">
var ShowInsertImage = function (ctlId) {
var dOpt = {
url: imagesPath,
args: null, dialogReturnValueCallback: function callback(status, result) {
console.log('new file uploaded here:'+result.newFileUrl);
$('#container').append( '<br/><img src="'+result.newFileUrl+'" height="200" width="200">' );
View pagecontextinfo.js
CorrelationId : "b215479e-f056-5000-11a1-ec000000000010"
DesignPackageId : "00000000-0000-0000-0000-000000000000"
PreviewFeaturesEnabled: true
PublishingFeatureOn : false
ReycleBinItemCount : -1
aadInstanceUrl : ""
aadTenantId : "96d8e75d--14a031e2320f"
aadUserId : "e7d71f70-13e9-0000-0000-86d1269cd536"
alertsEnabled : true
allowSilverlightPrompt : "True"
View _spPageContextInfo.js
// This is how you can access the page context info
// Retreive current user display name
// Even site classification
rjesh-git / addSCACommSites.ps1
Last active Feb 2, 2018
add site collection admin to communication sites
View addSCACommSites.ps1
# Update the tenant url
PS C:\> .\Add-CommSitesSCA.ps1 -Url https://<tenant>
## Or Provide optional credentials
PS C:\> $creds = Get-Credential
PS C:\> .\Add-CommSitesSCA.ps1-Url https://<tenant> -Credentials $creds
rjesh-git / GetAllGroups.ps1
Last active Nov 8, 2017
Get all Office 365 groups in tenant
View GetAllGroups.ps1
$scopes = @("Group.Read.All")
Connect-PnPMicrosoftGraph -Scopes $scopes