Microsoft SQL Server Reporting Services 2017 registry - reporting-services

Did registry paths change for the Microsoft SQL Server Reporting Services 2017?
Before we were able to locate instance name here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\RS\MSSQLSERVER
But now in 2017 MSSQLSERVER is missing and it has SSRS instead.
Based on this article it should be still under MSSQLSERVER but it's not. Did we missed some installation setting that caused this or this is default standard behavior now?

Because Reporting Services is now a separate installation, it installs as a named instance SSRS. This is a change from previous versions where Reporting Services was part of SQL Server setup.
I would suggest using WMI queries to obtain the necessary information (example below using PowerShell). Notice that the v14 refers to the 2017 release.
$wmiName = (Get-WmiObject –namespace root\Microsoft\SqlServer\ReportServer –class __Namespace).Name
$rsConfig = Get-WmiObject –namespace "root\Microsoft\SqlServer\ReportServer\$wmiName\v14\Admin" -class MSReportServer_ConfigurationSetting

I know this post is old but I had the same problem in my company to find information from RS 2017 and found no place that reported the right location so I wanted to post here!
My friend (Paulo Henrique Rodrigues Orind) and I found a place where you can get all the information about the RS 2017 and I hope the RS 2019 is the same.
1) By PowerShell + WMI:
Get-WmiObject -namespace "root\Microsoft\SqlServer\ReportServer\RS_SSRS\V14" -class MSReportServer_Instance | Select-Object -Property EditionName, Version, InstanceName
Image-powerShellCommand
2) By C# + WMI (Do you will need to import the System.Management.dll)
using System;
using System.Management;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
ConnectionOptions options = new ConnectionOptions();
options.Impersonation = System.Management.ImpersonationLevel.Impersonate;
ManagementScope scope = new ManagementScope("Root\\Microsoft\\SqlServer\\ReportServer\\RS_SSRS\\V14", options);
scope.Connect();
//Query system for Operating System information
ObjectQuery query = new ObjectQuery("SELECT * FROM MSReportServer_Instance");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
ManagementObjectCollection queryCollection = searcher.Get();
foreach (ManagementObject m in queryCollection)
{
// Display the remote computer information
Console.WriteLine("EditionName : {0}", m["EditionName"]);
Console.WriteLine("EditionID : {0}", m["EditionID"]);
Console.WriteLine("InstanceID : {0}", m["InstanceID"]);
Console.WriteLine("InstanceName : {0}", m["InstanceName"]);
Console.WriteLine("Version : {0}", m["Version"]);
}
Console.ReadKey();
}
}
}
Image-CsharpCode-Wmi
3) WMI:
wmi_1
wmi_2
wmi_3
wmi_4
Opening the WMI:
Namespace: Root >> Microsoft >> SqlServer >> ReportServer >> RS_SSRS >> V14
Class: MSReportServer_Instance
I hope I have helped with something

Related

How to configure Tomcat Catalina logs in json using default jar(tomact-juli.jar)

