Is there a way that you get information from an external list (created from SPD for a specific ECT) differently than you do from a "normal" SharePoint list when using PowerShell?
I did the following:
- created a custom List "ListTest" with a few text columns (eID, c1, and c2).
- created an ECT in SharePoint Designer to a SQL Server table with the same column names
- created an external list "ExtListTest" from this ECT (created the list from SPD too).
I set full access to the ECT to the farm account I am running the PowerShell ISE as (spdev/spfarm), and while troubleshooting added access to All Authenticated Users and NT AUTHORITY\Authenticated Users too.
I then issued the following PowerShell commands:
$web = get-spweb http://<sitename>
$list = $web.Lists["ListTest"]
$elist = $web.Lists["ExtListTest"]
$listitem = $list.GetItemById(1)
$listitem["eID"]
everything works as expected with the "normal" list up to here.
Then I enter:
$elist.GetItemById(1)
And I get the following error:
Exception calling "GetItemById" with "1" argument(s): "Attempted to perform an unauthorized operation."
At line:1 char:19
+ $elist.GetItemById <<<< (1)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
So something is different. I am doing something wrong or there is an extra step or permissions needed to access an external list via PowerShell.
==
Information on my configuration. I have a single server farm on Windows 2008 R2, with SP2010 and SQL Server 2008 R2 on the same machine. It is a member of a domain (SPDEV) and I am logged into the server as SPDEV\SPFARM (the farm account) and running PowerShell ISE (right-click run as administrator) on the same server. Update on configuration info I configured the External Content type to use Passthrough Authentication to the SQL Server database. I am using the same account (SPDEV\SPFARM).
Update 11/12/2011 I found the following error in my SharePoint logs that seems to give another clue:
External List: User passes list permissions check, but an unsupported authentication configuration was identified. Operation disallowed.