I am trying to execute below small SQL script from powershell by passing my domain user name and password..but it is throwing an error login failed for the user.
Howerver I am able to execute the same query by passing normal user 'non domain' and password. The issue is only when i am trying to connect with domain username.
Can you please suggest if there is any way to execute below query with domain user..
Invoke-Sqlcmd -query "select name from master.sys.databases" -ServerInstance "CM-NCKM-DBTST04\SQL2012" -username "sos\9venk" -password "xxxx"
Thanks
Venkat