I have updated the logging.properties file of tomcat to print the logs in json format.
But, the issue is value of "message " has some escape characters, which makes my log invalid json.
Please let me know how to escape these characters(:,[,],/) in json using default tomcat-juli.jar and used as a string.
Below is my updated logging.properties file:
handlers = 1catalina.org.apache.juli.AsyncFileHandler, 2localhost.org.apache.juli.AsyncFileHandler, 3manager.org.apache.juli.AsyncFileHandler, 4host-manager.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler
.handlers = 1catalina.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
java.util.logging.SimpleFormatter.format = {"date" :"%1$tF", "timestamp": "%1$tT" , "loggerlevel": "%4$s", "loggersource": "%3$s" , "message": "%5$s%6$s"}%n
1catalina.org.apache.juli.AsyncFileHandler.level = FINE
1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
1catalina.org.apache.juli.AsyncFileHandler.formatter = java.util.logging.SimpleFormatter
2localhost.org.apache.juli.AsyncFileHandler.level = FINE
2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
2localhost.org.apache.juli.AsyncFileHandler.formatter = java.util.logging.SimpleFormatter
3manager.org.apache.juli.AsyncFileHandler.level = FINE
3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.AsyncFileHandler.prefix = manager.
3manager.org.apache.juli.AsyncFileHandler.formatter = java.util.logging.SimpleFormatter
4host-manager.org.apache.juli.AsyncFileHandler.level = FINE
4host-manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.
4host-manager.org.apache.juli.AsyncFileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.AsyncFileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.AsyncFileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.AsyncFileHandler
I would suggest you official way (without using middleware):
Download Elastic JUL formatter and logging core libraries:
https://mvnrepository.com/artifact/co.elastic.logging/jul-ecs-formatter
https://mvnrepository.com/artifact/co.elastic.logging/ecs-logging-core
Put them into tomcat/bin folder
List them in CLASSPATH system property in tomcat/bin/setenv.sh(bat).
If no such file - create it with the next content: on Unix -
export CLASSPATH="$CLASSPATH:ecs-logging-core.jar:jul-ecs-formatter.jar"
on Windows - set CLASSPATH=%CLASSPATH%;ecs-logging-core.jar;jul-ecs-formatter.jar
Edit tomcat/conf/logging.properties in such way:
handlers = java.util.logging.ConsoleHandler
.handlers = java.util.logging.ConsoleHandler
...
java.util.logging.ConsoleHandler.formatter = co.elastic.logging.jul.EcsFormatter
Such configuration will make tomcat to write all events in appropriate Elastic (Logstash) JSON format into console (stdout) which is very suitable when you running in docker or other container.
Documentation https://www.elastic.co/guide/en/ecs-logging/java/1.x/setup.html
I would do the following:
Download and build devatherock's jul json formatter
Download json-simple
Add both to your tomcat startup classpath in the $CATALINA_BASE/bin/setenv.sh script
In $CATALINA_BASE/conf/logging.properties, add or change the formatters for your log handlers to io.github.devatherock.json.formatter.JSONFormatter

How to use sparklyr spark_write_jdbc to connect to MySql

spark_write_jdbc(members_df,
name = "Mbrs",
options = list(
url = paste0("jdbc:mysql://",mysql_host,":",mysql_port,"/",dbname),
user = mysql_user,
password = mysql_password),
mode = "append")
Results in the following exception:
Error: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:315)
The .jar file is in a folder on the server where RStudio is running, config details below. We're able to access MySql via the RMySql package so MySql is working and accessible.
config$`spark.sparklyr.shell.driver-class-path` <- "/dev/shm/temp/mysql-connector-java-5.1.44-bin.jar"
Even if the question is different, I think the answer still applies also to this:
How to use a predicate while reading from JDBC connection?
Code to connect to JDBC MySQL through sparklyr (I made some slight changes to simplify the code a bit, written by Jake Russ)
library(sparklyr)
library(dplyr)
config <- spark_config()
#config$`sparklyr.shell.driver-class-path` <- "E:\\spark232_hadoop27\\jars\\mysql-connector-java-5.1.47-bin.jar"
#in my case, using RStudio and Sparkly this seemed to be optional
sc <- spark_connect(master = "local")
db_tbl <- spark_read_jdbc(sc,
name = "table_name",
options = list(url = "jdbc:mysql://localhost:3306/schema_name",
user = "root",
password = "password",
dbtable = "table_name"))

Connecting from rails to an external azure database to import data

Hello Stackoverflow members,
I need to import data from an external database which is an azure database. And i am getting the following error: TinyTds::Error: USE statement is not supported to switch between databases. Use a new connection to connect to a different database.
class Exact
require 'tiny_tds'
def connect
dbadmin = ""
password = "!"
server = ""
database = ""
a = true
client=TinyTds::Client.new(:username=>'', :password=> password, :dataserver=> server , :port=>1433, :database=>database, :azure=> 'true')
puts "connecting"
results = client.execute("select * from table")
puts "results opgehaald"
puts results.first
client.close
puts "client is closed"
end
end
I think i need to open a new connection to connect to the database but i am having problems figuring this out. Could anyone point me in the right direction or assist me with the problems i am having.
Kind regards,
Yoeri Huitema
I fixed the issue as described in this thread: https://github.com/rails-sqlserver/tiny_tds/issues/249
client=TinyTds::Client.new(:username=>'', :password=> password, :dataserver=> server , :port=>1433, :database=>database, :azure=> 'true')
should have been
client=TinyTds::Client.new(:username=>'', :password=> password, :dataserver=> server , :port=>1433, :database=>database, :azure=> TRUE)

