@abhrfh - You can install SQL PowerShell module and try to connect SQL server to scan user logins. You may need to write some lines of code to achieve your objective
Powershell
hi All
Need help. I am fairly new to Powershell. I am looking for a PowerShell script that scans all SQL servers on the network or the domain and searches for a particular user/login.
We are busy with an audit and there are three accounts that no one has a recollection of and we would like to disable these accounts.
Thank you in advance.
2 answers
Sort by: Most helpful
-
-
Clément 76 Reputation points
2022-10-02T21:05:39.117+00:00 Hi,
You can start with this nice script I found on https://www.sqlservercentral.com/blogs/list-out-all-the-sql-servers-in-domain
It does scan the SQL servers on a domain. The script could be upgraded to find the type of users/login you are looking for.