Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sanjaybhagia on github.
  • I am sanjaybhagia (https://keybase.io/sanjaybhagia) on keybase.
  • I have a public key whose fingerprint is 8CAE 4328 6E36 0215 908C 0474 EBF2 9696 567B A50C

To claim this, I am signing this object:

@sanjaybhagia
sanjaybhagia / boxstarter.ps1
Last active February 12, 2020 02:21 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
Verifying that "sanjaybhagia.id" is my Blockstack ID. https://onename.com/sanjaybhagia
@sanjaybhagia
sanjaybhagia / searchpersonalsiteproperty.cs
Last active August 29, 2015 14:13
Search Personal Space Property
///This method assumes that you are passing in the url of personal site and managed property called PersonalSite
///is already created with mapping to PersonalSpace property defined and full crawl has been run.
public static string GetPersonalSiteOwner(string url)
{
string ownerAccount = String.Empty;
using (SPSite site = new SPSite(url))
{
using (SPWeb web = site.OpenWeb())
{
//Code to check if the site is actually the personal site
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
#Clears up the site columns for the management system
function CleanUpSiteColumns($siteColl, $group){
$siteColumns = $siteColl.RootWeb.Fields | Where-Object{$_.Group -eq $group}
foreach($siteColumn in $siteColumns)
{
$noteFieldId = $null