Skip to content

Instantly share code, notes, and snippets.

View vman's full-sized avatar
👨‍💻

Vardhaman Deshpande vman

👨‍💻
View GitHub Profile
$PnPO365ManagementAppId = "31359c7f-bd7e-475c-86db-fdb8c937548e"
az ad sp create --id $PnPO365ManagementAppId
az ad app permission grant --id $PnPO365ManagementAppId --api 00000003-0000-0000-c000-000000000000 --scope AppCatalog.ReadWrite.All
this.context.sdks.microsoftTeams.context.theme
const [themeState, setThemeState] = useState<string>(props.teamsTheme || "default");
//Run effect once when the component loads. We will use this effect to register our Theme Changed handler.
useEffect(() => {
console.log("registerOnThemeChangeHandler useEffect fired");
props.context.sdks.microsoftTeams.teamsJs.registerOnThemeChangeHandler((theme: string) => {
console.log(`theme changed to: ${theme}`);
https://login.microsoftonline.com/organizations/v2.0/adminconsent?client_id=31359c7f-bd7e-475c-86db-fdb8c937548e&scope=https://graph.microsoft.com/AppCatalog.ReadWrite.All
const [styleState, setStyleState] = useState<string>(styles.containerdefault);
//Run anytime the themeState changes.
useEffect(() => {
console.log("themeState useEffect fired");
switch (themeState) {
case "dark":
setStyleState(styles.containerdark);
using Microsoft.Bot.Builder;
using Microsoft.Bot.Connector;
using Microsoft.Bot.Connector.Authentication;
using Microsoft.Bot.Schema;
using Microsoft.Bot.Schema.Teams;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Connector;
using Microsoft.Bot.Connector.Authentication;
using Microsoft.Bot.Schema;
using Microsoft.Bot.Schema.Teams;
using System;
using System.Threading.Tasks;
namespace Teams.Bot.Conversations
{
@vman
vman / SendEmailExternalUser.cs
Created April 12, 2017 09:55
Send email using CSOM to authenticated external users in SharePoint Online
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.Utilities;
using System;
using System.Security;
namespace ExternalUsersEmail
{
class Program
{
static void Main(string[] args)

https://graph.microsoft.com/v1.0/sites/your-site-id/lists/Site%20Pages/drive/root:/MySPOModernPage.aspx:?expand=thumbnails&amp;select=thumbnails/large

using Microsoft.Graph;
using Microsoft.Identity.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Threading.Tasks;
namespace Graph.SPO.Thumbnails
{