I have a powershell script to iterate through a list of LinkedServer objects in a SQL Server with some code like this:
foreach($linkedServer in $instance.LinkedServers)
{
... some code ...
}
I want to find out information on the default security of a linked server. To see what I mean, load SQL Server Management Studio and open a linked server. If you don’t have any, just create one to a remote server. Click on the Security tab and you will see a list of linked server login mappings (LinkedServerLogins collection in SMO). At the bottom of the screen will be a default setting in the section called “For a login not defined in the list above…”. I cannot find anywhere in the SMO object model to get to this information. Is it possible?
Thanks,
Mark.
It seems to be in the linked server login properties:
ImpersonateandRemoteUserare included in the properties.