Skip to content

Instantly share code, notes, and snippets.

View MaxMelcher's full-sized avatar
🏠
Working from home

Max Melcher MaxMelcher

🏠
Working from home
View GitHub Profile
http://hotfixv4.microsoft.com/Windows 7/Windows Server2008 R2 SP1/sp2/Fix354919/7600/free/425407_intl_x64_zip.exe
using (var ctx = new ClientContext("https://intranet.demo.com/sites/test"))
{
var web = ctx.Web;
var list = web.Lists.GetByTitle("Documents");
ListItemCreationInformation lici = new ListItemCreationInformation
{
UnderlyingObjectType = FileSystemObjectType.Folder,
LeafName = "TEST-CSOM"
};
var item = list.AddItem(lici);
A database error occurred. Source: Microsoft SQL Server Native Client 10.0 Code: 2601 occurred 1 time(s)
Description: Cannot insert duplicate key row in object 'dbo.MSSCrawlChangedSourceDocs' with unique index 'IX_MssCrawlChangedSourceDocs'. The duplicate key value is (434, 1).
@MaxMelcher
MaxMelcher / Program.cs
Last active August 29, 2015 14:10
Redemption new email event
class Program
{
static void Main(string[] args)
{
MailNotifier mailNotifier = new MailNotifier();
mailNotifier.Start();
var t = Task.Factory.StartNew(() =>
{
while (Console.ReadKey().Key != ConsoleKey.Q)
Add-PSSnapin microsoft.sharepoint.powershell -ea 0
$ssa = Get-SPEnterpriseSearchServiceApplication | Where-Object {$_.Name -eq "Search Service Application"}
$id = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $ssa | ? { $_.Name -eq "Local SharePoint Sites"}
$log = New-Object Microsoft.Office.Server.Search.Administration.CrawlLog $ssa
Write-Host "Success:"
$dt = $log.GetCrawledUrls($false, 10000, $null, $false, $id.Id, 0, -1, [System.DateTime]::MinValue, [System.DateTime]::MaxValue)
@MaxMelcher
MaxMelcher / Deploy.bat
Last active December 20, 2015 02:59
SharePoint Solution Deployer with Powershell version 2 but installed is version 3 (SP2010 does not like that)
GOTO LAUNCHSCRIPT
:LAUNCHSCRIPT
"%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe -Version 2 -NoExit" -Command Start-Process "$PSHOME\powershell.exe -Version 2 -NoExit" -Verb RunAs -ArgumentList "'%~dp0\Scripts\SPSD_Main.ps1 -Command %command% -Type %type% -Verbosity %verbosity% %saveEnvXml%'"
ENDLOCAL