SQLQuery

suggest change

To query every row from the table MachineName, use Invoke-Sqlcmd2 from the Invoke-Sqlcmd2 module. The built-in command is Invoke-Sqlcmd in the SqlServer module. A password on the command line is visible to other processes.

$Query = "Select * from MachineName"
$Inst = "ServerInstance"
$DbName = "DatabaseName"
$UID = "User ID"
$Password = "Password"

Invoke-Sqlcmd2 -ServerInstance $Inst -Database $DbName -Query $Query -Username $UID -Password $Password

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents