Easy SharePoint 2010 warmup Script using PowerShell

This idea comes from Kirk Hofer’s blog, but modfied to use the SharePoint 2010 powershell commandlets and not care about specifying credentials in the script. I figured most people would just keep using the credentials specified in their scheduled task.

The script loads the SharePoint plugin, enumerates the zones, and sends a request to each one.

[powershell]Add-PSSnapin Microsoft.SharePoint.PowerShell;

function Get-WebPage([string]$url) { $wc = new-object net.webclient; $wc.credentials = [System.Net.CredentialCache]::DefaultCredentials; $pageContents = $wc.DownloadString($url); $wc.Dispose(); return $pageContents; }

Get-SPAlternateUrl -Zone Default | foreach-object { write-host $.IncomingUrl; $html = Get-WebPage -url $.IncomingUrl; }[/powershell]

Read More >

SharePoint 2010 Custom Action IDs for Site Settings page

Since the MSDN documentation for Default Custom Action Loacations and IDs is unreliable (they look to have copy+pasted the information from the SharePoint 2007 documentation), our only sure bet is to browse the file system and find the custom action IDs and groups ourselves.

I had need of this information today, and found the items from the site settings page located at: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\SiteSettings\SiteSettings.xml

For those looking specifically for it, here is the custom action for “Delete this site”:

[xml] <CustomAction Id="DeleteWeb" GroupId="SiteTasks" Location="Microsoft.SharePoint.SiteSettings" Rights="ManageWeb,BrowseUserInfo" Sequence="40" Title="$Resources:core,SiteSettings_DeleteWeb_Title;" Description="$Resources:core,SiteSettings_DeleteThisSite_Tooltip;"> <UrlAction Url="_layouts/deleteweb.aspx" /> </CustomAction> [/xml]

If you’re looking for that custom action, you’re probably wanting to hide it. Here’s the xml you’ll need in your elements file:

[xml] <HideCustomAction Id="HideDeleteWeb" GroupId="SiteTasks" HideActionId="DeleteWeb" Location="Microsoft.SharePoint.SiteSettings"> </HideCustomAction> [/xml]

Read More >

subscribe via RSS