Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3486096
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:59:15+00:00 2026-05-18T10:59:15+00:00

I have a powershell script to iterate through a list of LinkedServer objects in

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:59:16+00:00Added an answer on May 18, 2026 at 10:59 am

    It seems to be in the linked server login properties:

    foreach($linkedServer in $instance.LinkedServers)
    {   
        "LinkedServer:" + $linkedServer.Name
    
        foreach($linkedServerLogin in $linkedServer.LinkedServerLogins)
        {
            " LinkedServerLogin:" + $linkedServerLogin.Name
            foreach($property in $linkedServerLogin.Properties)
            {
                "  Property:" + $property.Name + " - " + $property.Value
            }
        }
    } 
    

    Impersonate and RemoteUser are included in the properties.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a simple powershell script, like this sqlcmd -S. -E -Q 'select ''$(x)'''
I almost have this Powershell script completed but I am stuck at the last
I have a complex Powershell script that gets run as part of a SQL
I have developed a Powershell script that needs to be run automatically daily. This
I have powershell script which sends text message through a sms-gateway. I get the
I have a PowerShell script for building my project files, and I'd like to
I have a powershell script with the following code in it... $appdir = Split-Path
I have a PowerShell script for which I would like to redirect the output
I have this bit of powershell script but i can't get the $DirectoryName to
I have the following tiny PowerShell script that's meant to kill some certain processes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.