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
#!/bin/bash | |
AZURE_STORAGE_ACCOUNT="" | |
AZURE_STORAGE_ACCESS_KEY="" | |
while getopts "a:k:" opt; do | |
case $opt in | |
a) | |
AZURE_STORAGE_ACCOUNT="${OPTARG}" | |
;; |
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
$csvFiles = Get-ChildItem $PSScriptRoot -Include *.csv -Recurse | |
$fileCount = $csvFiles.Count | |
Write-Host "Processing files: ($fileCount)" | |
foreach ($csv in $csvFiles) { | |
Write-Host "Processing $($csv.BaseName)..." | |
} | |
$outputfilename = read-host "Please enter the output file name" |
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
#create the solution | |
dotnet new sln -n CandidateManager | |
#create the Console project | |
dotnet new console --name CandidatesConsole --output CandidatesConsole | |
#create the web project | |
dotnet new webapi --name CandidatesWeb --output CandidatesWeb | |
# These are the templates available from ASP.NET JavaScript Services https://github.com/aspnet/JavaScriptServices |
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
$Username ="azure_*********@azure.com" | |
$Password = ConvertTo-SecureString "********" -AsPlainText -Force | |
$credential = New-Object System.Management.Automation.PSCredential $Username, $Password | |
$SMTPServer = "smtp.sendgrid.net" | |
$EmailFrom = "[email protected]" | |
$EmailTo = "[email protected]" | |
$Subject = "SendGrid test" | |
$Body = "SendGrid testing successful" | |
Send-MailMessage -smtpServer $SMTPServer -Credential $credential -Usessl -Port 587 -from $EmailFrom -to $EmailTo -subject $Subject -Body $Body |
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
public static partial class WebExtensions | |
{ | |
public static void SplitPascalCasedViewNames(this Web web) | |
{ | |
ListCollection projectLists = web.Lists; | |
web.Context.Load(projectLists); | |
web.Context.ExecuteQuery(); | |
foreach (List list in projectLists) | |
{ | |
ViewCollection listViews = list.Views; |
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
public static string ToCsv<T>(string separator, IEnumerable<T> objectlist) | |
{ | |
Type t = typeof(T); | |
FieldInfo[] fields = t.GetFields(); | |
string header = String.Join(separator, fields.Select(f => f.Name).ToArray()); | |
StringBuilder csvdata = new StringBuilder(); | |
csvdata.AppendLine(header); |
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
. .\TopOfScript_PSCSOM.ps1 | |
function listEventReceivers([Microsoft.SharePoint.Client.ClientContext]$context, [string]$listName) | |
{ | |
Write-Host "Attempting to iterate event receivers on list '$listName'" | |
$list = $context.Web.Lists.GetByTitle($listName); | |
$context.Load($list) | |
$eventReceivers = $list.EventReceivers | |
$context.Load($eventReceivers) |
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
<# | |
.SYNOPSIS | |
Adds a Google Analytics script to all /teams/* site collections in an Office | |
365 Tenant. | |
.DESCRIPTION | |
When using Office 365 "/teams/*" managed path site collections as an extranet, some | |
clients would like to track their traffic using Google Analytics. This is a | |
simple script that adds the Google Analytics script to a UserCustomAction | |
using the http://github.com/officedev.pnp PowerShell cmdlet's to manage SharePoint |
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
<html> | |
<head> | |
<title>Logout</title> | |
</head> | |
<!-- See http://blog.credera.com/technology-insights/microsoft-solutions/how-to-sign-in-as-a-different-user-in-sharepoint-2013/ for original script--> | |
<body> | |
<a href="javascript: | |
(function() | |
{ | |
if (typeof SP !== 'undefined') |
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
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction "SilentlyContinue" | |
cls | |
Set-Alias -Name stsadm -Value $env:CommonProgramFiles”\Microsoft Shared\Web Server Extensions\15\BIN\STSADM.EXE” | |
function RemoveOrphanedSites([string]$WebAppUrl, [switch]$ReportOnly) | |
{ | |
$configDB = Get-SPDatabase | where {$_.typename -eq "Configuration Database"} | |
$contentDBs = Get-SPWebApplication -IncludeCentralAdministration | Get-SPContentDatabase | |
foreach($contentDB in $contentDBs) |