Skip to content

Instantly share code, notes, and snippets.

View rjesh-git's full-sized avatar
🚀

Rajesh Sitaraman rjesh-git

🚀
View GitHub Profile
## 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 https://YourOffice365Domain-admin.sharepoint.com/
## Gets all Teams in tenant
# Author Rajesh Sitaraman
# @rjesh | rjesh.com
<#
.SYNOPSIS
Download Ignite 2019 session presentation slides and videos.
.EXAMPLE
PS C:\> .\Get-IgniteContent.ps1 -DownloadPath /Users/rajeshsitaraman/src/public/share/IG-2019 -Keyword "AI"
.EXAMPLE
PS C:\> .\Get-IgniteContent.ps1 -DownloadPath /Users/rajeshsitaraman/src/public/share/IG-2019 -Keyword "Teams" -IncludeVideos
@rjesh-git
rjesh-git / computer-vision-output.json
Created August 5, 2019 23:00
Computer Vision Output
{
"categories": [
{
"name": "others_",
"score": 0.00390625
},
{
"name": "outdoor_",
"score": 0.01953125,
"detail": {
@rjesh-git
rjesh-git / hideTeams.sh
Created May 2, 2019 17:57
Office365 CLI hide Teams creation prompt
# Login to SharePoint online team site as owner
o365$ spo login https://M365x816568.sharepoint.com/sites/it
# set TeamifyHidden property as True
o365$ spo propertybag set --webUrl https://M365x816568.sharepoint.com/sites/it --key TeamifyHidden --value True
@rjesh-git
rjesh-git / addClientSideWebPart.ps1
Last active March 8, 2018 05:04
Add Client Side WebPart using PnP PoSh
function ConvertTo-Hashtable {
[CmdletBinding()]
[OutputType('hashtable')]
param (
[Parameter(ValueFromPipeline)]
$InputObject
)
process {
if ($null -eq $InputObject) {
@rjesh-git
rjesh-git / uploadImage.html
Last active February 22, 2018 21:51
Upload Image from CEWP/Script Editor
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js"></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">' );
},
CorrelationId : "b215479e-f056-5000-11a1-ec000000000010"
DesignPackageId : "00000000-0000-0000-0000-000000000000"
PreviewFeaturesEnabled: true
PublishingFeatureOn : false
ReycleBinItemCount : -1
aadInstanceUrl : "https://login.windows.net"
aadTenantId : "96d8e75d--14a031e2320f"
aadUserId : "e7d71f70-13e9-0000-0000-86d1269cd536"
alertsEnabled : true
allowSilverlightPrompt : "True"
// This is how you can access the page context info
this.context.pageContext.legacyPageContext;
// Retreive current user display name
this.context.pageContext.legacyPageContext['userDisplayName']);
// Even site classification
this.context.pageContext.legacyPageContext['siteClassification']);
@rjesh-git
rjesh-git / addSCACommSites.ps1
Last active February 2, 2018 22:02
add site collection admin to communication sites
# Update the tenant url
PS C:\> .\Add-CommSitesSCA.ps1 -Url https://<tenant>-admin.sharepoint.com
## Or Provide optional credentials
PS C:\> $creds = Get-Credential
PS C:\> .\Add-CommSitesSCA.ps1-Url https://<tenant>-admin.sharepoint.com -Credentials $creds
@rjesh-git
rjesh-git / GetAllGroups.ps1
Last active November 8, 2017 20:59
Get all Office 365 groups in tenant
$scopes = @("Group.Read.All")
Connect-PnPMicrosoftGraph -Scopes $scopes
Get-PnPUnifiedGroup