January 25, 2017 at 9:36 am
Comments posted to this topic are about the item Powershell Script to find a SQL\Windows login in SQL Server
Vishnu Gupthan
PowershellAcademy
www.powershellacademy.com
January 26, 2017 at 6:30 am
Well, this probably works.
But if you have SSMS 2016 (16.3+) installed you can just use the Get-SqlLogin cmdlet.
Download here today! sqlps.io/dl
foreach ($RegisteredSQLs IN dir -recurse 'SQLSERVER:\SQLRegistration\Database Engine Server Group\' |
WHERE {$_.Mode -ne 'd'} )
{
Get-SqlLogin -ServerInstance $RegisteredSQLs.Name -LoginName BobbyTables
}
Granted, if the login doesn't exist you'll need to wrap a Try/Catch around it to get nice, pretty output, but it works.
@SQLvariantI have a PowerShell script[/url] for you.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy