Short VBS code - get a single specified instance of FtpAuthentication_PasswordChangeNeeded class or get
a default unnamed instance (singleton) of the class, using one single command GetObject
with exact path of the wmi object.
Get a specified instance of FtpAuthentication_PasswordChangeNeeded by a key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this c# sample code.
ManagementScope scope = new ManagementScope("\\\\.\\ROOT\\WMI");
ObjectQuery query = new ObjectQuery("SELECT * FROM FtpAuthentication_PasswordChangeNeeded Where PropertyName=\"SomeText\"");
ManagementObjectSearcher searcher =
new ManagementObjectSearcher(scope, query);
ManagementObjectCollection queryCollection = searcher.Get();
foreach (ManagementObject m in queryCollection)
{
Console.WriteLine("Level : {0}", m["Level"]);
}
Get a specified instance of FtpAuthentication_PasswordChangeNeeded by a key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this VB.Net sample code.
Dim Scope As New ManagementScope("\\.\ROOT\WMI")
Dim Query As New ObjectQuery("SELECT * FROM FtpAuthentication_PasswordChangeNeeded Where PropertyName="SomeText"")
Dim Searcher As New ManagementObjectSearcher(Scope, Query)
Dim queryCollection As ManagementObjectCollection = Searcher.Get
For Each mObject As ManagementObject In queryCollection
Console.WriteLine("Level : {0}", mObject("Level"))
Next