How to configure php.ini to use gmail as mail server

I want to learn yii as my first framework. And I'm trying to make the contact form work. But I got this error:
I've already configured php.ini file from:
C:\wamp\bin\php\php5.3.0
And changed the default to these values:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = ssl:smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 23
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = myemail#gmail.com
I've seen from here that gmail doesn't use port 25, which is the default in the php.ini. So I used 23. And also opened that port in the windows 7 firewall. Via inbound rules.
Then I also edited the main config in my yii application, to match the email that I'm using:
// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=>'myemail#gmail.com',
),
);
Finally, I restarted wampserver. Then cleared all my browsing data. Why then to I still see that its pointing out port 25 in the error. Have I miss something? Please help.
Heres a simple python script which could allow you to run a mail server on localhost, you dont have to change anything. Sorry if im a bit late.
import smtpd
import smtplib
import asyncore
class SMTPServer(smtpd.SMTPServer):
def __init__(*args, **kwargs):
print "Running fake smtp server on port 25"
smtpd.SMTPServer.__init__(*args, **kwargs)
def process_message(*args, **kwargs):
to = args[3][0]
msg = args[4]
gmail_user = 'yourgmailhere'
gmail_pwd = 'yourgmailpassword'
smtpserver = smtplib.SMTP("smtp.gmail.com",587)
smtpserver.ehlo()
smtpserver.starttls()
smtpserver.ehlo
smtpserver.login(gmail_user, gmail_pwd)
smtpserver.sendmail(gmail_user, to, msg)
print 'sent to '+to
pass
if __name__ == "__main__":
smtp_server = SMTPServer(('localhost', 25), None)
try:
asyncore.loop()
except KeyboardInterrupt:
smtp_server.close()
#end of code
Note: I used args[3][0] and args[4] as to address and message as the args sent by my php mail() corresponded to an array of args[3][0] as receipent email
If you open the php.ini file in WAMP, you will find these two lines:
smtp_server
smtp_port
Add the server and port number for your host (you may need to contact them for details)
The following two lines don't exist by default:
auth_username
auth_password
So you will need to add them to be able to send mail from a server that requires authentication. So an example may be:
smtp_server = mail.example.com
smtp_port = 25
auth_username = example_username#example.com
auth_password = example_password
ps: you should not use your personal mail here. for an obvious reason.
If using WAMP, the php.ini to be configured is present in the wamp/bin/apache/Apache_x_y/bin folder
where _x_y is related to the version of the Apache build used by your wamp installation
uncomment extension=php_openssl.dll at php.ini in WAMP server ("D:\wamp\bin\apache\Apache2.4.4\bin\php.ini")
In the file "D:\wamp\www\mantisbt-1.2.15\config_inc.php"
# --- Email Configuration ---
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.gmail.com';
$g_smtp_connection_mode = 'ssl';
$g_smtp_port = 465;
$g_smtp_username = 'yourmail#gmail.com';
$g_smtp_password = 'yourpwd';
$g_enable_email_notification = ON;
$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT;
$g_log_destination = 'file:/tmp/log/mantisbt.log';
$g_administrator_email = 'administrator#example.com';
$g_webmaster_email = 'webmaster#example.com';
$g_from_email = 'noreply#example.com';
$g_return_path_email = 'admin#example.com';
$g_from_name = 'Mantis Bug Tracker';
$g_email_receive_own = OFF;
$g_email_send_using_cronjob = OFF;

Problems connecting to an Access MDB file through PowerShell

I am attempting to connect to an Access 2000 database file (*.mdb), but I am having just a tad few issues. Here is the screenplay thus far,
1) Googled how to connect to a database using powershell which resulted in the following as a source code baseline.
$adOpenStatic = 3
$adLockOptimistic = 3
$objConnection = New-Object -comobject ADODB.Connection
$objRecordset = New-Object -comobject ADODB.Recordset
$objConnection.Open("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = c:\scripts\sample.mdb")
$objRecordset.Open("Select * from TotalSales", $objConnection,$adOpenStatic,$adLockOptimistic)
$objRecordset.MoveFirst()
do
{ $objRecordset.Fields.Item("EmployeeName").Value; $objRecordset.MoveNext() }
until ($objRecordset.EOF -eq $True)
$objRecordset.Close()
$objConnection.Close()
2) I substituted the Data Source for the fully qualified path of my database then was presented with the following.
Exception calling "Open" with "5" argument(s): "Record(s) cannot be read; no read permission on 'RqRequirements'."
At :line:23 char:18
+ $objRecordset.Open <<<< ("Select * from RqRequirements", $objConnectionCsdscDB,$adOpenStatic,$adLockOptimistic)
3) Since this is a Rational RequisitePro database I almost never need to edit the database directly, but come to find out if we need to edit the database direct we need to issue the following command as a link on the Windows Desktop:
"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" /wrkgrp C:\Program Files\Rational\RequisitePro\bin\rqprodb.mda" /user "xxxxxxx" /pwd "yyyyy"
4) Taking the script listed above and changing it slightly I have the following:
$adOpenStatic = 3
$adLockOptimistic = 3
$objConnectionRqProDB = New-Object -comobject ADODB.Connection
$objConnectionCsdscDB = New-Object -comobject ADODB.Connection
$objRecordset = New-Object -comobject ADODB.Recordset
$cnnStringRqProDB = "Provider = Microsoft.Jet.OLEDB.4.0;" +
"Data Source = C:\\Program Files\\Rational\\RequisitePro\\bin\\rqprodb.mda;" +
"UID=requisite admin;" +
"PWD=multiuser"
$cnnStringCsdscDB = "Provider = Microsoft.Jet.OLEDB.4.0;" +
"Data Source = J:\\TestPowerShell\\Rational.MDB"
$objConnectionRqProDB.Connectionstring = $cnnStringRqProDB
$objConnectionRqProDB.Open()
$objConnectionCsdscDB.Connectionstring = $cnnStringCsdscDB
$objConnectionCsdscDB.Open()
$objRecordset.Open("Select * from RqRequirements", $objConnectionCsdscDB,$adOpenStatic,$adLockOptimistic)
$objRecordset.Close()
$objConnection.Close()
5) When I run this script I get the following error:
Exception calling "Open" with "4" argument(s): "Could not find installable ISAM."
At :line:17 char:26
+ $objConnectionRqProDB.Open <<<< ()
6) I did some searching and found the following link, http://support.microsoft.com/kb/209805, and I checked the registry and the entry is present for
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Paradox
win32=C:\WINDOWS\system32\mspbde40.dll
this file is located in %SYSTEM32%\
Note, I do not have Access installed on my system (could this be an underlying problem? I am not sure, but I wouldn't think so since I am using the ADO)
Questions:
1) How do I include the "/wrkgrp" option in the connection string in the script?
2) Assuming the lack of the "/wrkgrp" option in the connection string is not my problem what might be issue?
3) Does Access need to be installed on the system in order for this to work?
Thanks, Mark
You shouldn't need Access installed.
You are trying to open the workgroup database (mdw) separately - don't do that.
You need to specify the workgroup database in the connect string
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;
Jet OLEDB:System Database=system.mdw;User ID=myUsername;Password=myPassword;
So in your case, use the following:
$cnnStringRqProDB = "Provider = Microsoft.Jet.OLEDB.4.0;" +
"Data Source = J:\\TestPowerShell\\Rational.MDB;" +
"Jet OLEDB:System Database = C:\\Program Files\\Rational\\RequisitePro\\bin\\rqprodb.mda;" +
"User ID=requisite admin;" +
"Password=multiuser"
$objConnectionCsdscDB.Connectionstring = $cnnStringCsdscDB
$objConnectionCsdscDB.Open()