SharePoint Automation Gary Lapointe – Founding Partner, Aptillon, Inc.

7Jul/112

SharePoint 2010 SP1 Public API Changes

I recently published a post detailing the SharePoint 2010 SP1 PowerShell changes and, in that post, I mentioned that I was probably going to detail the API changes. Well, here they are. Note that the list below is not a comprehensive one in that I’m not showing every assembly (I do have the changes for every assembly but frankly I just got tired of translating the results into a readable format so I kept it to the more prominent assemblies (or at least the ones that I just happened to have done at the time)). In reviewing the list you see that there’s honestly not a whole lot of noteworthy changes, but that’s okay as part of my reasoning for doing this was to discover whether there were any (don’t get me wrong, there are some, in fact, for me there’s 1 very big one that made this whole exercise worth it – I’ll let you figure out which one that is). If you find any I missed please add a comment so that others can see it as well.

  • Microsoft.SharePoint.dll
    • Microsoft.SharePoint.SPRecycleBinItemType
      • New enum value:
        • Web
    • Microsoft.SharePoint.SPWeb
      • New method:
        • public void Recycle()
    • Microsoft.SharePoint.Strings
      • New constants:
        • public const string CannotRecycleRootWeb
        • public const string HealthRule_Explanation_BcsShimsAreEnabled
        • public const string HealthRule_Remedy_BcsShimsAreEnabled
        • public const string RecycleBinWebMissingContainerError
        • public const string SPStorageMetricsProcessingJobDescription
        • public const string SPUsageUserCodeRequestsDescription
        • public const string SPUsageUserCodeRequestsMonitoredDataDescription
        • public const string SiteAlreadyExists
        • public const string StorageMetricsDBObjectsNotFound
        • public const string StorageMetricsFreshnessWarning
        • public const string StorageMetricsNotAvailable
        • public const string TimerJobTitleStorageMetricsProcessing
    • Microsoft.SharePoint.Administration.SPAce<T>
      • New properties:
        • public Byte[] BinaryId() { get; }
        • public Microsoft.SharePoint.Administration.SPIdentifierType BinaryIdType() { get; }
    • Microsoft.SharePoint.Administration.SPAcl<T>
      • New method:
        • public SPAce<T> Add(string principalName, string displayName, SPIdentifierType identifierType, byte[] identifier, T grantRightsMask, T denyRightsMask)
    • Microsoft.SharePoint.Administration.SPContentDatabase
      • New methods:
        • public Microsoft.SharePoint.Administration.SPDeletedSite GetDeletedSite(System.Guid id)
        • public void Move(SPContentDatabase destinationDb, List<SPSite> sitesToMove, Dictionary<string, string> rbsProviderMap, out Dictionary<SPSite, string> failedSites)
    • Microsoft.SharePoint.Administration.SPContentDatabaseCollection
      • New method:
        • public SPContentDatabase Add(string strDatabaseServer, string strDatabaseName, string strDatabaseUsername, string strDatabasePassword, int warningSiteCount, int maximumSiteCount, int status, bool flushChangeLog, bool changeSyncKnowledge)
    • Microsoft.SharePoint.Administration.SPDatabase
      • New method:
        • public void ChangeDatabaseInstance(string databaseServiceInstance)
    • Microsoft.SharePoint.Administration.SPIncomingEmailService
      • New property:
        • public int RetryDeliveryInterval { get; set; }
    • Microsoft.SharePoint.Administration.SPPolicy
      • New method:
        • protected Void OnDeserialization()
    • Microsoft.SharePoint.Administration.SPSiteLookupProvider
      • Changed method (breaking change!)
        • public Void RenameHostHeaderSite(Guid siteId, string newHostHeader) => public Void RenameHostHeaderSite(Guid siteId, Uri newHostHeaderSiteUri)
    • Microsoft.SharePoint.Administration.SPUsageApplication
      • New property:
        • public int UsageInsertionTimeOut { get; set; }
    • Microsoft.SharePoint.Administration.SPUserCodeExecutionTier
      • New property:
        • public int PriorityPerProcess { get; set; }
    • Microsoft.SharePoint.Administration.SPWebApplication
      • New properties:
        • public int StorageMetricsProcessingDuration { get; set; }
        • public uint MaxDiscussionBoardItemsForSiteDataFolderQuery { get; set; }
        • public uint? UserDefinedWorkflowMaximumComplexity { get; set; }
      • New methods:
        • public SPDeletedSiteCollection GetDeletedSites()
        • public SPDeletedSiteCollection GetDeletedSites(SPDeletedSiteQuery query)
        • public SPDeletedSiteCollection GetDeletedSites(Guid siteId)
        • public SPDeletedSiteCollection GetDeletedSites(string sitePath)
        • public void MigrateUsers(IMigrateUserCallback callback)
    • Microsoft.SharePoint.Administration.SPWebService
      • New properties:
        • public int ImagingDownloadSizeLimit { get; set; }
        • public bool EnableHostHeaderSiteBasedSchemeSelection { get; set; }
    • Microsoft.SharePoint.Administration.Claims.SPActiveDirectoryClaimProvider
      • New method:
        • protected override void FillDefaultLocalizedDisplayName(CultureInfo culture, out string localizedName)
    • Microsoft.SharePoint.Administration.Claims.SPAllUserClaimProvider
      • New method:
        • protected override void FillDefaultLocalizedDisplayName(CultureInfo culture, out string localizedName)
    • Microsoft.SharePoint.Administration.Claims.SPClaimHierarchyProvider
      • New methods:
        • protected override void FillDefaultLocalizedDisplayName(CultureInfo culture, out string localizedName)
        • public string GetLocalizedDisplayName()
    • Microsoft.SharePoint.Administration.Claims.SPClaimProvider
      • New property:
        • public virtual bool SupportsUserKey { get; }
      • New methods:
        • protected override void FillDefaultLocalizedDisplayName(CultureInfo culture, out string localizedName)
        • public string GetLocalizedDisplayName()
        • public SPClaim UserKeyForEntity(SPClaim entity)
        • public virtual string GetClaimTypeForUserKey()
        • protected virtual SPClaim GetUserKeyForEntity(SPClaim entity)
    • Microsoft.SharePoint.Administration.Claims.SPClaimProviderDefinition
      • New property:
        • public bool IsVisible { get; set; }
    • Microsoft.SharePoint.Administration.Claims.SPClaimProviderOperationOptions
      • New enum value:
        • OverrideVisibleFlag
    • Microsoft.SharePoint.Administration.Claims.SPFormsClaimProvider
      • New method:
        • protected override void FillDefaultLocalizedDisplayName(CultureInfo culture, out string localizedName)
    • Microsoft.SharePoint.Administration.Claims.SPSystemClaimProvider
      • New method:
        • protected override void FillDefaultLocalizedDisplayName(CultureInfo culture, out string localizedName)
    • Microsoft.SharePoint.BusinessData.Administration.LobSystem
      • New static method:
        • public static LobSystem MergeXml(string xml, out string[] errors, PackageContents packageContents, AdministrationMetadataCatalog metadataCatalog, string settingId)
    • Microsoft.SharePoint.BusinessData.Administration.TypeDescriptor
      • New static method:
        • public static TypeDescriptor MergeXml(string xml, out string[] errors, PackageContents packageContents, Parameter parameter, TypeDescriptor parent, string settingId)
    • Microsoft.SharePoint.BusinessData.SharedService.BdcServiceApplicationProxy
      • New methods:
        • public bool IsSystemTypeEnabled(SystemType systemType)
        • public void EnableSystemType(SystemType systemType, bool value)
    • Microsoft.SharePoint.JSGrid.GridSerializer
      • New method:
        • public void ApplyPostViewIncrementalInsertsAndDeletes(IEnumerable changes, Func> fnGetDefaultValuesForPostViewInserts)
    • Microsoft.SharePoint.JSGrid.HierarchyNode
      • New property:
        • public HierarchyNode Parent { get; set; }
    • Microsoft.SharePoint.Utilities.SPUtility
      • New static method:
        • public static Stream ExecuteCellStorageBinaryRequest(SPFile spfile, Stream request, bool coalesce, ref Guid partitionID, string userName, bool coauthVersioning, string etagMatching, bool fExpectNoFileExists, string contentChangeUnit, string clientFileID, string bypassSchemaID, long nLockType, string lockID, long nTimeout, bool createParentFolder, out string etagReturn, out bool allRequestSucceeded, out int coalesceHRESULT, out string coalesceErrorMessage, out bool containHotboxData, out bool haveOnlyDemotionChanges, ref int binaryReqCountQuota)
    • Microsoft.SharePoint.WebPartPages.ListFormWebPart
      • New method:
        • public bool ShouldSerializeTemplateName()
    • New classes:
      • Microsoft.SharePoint.Administration.SPDeletedSite
      • Microsoft.SharePoint.Administration.SPDeletedSiteCollection
      • Microsoft.SharePoint.Administration.SPDeletedSiteLookupInfo
      • Microsoft.SharePoint.Administration.SPDeletedSiteQuery
      • Microsoft.SharePoint.Administration.SPUsageUserCodeRequests
      • Microsoft.SharePoint.Administration.SPUsageUserCodeRequestsEntry
      • Microsoft.SharePoint.Administration.SPUsageUserCodeRequestsMonitoredData
      • Microsoft.SharePoint.Administration.SPUsageUserCodeRequestsMonitoredDataEntry
      • Microsoft.SharePoint.Administration.Health.SPHealthAnalysisRuleInstance
      • Microsoft.SharePoint.WebControls.IEVersionMetaTag
    • New enum types:
      • Microsoft.SharePoint.Administration.SPIdentifierType
    • New interfaces:
      • Microsoft.SharePoint.Administration.IMigrateUserCallback
      • Microsoft.SharePoint.Administration.ISPSiteLookupProviderRecycleBin
  • Microsoft.SharePoint.Publishing.dll
    • Microsoft.SharePoint.Publishing.Internal.CodeBehind
      • New property:
        • protected bool IsCurrentUserSiteAdmin { get; }
    • Microsoft.SharePoint.Publishing.WebControls.SpellCheckV4Action
      • New method:
        • protected bool ShouldRenderWithoutTabs()
    • Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ConsoleAction
      • New method:
        • protected bool ShouldRenderWithoutTabs()
  • Microsoft.SharePoint.Taxonomy.dll
    • Microsoft.SharePoint.Taxonomy.TermStore
      • New method:
        • public Group GetSiteCollectionGroup(SPSite currentSite)
  • Microsoft.SharePoint.Portal.dll
    • Microsoft.Office.Server.UserProfiles.UserProfileService
      • New methods:
        • public void AddLeader(string accountName)
        • public Leader[] GetLeaders()
        • public void RemoveLeader(string accountName)
  • Microsoft.Office.Server.UserProfiles.dll
    • Microsoft.Office.Server.SocialData.PluggableSocialSecurityTrimmerManager
      • New methods:
        • public static string[] GetUrlFoldersRequiringTrim(SPServiceContext serviceContext)
        • public static string[] GetUrlFoldersToAlwaysAllow(SPServiceContext serviceContext)
        • public static void SetTrimmerSettings(SPServiceContext serviceContext, bool enableTrimming)
        • public static void SetTrimmerSettings(SPServiceContext serviceContext, string[] urlFoldersRequiringTrim, string[] urlFoldersToAlwaysAllow)
    • Microsoft.Office.Server.UserProfiles.BusinessDataCatalogConnection
      • New method:
        • public void Delete()
    • Microsoft.Office.Server.UserProfiles.ConnectionManager
      • New method:
        • public DirectoryServiceConnection AddActiveDirectoryConnection(ConnectionType type, string displayName, string server, bool useSSL, string accountDomain, string accountUsername, SecureString accountPassword, List<DirectoryServiceNamingContext> namingContexts, string spsClaimProviderTypeValue, string spsClaimProviderIdValue, string adClaimIDMapAttribute)
    • Microsoft.Office.Server.UserProfiles.UserProfileManager
      • New methods:
        • public void AddLeader(string accountName)
        • public Leader[] GetLeaders()
        • public void RemoveLeader(string accountName)
    • New classes:
      • Microsoft.Office.Server.UserProfiles.Leader
  • Microsoft.Office.Server.Search.dll
    • Microsoft.Office.Server.Search.Administration.CrawlTopologyState
      • New enum values:
        • ActiveToBeRemoved
        • DeactivatingToBeRemoved
    • Microsoft.Office.Server.Search.Administration.SearchServiceApplication
      • New property:
        • public uint CrawlLogCleanupIntervalInDays { get; set; }
    • Microsoft.Office.Server.Search.Administration.SearchServiceApplicationProxy
      • New property:
        • public LocationConfigurationCollection LocationConfigurations { get; }
    • Microsoft.Office.Server.Search.Query.QueryInfo
      • New property:
        • public string CorrelationId { get; set; }
    • Microsoft.Office.Server.Search.Query.QueryManager
      • New method:
        • public System.Xml.XmlDocument GetResults()
  • Microsoft.SharePoint.PowerShell.dll
    • New classes:
      • Microsoft.SharePoint.PowerShell.SPDeletedSitePipeBind
      • Microsoft.SharePoint.PowerShell.SPHealthAnalysisRuleInstancePipeBind
28Jun/110

SharePoint Server 2010 Service Pack 1 PowerShell Changes

As most people know by now, Service Pack 1 for SharePoint 2010 was released to the public today. There’s already been a lot of hype over some of the new capabilities such as the site recycle bin and some folks have documented/demonstrated some of the new PowerShell cmdlets that are available to manage this new feature; but what about all the other new and changed PowerShell cmdlets – there’s a bunch! So, let’s take a look at what is new, and what has changed.

We’ll start with the new stuff – here’s a quick bulleted list of all the new cmdlets:

  • Add-SPProfileLeader
  • Get-SPProfileLeader
  • Remove-SPProfileLeader
  • Remove-SPProfileSyncConnection
  • Add-SPProfileSyncConnection
  • Disable-SPHealthAnalysisRule
  • Enable-SPHealthAnalysisRule
  • Get-SPHealthAnalysisRule
  • Get-SPDeletedSite
  • Remove-SPDeletedSite
  • Restore-SPDeletedSite
  • Move-SPSocialComments

I haven’t had a chance to try any of these out but I think there’s some cool new functionality here beyond just the site recycle bin. There’s absolutely no documentation for any of these but some of them are fairly straightforward based on the names. For instance, the Add-SPProfileSyncConnection cmdlet (and equivalent Remove cmdlet) are obviously for managing the synchronization connections for UPS. This was a big whole in RTM when it came to doing an end-to-end scripted installation as there was no practical way to add a synchronization connection using PowerShell. The health analysis rule cmdlets are also pretty obvious and, again, this goes a long way towards enabling administrators to script a deployment and enable or disable rules consistently across Farms.

I think the Move-SPSocialComments also has a lot of potential; if it does what I’m guessing it does then this could potentially solve the issue where comments and tags are stored with the absolute URL of the item that has been tagged/commented on – I’m *guessing* that running this command will effectively retarget those items, which is great in situations in which you’ve moved a list or site.

As for the *-SPProfileLeader cmdlets – I have no idea what those guys do so I’ll have to revisit them when I learn more. (The *-SPDeletedSite cmdlets have already been covered quite a bit by others so I’ll forgo any further discussion here).

Alright, so that’s the new stuff – what about the stuff that’s changed? Here’s a quick list with the changes:

  • Mount-SPContentDatabase
    • New Switch Parameter: ChangeSyncKnowledge (I’ve no idea what this does – it’s not yet documented)
  • New-SPContentDatabase
    • New Switch Parameter: ChangeSyncKnowledge (again, not yet documented)
  • Move-SPSite
    • New Parameter: RbsProviderMapping <Hashtable>
      • From TechNet: “Used to move an RBS-enabled site collection from one RBS-enabled content database to another RBS-enabled content database without moving the underlying BLOB content. If the content database has more than one RBS provider associated with it, you must specify all providers. The same providers must be enabled on the target content database and the source content database.”
  • New-SPPerformancePointServiceApplication
    • New Parameter: AnalyticResultCacheMinimumHitCount <Int32> (not yet documented but I think it’s fairly obvious what it does)
    • New Parameters: DatabaseServer <string>, DatabaseName <string>, DatabaseFailoverServer <string>, DatabaseSQLAuthenticationCredential <PSCredential>
      • Can I get a hurray for this! This was the only Service Application that didn’t allow us to set the database information when we created it so we were left with this nasty GUID in the name. Hurray! We can finally get rid of the last database GUID! Woohoo!
  • Set-SPPerformancePointServiceApplication
    • New Parameter: AnalyticResultCacheMinimumHitCount <Int32> (not yet documented but I think it’s fairly obvious what it does)
    • New Parameters: DatabaseServer <string>, DatabaseName <string>, DatabaseFailoverServer <string>, DatabaseSQLAuthenticationCredential <PSCredential>, DatabaseUseWindowsAuthentication
  • Remove-SPWeb
    • New Switch Parameter: Recycle
      • That’s right, you can in fact cause an SPWeb to go to the new recycle bin by simply providing this switch parameter.
  • Update-SPProfilePhotoStore (I think this one is a bit of mess and may need a CU or two but I could just be reading the code wrong – it is kind of late right now)
    • Update 6/29/2011: From Spence Harbar: “Update-SPProfilePhotoStore change is to address common bug/issue with resize and is for upgrade scenarios”
    • New Switch Parameter: CreateThumbnailsForImportedPhotos
      • I’m not entirely sure what this is supposed to do as thumbnails were created previously and will be created without this; however, I should note that they coded this wrong so both of the following syntaxes have the same affect as they are simply checking that the bool? type has a value and not what the value is:
        • -CreateThumbnailsForImportedPhotos $true
        • -CreateThumbnailsForImportedPhotos $false
    • New Switch Parameter: NoDelete
      • I’m not 100% on this but I believe that the original behavior of this cmdlet was to copy the image and not actually move it (despite the name); they appear to have changed the behavior to delete the original images after the copy but you can preserve the original behavior by simply adding this switch parameter. However, this is *only* true when the CreateThumbnailsForImportedPhotos parameter is provided (in my opinion this is a bug – it should be irrelevant if that parameter is provided).

Well, that’s all I’ve been able to discover with the core SharePoint Server 2010 cmdlets – I may update this post to account for the Office Web Applications but I don’t currently have that installed on the server in which I just installed SP1 so it may take me a bit to do that analysis. At some point I may write something up to inspect the public classes and their members and do a similar post for the developers out there who want to know what API changes have occurred so keep an eye out for that.

So I think it’s pretty cool that we’ve got some improvements in the PowerShell cmdlets, especially in some of those that have frustrated me when it comes to automated deployments; the real frustrating thing, however, is that some of my just released book content is already out of date! Ugh! Maybe there’ll be a second edition Smile

Happy PowerShelling!

-Gary