SharePoint 2010 Service Application Groups

IMHO, Microsoft obviously rushed the release of SharePoint 2010 and there are quite a few unfinished areas at the very least in the UI.

Try to create more than one custom Service Application Group in Central admin for example. You just cant do it, as far as I can see.

The good news is, powershell SharePoint CmdLets allow you to fill this gap. I crafted this in a bit of a hurry, but it does the job.

$PSSnapin = Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
 
 
$AppProxyGroupFriendlyName = "New Custom Proxy group"
$ProxyDisplayNamesToAddToGroup = @(
                    "State Service Application Proxy",
                    "MyApp Taxonomy",
                    "Secure Store Service Proxy",
                    "Web Analytics Service Application",
                    "Application Discovery and Load Balancer Service Application Proxy_aa187b7a-cc28-448a-b232-4c9f0713d0bb",
                    "WSS Usage Application"
                    )
 
# Grab our new ApplicationProxyGroup
#
$appProxyGroup = get-SPServiceApplicationProxyGroup | where-object {$_.FriendlyName -eq $AppProxyGroupFriendlyName}
 
if(-not $appProxyGroup) {
    write-host "Creating" $AppProxyGroupFriendlyName
    New-SPServiceApplicationProxyGroup -Name $AppProxyGroupFriendlyName
}
 
 
 
# Get each of the application proxies to be used by this group
#
$ProxyDisplayNamesToAddToGroup | % {
    $thisProxy = $_
    $appProxy = Get-SPServiceApplicationProxy | where-object {$_.DisplayName -eq $thisProxy}
 
    if($appProxyGroup.Contains($appProxy)) {
        # Already present
        write-host $thisProxy "already present"
    }
    else {
        write-host "Adding" $thisProxy
        $appProxyGroup.Add($appProxy)
    }
}
 
# Show the proxies in the new group
#
$appProxyGroup = Get-SPServiceApplicationProxyGroup -Identity $AppProxyGroupFriendlyName
$appProxyGroup.DefaultProxies | Format-list -Property DisplayName

SP 2003 – Managed paths

SharePoint 2003: How to exclude paths to run ASP.NET applications
Running an ASP.NET application on a server with a SharePoint instance requires excluding the virtual paths the application needs, as the SharePoint ISAPI filter will intercept all requests. This post assumes you have SharePoint installed as a Default Web Site.

1. From the Administration Tools, click on SharePoint Central Administration.

2. Click on SharePoint Portal Server in the left menu.

3. Click on Configure virtual server settings from the Virtual Server List page.

4. Click on Default Web Site.

5. Click on Define managed paths.

6. Enter a path, check Exclude Path, and click OK.

DataFormWebPart simple example – without GUIDs

<WebPartPages:DataFormWebPart
  runat="server"
  DataSourceID="test1"
  IsIncluded="True"
  AsyncRefresh="True"
  FrameType="None"
  NoDefaultStyle="TRUE"
  ViewFlag="8"
  Title="Contacts"
  PageType="PAGE_NORMALVIEW"
  __markuptype="vsattributemarkup"
  partorder="2"
  __WebPartId="{F282332F-8BEF-4B6B-8A46-7C1E00177C4E}"
  id="g_f282332f_8bef_4b6b_8a46_7c1e00177c4e">
 
 <DataSources>
 
  <SharePoint:SPDataSource
   DataSourceMode="List"
   ID="test1"
   UseInternalName="true"
   SelectCommand="<View />"
   runat="server" >
 
<SelectParameters>
<WebPartPages:dataformparameter Name="ListName" ParameterKey="ListName" PropertyName="ParameterValues" DefaultValue="Contacts" />
<WebPartPages:dataformparameter Name="WebURL" ParameterKey="WebURL" PropertyName="ParameterValues" DefaultValue="{sitecollectionroot}" />
</SelectParameters>
 
  </SharePoint:SPDataSource>
 </DataSources>
 
<datafields>@ID,ID;@ContentType,Content Type;@Title,Last Name; SNIPPED HERE
</datafields>
 
 
  <xsl>
      <xsl:stylesheet
        xmlns:x="http://www.w3.org/2001/XMLSchema"
        xmlns:d="http://schemas.microsoft.com/sharepoint/dsp"
        version="1.0"
        exclude-result-prefixes="xsl msxsl ddwrt"
        xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
        xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
        xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxsl="urn:schemas-microsoft-com:xslt"
        xmlns:SharePoint="Microsoft.SharePoint.WebControls"
        xmlns:ddwrt2="urn:frontpage:internal"
        xmlns:o="urn:schemas-microsoft-com:office:office"> 
 
          <xsl:include href="/_layouts/xsl/main.xsl"/> 
          <xsl:include href="/_layouts/xsl/internal.xsl"/>
          <xsl:output method="xml" />
 
          <xsl:template match="/"
            xmlns:x="http://www.w3.org/2001/XMLSchema"
            xmlns:d="http://schemas.microsoft.com/sharepoint/dsp"
            xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
            xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
            xmlns:SharePoint="Microsoft.SharePoint.WebControls"
            xmlns:o="urn:schemas-microsoft-com:office:office">
              <ul class="list-arrow">
                <xsl:apply-templates select="/dsQueryResponse/Rows/Row"></xsl:apply-templates>
              </ul>
          </xsl:template>
 
          <xsl:template match="/dsQueryResponse/Rows/Row">
            <li>
              <a href="{@Title}">
                <xsl:value-of select="@Title"/>
              </a>
            </li>    
          </xsl:template>
 
      </xsl:stylesheet>
    </xsl>
 
</WebPartPages:DataFormWebPart>

SPDatasource

Stolen from Chris O’Brien
His blog

<SPWebControls:SPDataSource
	runat="server"
	ID="dsPersonTitles"
	DataSourceMode="List"
	SelectCommand="<Query><OrderBy><FieldRef Name='SortOrder' Ascending='true' /></OrderBy></Query>"
	<SelectParameters>
		<asp:Parameter Name="WebUrl" DefaultValue="/configuration/" />
		<asp:Parameter Name="ListName" DefaultValue="PersonTitles" />
	</SelectParameters>
</SPWebControls:SPDataSource>
 
<asp:DropDownList
	runat="server"
	ID="ddlPersonTitles"
	CssClass="title"
	DataSourceID="dsPersonTitles"
	DataTextField="Title"
	DataValueField="ID">
</asp:DropDownList>

Script a backup of selected datasources Microsoft DPM 2010

Can be hard to work out this one, here is what worked for us.  Our requirement was to back up a selection of datasources from varying protection groups on a daily cycle.  The script below works the way we want, it is modified from a snipet we found ont there on google.

#####################################################################
# Any script which includes the next two lines can run DPM Scripts
# probably need to be running elevated though ...
add-pssnapin -name Microsoft.DataProtectionManager.PowerShell -ErrorAction SilentlyContinue
$Error.Clear()
 
# For try catch logic to work the way I expect
$errorActionPreference = 'Stop'
 
#####################################################################
 
#
# Variables you need to review
#
#####################################################################
# 
# The Dpm server we want to work with
#
$DpmServer="DPM2010.DOMAIN.COM" # enter here the name of your DPM server
$storage="Disk" # choose from Disk or Tape
$protectionType="LongTerm" # choose from LongTerm or ShortTerm
#
#
#
#####################################################################
 
function DoTheBackups([string] $dpmServer, [string] $pg, [string] $computerName,[string] $ds)
{
   $mypg = get-protectiongroup -dpmservername $dpmServer | where {$_.FriendlyName -ieq $pg}
 
   $myds = get-datasource -protectiongroup $mypg |
where {$_.Name -ieq $ds -and $_.ProductionServerName -ieq $computerName }
 
   if($myds) {
 
     write-host "`n`n" "Create recovery point for '$ds' on '$computername' to '$storage'"
 
     if ($storage -ieq "Tape") {
       try {
         $myjob = new-recoverypoint -datasource $myds -Tape -ProtectionType $protectionType
       }
       catch {
         write-host "`t" $_.Exception.Message
       }
   }
   else {
     try {
       $myjob = new-recoverypoint -datasource $myds -Disk -DiskRecoveryPointOption WithSynchronize
     }
     catch {
       write-host "`t" $_.Exception.Message
     }
   }
 
   if ($myJob) {
     $jobtype = $myjob.jobtype 
     write-host "`t`t" "Starting the process of $jobtype for tape backup"
 
     while (! $myjob.hascompleted ) 
     {
       write-host "`t`t`t" $myjob.Status
       start-sleep 5
     }
 
     if($myjob.Status -ne "Succeeded") 
     { 
       write-error "`t`t" "Job Failed" $pg $ds 
     }
     Else {
       Write-host "`t`t" "Job Succeeded" $pg $ds 
     }
  }
  else {
   write-host "Error creating new recovery point for '$ds' on '$computerName'"
  }
}
else {
   write-host "Data source '$ds' on protectiongroup '$pg' not found or not appropriate"
}
 
}
 
#
# Define what we want this script to do
#
#####################################################################
function main()
{
connect-dpmserver $DpmServer | out-null
#
# Add lines here for each datasource you want to backup
#
DoTheBackups -dpmserver $DpmServer -pg "PG-Desktops" -computerName "Parsley.domain.com" -ds "User data"
DoTheBackups -dpmserver $DpmServer -pg "Protection Group 2 - XPTESTPC1" -computerName "XPTESTPC1.domain.com" -ds "C:\"
 
disconnect-dpmserver $DpmServer | out-null
}
#####################################################################
 
#
# Run the main script
#
#####################################################################
main
#####################################################################