Skip to content

Instantly share code, notes, and snippets.

View JarbasHorst's full-sized avatar
💭
🤓

Jarbas Horst JarbasHorst

💭
🤓
View GitHub Profile
POST https://graph.microsoft.com/v1.0/drives/b!1rb-l2xV0U-BXUVgPwk_h0WBC2T3OlEKiZTJckrsAI1rVdZfDyHPRJNTNbHjK0h0/items/01OKV5SNFMIV3IEGX7BVG25IOR7EN7BDGX/checkin
Content-Type: application/json
{
"checkInAs": "published",
"comment": "First publication."
}
POST https://graph.microsoft.com/v1.0/drives/b!1rb-l2xV0U-BXUVgPwk_h0WBC2T3OlEKiZTJckrsAI1rVdZfDyHPRJNTNbHjK0h0/items/01OKV5SNFMIV3IEGX7BVG25IOR7EN7BDGX/checkout
Content-Type: application/json
PUT https://graph.microsoft.com/v1.0/drives/b!1rb-l2xV0U-BXUVgPwk_h0WBC2T3OlEKiZTJckrsAI1rVdZfDyHPRJNTNbHjK0h0/items/root:/announcement-uploaded-programmatically.aspx:/content
Content-Type: text/plain
<%@ Page language="C#" Inherits="Microsoft.SharePoint.WebControls.ClientSidePage, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %><%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><head>
<!--[if gte mso 9]><SharePoint:CTFieldRefs runat=server Prefix="mso:" FieldList="FileLeafRef,ClientSideApplicationId,PageLayoutType,CanvasContent1,BannerImageUrl,BannerImageOffset,PromotedState,FirstPublishedDate,LayoutWebpartsContent,_TopicHeader,_SPSitePageFlags,_SPAssetFolderId,_SPCallToAction,_SPTranslatedLanguages,_SPTranslationLanguage,
GET https://graph.microsoft.com/v1.0/drives/b!1rb-l2xV0U-BXUVgPwk_h0WBC2T3OlEKiZTJckrsAI1rVdZfDyHPRJNTNbHjK0h0/items/01OPV3SNV3WQCGUS7BTFHZ5IVPMEGOLLRL/content
<%@ Page language="C#" Inherits="Microsoft.SharePoint.WebControls.ClientSidePage, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %><%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><head>
<!--[if gte mso 9]><SharePoint:CTFieldRefs runat=server Prefix="mso:" FieldList="FileLeafRef,ClientSideApplicationId,PageLayoutType,CanvasContent1,BannerImageUrl,BannerImageOffset,PromotedState,FirstPublishedDate,LayoutWebpartsContent,_TopicHeader,_SPSitePageFlags,_SPAssetFolderId,_SPCallToAction,_SPTranslatedLanguages,_SPTranslationLanguage,_SPTranslationSourceItemId,_SPIsTranslation,_SPAnnouncementMessage,_SPAnnouncementExpirationDate,_SPAnnouncementDismissable,_SPAnnouncementIcon,_ScheduledVersion,_PublishStartDate,_SPHiddenHighlightsMet
@JarbasHorst
JarbasHorst / GraphGetUserByIdentifier.cs
Created February 24, 2020 07:18
Get Office 365 using Microsoft Graph
User user = null;
try
{
user = await graphClient.Users[input].Request().GetAsync();
}
catch (ServiceException ex)
{
if (ex.StatusCode == HttpStatusCode.NotFound)
Console.WriteLine($"The user specified '{input}' is not a valid Office 365 user. Error message: {ex}");
else
function ProvisionDocumentAsTeamTab {
param
(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$ClientId,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$SourceTeamId,
PS C:\Windows\system32> Add-SPOSiteDesign -Title "Teamify group" -WebTemplate 64
-SiteScripts $siteScript.Id -Description "Teamify group using Flow" -IsDefault
Id : edcfcdf8-201b-4367-8bb4-c59d68a3924b
Title : Teamify group
WebTemplate : 64
SiteScriptIds : {caac7937-7209-4eb9-bded-8c402edfa3fa}
Description : Teamify group using Flow
PreviewImageUrl :
PreviewImageAltText :
PS C:\Windows\system32> Connect-SPOService -Url https://example-admin.sharepoint.com
PS C:\Windows\system32> $script = Get-Clipboard -Raw
PS C:\Windows\system32> $siteScript = Add-SPOSiteScript -Title "Teamify using flow" -Description "Flow connection to mig
rate group to team" -Content $script
PS C:\Windows\system32> $siteScript
Id : caac7937-7209-4eb9-bded-8c402edfa3fa
Title : Teamify using flow
Description : Flow connection to migrate group to team
{
"type": "object",
"properties": {
"webUrl": {
"type": "string"
},
"parameters": {
"type": "object",
"properties": {
"event": {