SQL Database Queries using Powershell

Publicado el: 27 julio 2019
en el canal de: The Long Voyage
4,726
32

#thelongvoyage ( Subscribe for more )

  / the.long.voyage  
--------------------------------------------------------
Agenda : Read SQL Database of Remote Server by PowerShell

Task: Find Brave.exe user/program in DB
( SQL Server is running on Remote Server Machine )
and you have a user with appropriate rights

1. connect to remote SQL Server
2. list all the databases on that server
3. list all the tables for any specific database
4. list schema (structure)
5. list columns names
6. read table data ( find brave.exe )

-----------------------------------------------------------

Commands Reference:

install-module sqlserver ( install this module to use SQL cmdlets on PowerShell)

Get-SqlInstance -ServerInstance COMPUTERNAME -Credential UserName

Get-SqlDatabase -ServerInstance COMPUTERNAME -Credential UserName

$a = Get-SqlDatabase -ServerInstance COMPUTERNAME -Database process -Credential UserName

$a | Get-Member -Name Tables

$a.Tables

Read-SqlTableData -ServerInstance COMPUTERNAME -Credential UserName -DatabaseName process -TableName proc -SchemaName dbo -TopN 10 | where Path -Like brave


the end


En esta página del sitio puede ver el video en línea SQL Database Queries using Powershell de Duración hora minuto segunda en buena calidad , que subió el usuario The Long Voyage 27 julio 2019, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 4,726 veces y le gustó 32 a los espectadores. Disfruta viendo!