HELP WITH WMI SCRIPTING

  • Help with WMI scripting

    --------------------------------------------------------------------------------

    I am using this code to use on a SSIS script task to ensure the ssis package identifies cluster before running a machine....

    I have successfully done that of the servername but still finding it difficult to identify that of the

    cluster server.....

    Help needed with WMI data reader task .. also pls post and it will be well appreciated

    using System.Management;

    ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\MSCluster", "SELECT * FROM MSCluster_Resource");

    foreach (ManagementObject queryObj in searcher.Get())

    {

    Console.WriteLine("Name: {0}", queryObj["Name"]);

    }

  • have a look at a tool called scriptomatic from Microsoft, this can write WMI for you in seconds if you know which WMI nodes you want to query

  • why are you using WMI?

    To identify the virtual network name and the active cluster node name use the following

    For cluster node name

    select serverproperty('ComputerNamePhysicalNetBIOS')

    For virtual network name

    select serverproperty('machinename')

    For instance name

    select serverproperty('instancename')

    For complete instance name (virtual network name and instance name)

    select serverproperty('servername')

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • I want to use this as a script task to ensure clsuter to machine name are in sync

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply