Although I have added the SharePoint snapin, "Add-PsSnapin Microsoft.SharePoint.PowerShell", I still get errors when delete SPSecurityStoreService as below descripted.

BCS: Message: The term 'Remove–SPSecureStoreApplication' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Code section is as below:

$targetApplicationName = 'HRSST'   
$serviceContextUrl = "http://mingle.cnblogs.com:8080" #SharePoint server admin center
$ssApp = Get-SPSecureStoreApplication –ServiceContext $defaultServiceContext –Name $targetApplicationName
Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue 
[System.Threading.Thread]::Sleep(10000)
if ($ssApp -ne $null) 
{ 
     Remove–SPSecureStoreApplication -Identity $ssApp -Confirm:$false
 } 
link|improve this question
The code snippit looks invalid, eg you are missing the $defaultServiceContext definition and are including the snapin after referencing Get-SPSecureStoreApplication. Have you tired running as Administrator? – Daniel Butler Dec 15 '11 at 4:33
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.