Databases Reference
In-Depth Information
Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs)
Handles Button1.Click
Dim WmiNamespace As String = "\root\Microsoft\SqlServer\
ReportServer\RS_HI\v11\Admin"
Dim WmiRSClass As String = "\root\Microsoft\SqlServer\
ReportServer\RS_HI\v11\admin:MSReportServer_ConfigurationSetting"
Dim serverClass As New System.Management.ManagementClass
Dim scope As ManagementScope
scope = New ManagementScope(WmiNamespace) 'Connect to the
Reporting Services namespace.
scope.Connect() 'Create the server class.
serverClass = New ManagementClass(WmiRSClass) 'Connect to
the management object.
Try
serverClass.Get()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
If serverClass Is Nothing Then Throw New Exception("No
class found")
Dim instances As ManagementObjectCollection = serverClass.
GetInstances()
Dim instance As New ManagementObject
For Each instance In instances
Label1.Text = ("Number of Instances detected:" &
instances.Count)
Dim instProps As PropertyDataCollection = instance.
Properties
'[The following code or similar code can be used for
'modifying the instance properties:]
 
Search WWH ::




Custom Search