When I manually create a new contentsource, point it to the single sql database-bcs everything works OK (no probs) (via Central Admin) but...

When i try the same via a powershell script I get "BDC: cannot logon with credentials obtained from secure store provider"

So... i remember vaguely someting about creating the contentsource in PWS, so the thing underneath delivers me the above error, so there is a bug in the PWS script beneath: (although it does create the new contentsource, the bcs source is checked in the gui and it starts the full crawl AND... this works on another server flawlessly...) :

function loadContentSource
    # remove the current contentsource
    $sa = Get-SpEnterpriseSearchServiceApplication
    Remove-SPEnterpriseSearchCrawlContentSource -SearchApplication $sa -Identity $contentsourceName -Confirm:$false
    # create the new contentsource
    $proxyGroup = Get-SPServiceApplicationProxyGroup -default
    New-SPEnterpriseSearchCrawlContentSource -SearchApplication $sa -Name $contentsourceName -Type Business -LOBSystemSet $LobSystems -BDCApplicationProxyGroup $proxyGroup
    # start a full crawl
    $contentsource = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $sa -Identity $contentsourceName

So "visually" the above gives me the same result in Central Admin but apparently there is something under the cover different than doing it manually and im pretty positive it is in the line "New-SPEnterpriseSearchCrawlContentSource" but hmm wait maybe its Get-SPServiceApplicationProxyGroup

  • $LobSystems how this is formed? – Amal Hashim Nov 17 '14 at 16:37
  • $LobSystems = @("ABC", "ABC") { so it DOES place the checkmark in the Central Admin content source BDC settings) – edelwater Nov 17 '14 at 16:37
  • Check ABC is the same for @("LOBSystemName","LOBSystemInstanceName") – Amal Hashim Nov 17 '14 at 16:38
  • When I check the exported bdcm file it shows me ABC for the LobSystemInstanceName and Lobystem type database and name= ABC, so from that i assume this to be correct? – edelwater Nov 17 '14 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.