Export (0) Print
Expand All

ManagementScope Class

Represents a scope for management operations. In v1.0 the scope defines the WMI namespace in which management operations are performed.

For a list of all members of this type, see ManagementScope Members.

System.Object
   System.Management.ManagementScope

[Visual Basic]
Public Class ManagementScope
   Implements ICloneable
[C#]
public class ManagementScope : ICloneable
[C++]
public __gc class ManagementScope : public ICloneable
[JScript]
public class ManagementScope implements ICloneable

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Example

[C#] 
using System;
using System.Management;

// This sample demonstrates how to connect to root/default namespace
// using ManagmentScope object.
class Sample_ManagementScope
{
    public static int Main(string[] args)
    {
        ManagementScope scope = new ManagementScope("root\\default");
        scope.Connect();
        ManagementClass newClass = new ManagementClass(
            scope,
            new ManagementPath(),
            null);
        return 0;
    }
}
   
[Visual Basic] 
Imports System
Imports System.Management

' This sample demonstrates how to connect to root/default namespace
' using ManagmentScope object.
Class Sample_ManagementScope
    Overloads Public Shared Function Main(args() As String) As Integer
        Dim scope As New ManagementScope("root\default")
        scope.Connect()
        Dim newClass As New ManagementClass(scope, _
            New ManagementPath(), _
            Nothing)
        Return 0
    End Function
End Class
   

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.Management

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System.Management (in System.Management.dll)

See Also

ManagementScope Members | System.Management Namespace

Show:
© 2014 Microsoft