Export (0) Print
Expand All

Cpu.ID Property

Gets the ID of the CPU that is represented by this Cpu object.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

public int ID { get; }

Property Value

Type: Int32
An Int value that is assigned to the CPU represented by this Cpu instance.

The ID member is read-only.

The following code example shows how to display the GroupID for each CPU on the local instance of SQL Server.

C#

using System;
using Microsoft.SqlServer.Management.Smo;

namespace samples
{
    class Program
    {
        static void Main(string[] args)
        {
            Server dbServer = new Server("(local)");
            dbServer.Refresh();
            foreach (Cpu cpu in dbServer.AffinityInfo.Cpus)
            {
                Console.WriteLine("CPU ID {0} is {1}.",
                    cpu.ID, cpu.GroupID);
            }
        }
    }
}

Powershell

$dbServer = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$dbServer.Refresh()
Foreach ($cpu in $dbServer.AffinityInfo.Cpus)
{
   Write-Host "CPU ID:" $cpu.ID "is" $cpu.GroupID
}
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft