Quantcast
Channel: Symantec Connect - Products - ディスカッション
Viewing all articles
Browse latest Browse all 11815

Getting Started with Powershell to SEPM SQL

$
0
0
ソリューションが必要です

I am trying this in a test lab.

I am new to powershell and SQL but trying to get into it.  I am just trying to get some database from SEPM SQL, and this is what I have in my powershell script so far.  The result is nothing, no errors, either.

 

My goal is just to connect to the database and display some sample data either on screen or in a text file.   Any help is appreciated.

 

$datasource = "localhost"
$user = "Username"
$pwd = "Password"
$database = "sem5"
$connectionstring = "server=$datasource;uid=$user;pwd=$pwd;database=$database;Integrated Security=False;"
$connection = New-Object System.Data.SqlClient.SqlConnection
$connection.ConnectionString = $connectionstring
$connection.open()
$query = "SELECT computer_name FROM SEM_COMPUTER"
$command = $connection.CreateCommand()
$command.Commandtext = $query
$result = $command.ExecuteReader()

 


Viewing all articles
Browse latest Browse all 11815

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>