This file contains 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
var context = SP.ClientContext.get_current() | |
var web = context.get_web() | |
var rs = web.get_regionalSettings() | |
var tz = web.get_regionalSettings().get_timeZone() | |
var tzs = web.get_regionalSettings().get_timeZones() | |
context.load(web) | |
context.load(rs) | |
context.load(tz) | |
context.load(tzs) | |
context.executeQueryAsync( |
This file contains 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
net use z: \\<account name>.file.core.windows.net\<share name> /u:<account name> <account key> |
This file contains 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
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext(SITE) | |
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username,$password ) | |
$web = $ctx.Web | |
$ctx.Load($web) | |
$list = $web.GetList(LISTURL) | |
$ctx.Load($list) | |
$ctx.ExecuteQuery() | |
# Fiddle a bit with $batch and $c (could be done better, but it worked for my needs right now) |
This file contains 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
var context = SP.ClientContext.get_current() | |
var web = context.get_web() | |
var props = web.get_allProperties() | |
context.load(web) | |
context.load(props) | |
context.executeQueryAsync( | |
function () { | |
var t = "Properties\n" | |
for (var z in props.get_fieldValues()) { |
This file contains 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
$.getScript(_spPageContextInfo.webServerRelativeUrl + "/_layouts/15/" + "SP.Taxonomy.js", function () { | |
var context = SP.ClientContext.get_current() | |
var session = SP.Taxonomy.TaxonomySession.getTaxonomySession(context); | |
var term = session.getTerm('beeda2c0-d3d1-4ceb-90f8-99c74ad86659'); | |
context.load(session); | |
context.load(term); | |
context.executeQueryAsync( | |
function () { | |
var t = "Name: " + term.get_name() + "\n" |
This file contains 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
# For more information see: http://www.wictorwilen.se/sharepoint-online-app-only-policy-powershell-tasks-with-acs | |
$clientId = "<INSERT YOUR CLIENT ID HERE>" | |
$secret = "<INSERT YOUR CLIENT SECRET HERE>"; | |
$redirecturi = "<INSERT YOUR REDIRECT URI HERE>" | |
$url = "https://<TENANT>.sharepoint.com/sites/contoso/" | |
$domain = "<TENANT>.sharepoint.com" | |
$identifier = "00000003-0000-0ff1-ce00-000000000000" |
This file contains 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
<script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.1.js"></script> | |
<script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/knockout/knockout-3.1.0.js"></script> | |
<script type="text/javascript" src="../Scripts/MyInterestingDocuments.js"></script> | |
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.3/moment.min.js"></script> | |
<script type="text/javascript"> | |
Type.registerNamespace('Wictor.OfficeGraph.JS') | |
Wictor.OfficeGraph.Document = function (id, title) { | |
var self = this |
This file contains 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
string resourceId = "<resource id>"; | |
// Can be: | |
// For SharePoint (CSOM), tenant Url: https://tenant.sharepoint.com | |
// For Azure AD Graph: https://graph.windows.net | |
// For Office 365 Discovery: https://api.office.com/discovery/ | |
// For Exchange Online: https://outlook.office365.com/ | |
string secret = "<App client secret>"; // a generated guid | |
Uri redirectUri = new Uri("<App redirect Uri>"); // for instance app://my-app |
This file contains 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
var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext); | |
List<OfficeGraphResult> graphResult = new List<OfficeGraphResult>(); | |
using (var clientContext = spContext.CreateUserClientContextForSPHost()) | |
{ | |
if (clientContext != null) | |
{ | |
var keywordQuery = new KeywordQuery(clientContext) | |
{ | |
QueryText ="*", | |
RowLimit = 10 |