HI Guys,
i've searched for a PowerCLI SQL forum on here but can't find one. Please remove this it it's not the right forum but, i'm hoping someone on here may have tried this before.
I'm trying to connect to a SQL Database to verify some info before proceeding with an action.
the account i'm using has access to the DB but, connection attempts are failing.
here's what i'm trying
[string]$servername="MyDBServer.corp.com"
[string]$database="myDatabase"
[string]$sqluser="myUsername.corp.com"
[string]$sqlpassword="notMyPassword!"
$dbConnection = New-Object System.Data.SQLClient.SQLConnection
$dbConnection.ConnectionString = "server='$servername';database='$database';trusted_connection=true; user id = '$sqluser'; Password = '$sqlpassword'; integrated security='False'"
$dbConnection.Open()
Write-Verbose 'Connection established'