A. To query processor cores or sockets, run
Get-WmiObject Win32_Processor; add -computername whatever
to query a remote computer (replacing whatever with a comma-separated list of computer names). There is a NumberOfCores property that has what you need. Each instance of Win32_Processor is a socket. This has only been the case since Windows Server 2008 and Windows Vista. Prior to that, you'll see an instance of Win32_Processor for each core, without any information on how many sockets those are spread across. The remarks on the Win32_Processor Class page at msdn.microsoft.com/en-us/library/aa394373(VS.85).aspx explain this in more detail.
Do you have a Windows PowerShell question? Why not submit it to Don? Post your question at www.windowsitpro.com/FAQs/FAQSubmittalForm.aspx and you might see your answer online! Find more PowerShell FAQs, articles, and other resources at windowsitpro.com/go/DonJonesPowerShell.