Chat now with support
Chat with Support

StoragePoint 6.3 - PowerShell and API Reference Guide

PowerShell Guide
StoragePoint PowerShell Overview Getting Started Profile and Endpoint Management Cmdlets Timer Job Scheduling Cmdlets BLOB Information and Migration Cmdlets Miscellaneous SharePoint Utility Cmdlets PowerShell Script Examples StoragePoint API Reference
About Us

Displaying All BLOB Files Associated with a SharePoint Document

This example displays all BLOB files associated with a given document in SharePoint. This includes versions and drafts/checked out versions, etc.

$blobs = Get-BLOB –doc "http://spsite/documents/123.tif"

ForEach ($b in $blobs) {$b.Endpoint.Name + " : " + $b.FilePath}

Enabling App Management service Application and App Catalog

The following scripts can be used to provision the service and app catalog required for enabling the StoragePoint SPFX Site Collection feature. This feature is required for full StoragePoint functionality in the SharePoint 2019 Modern User Interface.

- Provide and configure App Management service application:

 

$accountName = "<domain\ID>"

$svcAppPoolName = "AppManagementServiceApplicationPool"

$svcAppName = "App Management Service Application"

$dbServer = "<server>"

$dbName = "AppManagement_" +  [System.Guid]::NewGuid()

$svcAppProxyName = "App Management Server Application Proxy"

 

$account = Get-SPManagedAccount $accountName

$appPool = New-SPServiceApplicationPool -Name $svcAppPoolName -Account $account

$svcApp = New-SPAppManagementServiceApplication -Name $svcAppName -DatabaseServer $dbServer -DatabaseName $dbName -ApplicationPool $appPool

New-SPAppManagementServiceApplicationProxy -Name $svcAppProxyName -UseDefaultProxyGroup -ServiceApplication $svcApp

 

- Provide and configure AppCatalog site collection (for specific web application):

 

$appCatalogUrl = '<URL>'

New-SPSite -Url $appCatalogUrl -OwnerAlias "<domain\ID>" -Name "App Catalog" -Template "APPCATALOG#0"

Update-SPAppCatalogConfiguration -Site $appCatalogUrl -Force:$true -SkipWebTemplateChecking:$true    
 

Altering MasterKey Encryption Password on Existing Profiles

The following script can be used to modify or create the master key encryption password that would normally be done if a web app or content database scoped profile was created using the user interface.

 

   param (

       [Parameter(Mandatory=$true)]

       [ValidateNotNullOrEmpty()]

       [string]

       $ContentDatabaseName,

       

       [Parameter(Mandatory=$true)]

       [SecureString]

       [ValidateNotNullOrEmpty()]

       $MasterkeyPassword,

 

       [Parameter(Mandatory=$false)]

       [Switch]

       $Force

   )

   

   Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

   

   try {

       # get SP CDB

       $cdb = Get-SPContentDatabase $ContentDatabaseName

       if ($cdb) {

           #$cdb.Name

           #$cdb.Properties["NeedEncryptionPassword"]

           #$cdb.Properties | Format-List

           if (-not $Force) { # skipping validation

               if (-not $cdb.Properties.Contains("NeedEncryptionPassword")) { # no flag present to regenerate CDB  

                  Write-Warning "'NeedEncryptionPassword' flag was not present to regenerate Content Database. If needed, use -Force switch to force regeneration.`n"

                  exit

               }

               else {

                   if (-not [string]::IsNullOrEmpty($cdb.Properties["NeedEncryptionPassword"]) -and [bool]$cdb.Properties["NeedEncryptionPassword"] -eq $false) {

                       Write-Warning ("Content Database Master Key has been already regenerated. If needed, use -Force switch to force regeneration. Detail: NeedEncryptionPassword={0}`n" -f [bool]$cdb.Properties["NeedEncryptionPassword"])

                       exit

                   }

               }

           }  

           else { # Proceed CDB master key regeneration

               try {

                   $sqlConnection = New-Object System.Data.SqlClient.SqlConnection $cdb.DatabaseConnectionString

                   $sqlConnection.Open()

                   

                   $sqlCommand = $sqlConnection.CreateCommand()

                   $BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($MasterkeyPassword)

                   $unsecurePassword = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)

                   $sqlCommand.CommandText=[string]::Format("ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = '{0}'", $unsecurePassword)

                   $sqlCommand.ExecuteNonQuery() | Out-Null

                   $cdb.Properties.Remove("NeedEncryptionPassword")

                   $cdb.Update();

                   Write-Host ("Master key for content database: {0} has been successfully regenerated.`n" -f $ContentDatabaseName) -ForegroundColor Green

               }

               catch [Exception] {

                   Write-Error ("Unable to regenerate content database master key. Detail: Content database name={0}, Exception={1}" -f $cdb.Name, $Error[0].Exception)

               }

               finally {

                   if ($sqlConnection) {

                       $sqlConnection.Close()

                   }    

               }            

           }

       }

   }

   catch { # unexpected exceptions

       $_.Exception | format-list -force

   }

 

 

StoragePoint API Reference

StoragePoint API Overview

 

StoragePoint exposes APIs for performing actions from custom Microsoft .net framework code. A Profile Creation api (ProfileAPI) is exposed as well as a Blob Migration API (BlobAPI), a Blob Reference API (BlobReferenceAPI), Archive API (ArchiveAPI), Validator API (ValidatorAPI) and Timer Job API (TimerJobAPI). These APIs are callable only from Microsoft .net framework languages (i.e. C#, VB.net) and can only run on a Web Front End server in a SharePoint farm.

 

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating