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 | |
Gets SharePoint ULS logs along with the request URL given a set of criteria. | |
.DESCRIPTION | |
The request URL is not available on every ULS log entry. If you want the request | |
URL, this command can provide it. It basically finds the log entry or entries | |
based on the criteria provided and then looks back up to 2 minutes in the logs | |
for a "Name=" message with the same correlation. If if finds one, it provides | |
that message which contains the request URL. |
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
Get-SPLogEvent -StartTime "2/6/2015" | | |
?{ $_.Message -like "*Bad response from SMTP*" } | | |
ForEach-Object { | |
$_ | |
} |
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
# Parses display name w/ user IDs (e.g., "John Doe [mydomain\jdoe]") to get the domain name | |
# Handles multiple per line if separated by semicolons | |
# Input is the filename that contains the rows of display names with user IDs | |
# Outputs only the domain name (does not output duplicates for the same row) | |
$currentPath=Split-Path ((Get-Variable MyInvocation -Scope 0).Value).MyCommand.Path | |
$filename = Join-Path $currentPath $args[0] | |
foreach ($line in [System.IO.File]::ReadLines($filename)) { | |
$users = $line.ToLower().Split(';') | |
$domains = new-object System.Collections.ArrayList | |
foreach ($user in $users) |
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
Import-Module DocAveModule | |
function CreateCopyPlan($planName, $planDescription, $srcSitesGroupName, $destSitesGroupName, $srcSiteUrl, $destSiteUrl) | |
{ | |
Write-Host "Creating copy plan $($planName)..." | |
$plan = Get-DAContentManagerBlankOnlinePlan | |
$plan.Name = $planName | |
$plan.Description = $planDescription | |
$plan.Action = "Merge" |
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
if ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null){ | |
Add-PSSnapin -Name Microsoft.SharePoint.PowerShell | |
} | |
$url = "http://ccsdev/sites/psc2" | |
$site = New-Object Microsoft.SharePoint.SPSite($url) | |
$web = $site.OpenWeb() | |
try{ | |
$list = $web.GetList("/sites/psc2/WorkflowHistory") |
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 | |
Sets the system fields for a specific list/library item. | |
.DESCRIPTION | |
This will set the system fields (created, created by, modified, modified by) | |
for a specific list/library item. | |
Provide any or all of those system fields as a parameter and they will be set. | |
If no modified date is provided, the item keeps its current modified date. |
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
#Definition of the function that allows to enable a SPO Feature | |
function Enable-SPOFeature | |
{ | |
param ($sSiteColUrl,$sUserName,$sPassword,$sFeatureGuid) | |
try | |
{ | |
#Adding the Client OM Assemblies | |
#TODO - copy assemblies to the folder specified below | |
Add-Type -Path "C:\Temp\Microsoft.SharePoint.Client.dll" | |
Add-Type -Path "C:\Temp\Microsoft.SharePoint.Client.Runtime.dll" |
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
/// <summary> | |
/// Sets the Author Byline for a modern page | |
/// </summary> | |
/// <remarks> | |
/// While there is a _AuthorByline field on the page list item and an AuthorBylineId and AuthorByline properties on the ClientSidePage, | |
/// these currently cannot be used to set the author byline. For that we have to use LayoutWebpartsContent on the list item. | |
/// </remarks> | |
/// <param name="context"></param> | |
/// <param name="page"></param> | |
/// <param name="userName"></param> |