This file contains hidden or 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
Function GetTaxonomyTerm($spsite, $field, $label) | |
{ | |
Write-Host "Getting term for $($label)..." | |
$taxonomySession = Get-SPTaxonomySession -Site $spsite | |
$taxonomyField = $spsite.RootWeb.Fields.GetField($field) | |
$termStoreID = $taxonomyField.SspId | |
$termStore = $taxonomySession.TermStores[$termStoreID] | |
$termsetID = $taxonomyField.TermSetId |
This file contains hidden or 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 SPWeb and Our List we are targeting. | |
$web = Get-SPWeb "http://spweburl" | |
$list = $web.Lists["List Name"] | |
#Build Query | |
$spQuery = New-Object Microsoft.SharePoint.SPQuery | |
#CAML Query Using a DateTime Value and and Offset of Today | |
$query = '<Where><Geq><FieldRef Name="Last_x0020_Modified" /><Value Type="DateTime"><Today OffsetDays="-1" /></Value></Geq></Where>' | |
$spQuery.ViewAttributes = "Scope = 'Recursive'" | |
$spQuery.Query = $query |
This file contains hidden or 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
$w = Get-SPWeb http://spweburlhere | |
$l = $w.Lists["List Name Here"] | |
$c = $l.Items | |
$c | % {$l.GetItemById($_.ID).Delete()} |
This file contains hidden or 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
$url = “http://spweburl” | |
$spweb= Get-SPWeb $url | |
$templates= $site.GetAvailableWebTemplates($spweb.RegionalSettings.LocaleId) | |
$templates | Select Name, Title | Sort Title | Format-Table | |
$spweb.Dispose() |
This file contains hidden or 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
cls | |
$error.Clear() | |
################################################################################################## | |
# Load SharePoint Snapin | |
################################################################################################## | |
$snap = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'} | |
if ($snap -eq $null) { | |
Write-Host "Loading Powershell Snapin..." -ForegroundColor Yellow | |
Add-PSSnapin Microsoft.SharePoint.Powershell |
This file contains hidden or 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
#Enter web url | |
$web = Get-SPWeb "http://sharepointsite.com/" | |
#Enter Name of the list | |
$list = $web.Lists["Documents"] | |
$list.Fields | Select Title, InternalName | sort InternalName | out-file C:\internalfields.txt |
This file contains hidden or 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
cls | |
$error.Clear() | |
################################################################################################## | |
# Load SharePoint Snapin | |
################################################################################################## | |
$snap = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'} | |
if ($snap -eq $null) { | |
Write-Host "Loading Powershell Snapin..." -ForegroundColor Yellow | |
Add-PSSnapin Microsoft.SharePoint.Powershell |
This file contains hidden or 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
cls | |
$error.Clear() | |
################################################################################################## | |
# Load SharePoint Snapin | |
################################################################################################## | |
$snap = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'} | |
if ($snap -eq $null) { | |
Write-Host "Loading Powershell Snapin..." -ForegroundColor Yellow | |
Add-PSSnapin Microsoft.SharePoint.Powershell |
This file contains hidden or 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
$xmlpath = "C:\PowershellConfig\Config.xml" | |
[xml]$userfile = Get-Content $xmlpath | |
$sitecollection = $userfile.Root.SiteCollection.URL | |
$path = $userfile.Root.DefaultPath |
NewerOlder