Find out ENABLED GUEST user in all registered SQL Servers with HTML output via PowerShell
Tasks:
- Get all registered SQL servers from list
- Prepare T-SQL Script
- Prepare HTML/CSS style
- Put them together in Powershell
Typically, finding a user inside SQL server is pretty much a easy thing to do. You can either use the tranditional system table or the new system table.
sysusers
sys.database_principals
But the
STATUS
of the user, enabled or diabled that you can only get from the table: sys.sysusers
Let’s jump to the code directly.