How to clear all objects in SOSS store?

Please provide sample code or power shell command to clear all objects in SOSS store(both in default and named cache regions). I was using Clear-Store PS command but its throwing exception.
Refer attachment for error./storage/temp/56-capture.png


Using the 'SOSS Powershell Administration' shortcut or by importing the 'SossAdministration' PowerShell module directly into PowerShell, you can use the PowerShell cmdlet 'Clear-AllObjects' to clear all objects from the ScaleOut StateServer store.

You can also clear all objects from the store by using the soss.exe command line utility to execute the command, "soss.exe clear", or alternatively the SOSS Console by selecting the 'Store' drop-down menu and clicking the "Clear Store" option.


Staff member
Hi Satish,

You can use an instance of a NamedCache object in a Powershell script--call the Remove(key) method to delete a specific object. For example:

# Sample script: Remove-Scaleout-Object.ps1

    [String] $Namespace,
    [String] $Key

# Load ScaleOut library (version will also work if PS runs under an older .NET runtime):
Add-Type -AssemblyName "soss_namedcache, Version=, Culture=neutral, PublicKeyToken=a1ec0b86f746a476"

$nc = [Soss.Client.CacheFactory]::GetCache($Namespace)
Then invoke the script with the two arguments (the object's namespace and key):
.\Remove-Scaleout-Object.ps1 -Namespace "Customers" -Key "Customer 1234"