Could "Win32_Processor ProcessorID" attribute change value with no hardware modifications - windows-xp

I have been using WMI to get information about hardware. Some informations appears to DO NOT change. One of these is "Win32_Processsor ProcessorID".
Anyway, I have a machine (with just one phisical processor) where the query returns different values occasionally.
Do you know something about it?
BTW, running WMI queries on an Windows XP SP3.

Related

How do others collect server names into a file like C:\Servers.csv

Nearly all PowerShell code leans heavily on a list of computer names. Maintaining this list is crucial for an up to date data center.
I used to gather computer names from my WSUS boxes. We have now switched to an inferior product which does not give up secrets easily! How are others gathering accurate lists of computer names with which to fuel your code?
Grabbing names from Active Directory works well, however not ALL servers are in the domain. However all servers need updates so let's get a list from the update server. Ahhh, there is the rub, inferior updating software! How is everyone gathering computer names for future processing?
For our datacenters, I always query each of the domain controllers to get a list of systems instead of relying on csv files (we no longer keep anything unjoined).
we used to have stand alone boxes, when we did I would simply get their IPs or netbios names by using the VMWare Power CLI to query that info from vCenter.
Alternatively, if you only have VMs, you can just go that route directly.
If you have stand-alone physical machines, then you would want to scan all of your IP range (after converting items you got from the previous two steps into IPs, so that you can exclude all IPs that are already accounted for by replies to netbios (to check the OS reported to make sure they are Windows systems)).
Alternatively, if all of the servers are in DNS, then just query the DNS entries from your domain controller, slap a parallel computer-exists check on the results, select unique where result is good and that is your list.
I'm not sure where you're getting this idea that people are composing CSV lists of machines for data centers. Most data centers I'm aware of will have virtualization stacks and have complex monitoring software such as the various flavors of SolarWinds products. Usually these will allow you to export a customized CSV of the machines they monitor. Of course, like anything else, there are quite a few of these monitoring services out there.
For small and mid-sized companies, admins may or may not maintain an inventory of company assets. I've been contracted to come out to companies who have let their asset management system slip and have no idea where everything is, and I usually use a combination of command line tools such as nmap, fping, and the PSADUC module to do some network discovery over several site days.
PowerShell isn't a great tool for data center use anyway, since most infrastructure uses some sort of Linux to host their virtual machines. Increasingly, the industry has moved towards containerization and microservices as well, which make maintaining boxes less and less relevant.

WMI Performance Counters show zero, but Task Manager shows values

I thought Task Manager used the WMI performance counters to calculate things like disk usage per process. However, running a PowerShell script that queries Win32_PerfFormattedData_PerfProc_Process, I get the right process and some data filled in--but the relevant values I'm interested in are all zero. (See image.)
What I want to do is simply get (or calculate) the kind of data that Task Manager shows, and then save the data for graphing and/or decision purposes. (e.g. For learning purposes, killing off a program that is using 100% CPU or 16 GB of RAM.)
Running in Windows 10 (Pro). I just tried running as administrator and no difference. Powershell version is 5.1.
Q: So why are these values zero? And, if Task Manager is getting these values... what API is it using if not WMI?

Enumerating lots of iSCSI volumes. Very slow. Having issues with programmatically getting disk number

I am currently writing some orchestration software for Hyper-V 2012 R2.
The orchestration platform as a whole also talks to other Hypervisors, like Xen.
I am in the process of introducing new SAN storage and, due to some desirable features that exist at a storage level, I want to use a LUN-to-VM mapping on all Hypervisors.
I am having real issues with managing this volume of iSCSI connections on Windows. But not in the way I thought I would...
I had heard that there were scaling issues with Windows and ‘lots of LUNs’, but I wanted to check for myself. I am seeing none of the issues other people have mentioned.
For instance, I can enumerate 500+ LUNs via diskpart in a second. I can list all connected disks with ‘get-disk’, in under a second, the issue comes from iSCSI scaling itself.
If anyone has a moment to read on, perhaps they could shed some light on why...
I have no issue programmatically connecting to the iSCSI targets, but I seem to have real issues when I start trying to get session information (which I need to get other information).
i.e. There seems to be no way to specify which disk number\address an iSCSI target receives at the point it is connected (unless i'm mistaken). I can work backwards from the IQN via WMI, via a call to
MSiSCSIInitiator_SessionClass
When you start talking about 100+ connected volumes, a call to this class can sometimes take over 10 minutes to return. If I test it via Powerhell with something like:
$query = "Select * from MSiSCSIInitiator_SessionClass Where TargetName='$iqn'"
Get-WmiObject -Namespace "root\WMI" -Query $query
...you can see it get stuck midway through enumerating the volumes. It will pause.
I haven’t run the exact numbers, but every additional volume seems to put about 3-4 (or more) seconds on the total time a query takes to return.
It gets a bit weirder. Windows 2012 has some built in iSCSI commands. I can get a connected iSCSI target object in under a second with
Get-IscsiTarget –nodeaddress blah
I can get an iSCSI connection object using
$iscsi_target_object | Get-IsciConnection
... all in in under a second. These must be related to iSCSI session inforation in some way.
A call, no matter how I package it, to Get-IscsiSession takes about 10 minutes to return.
The Hyper-VM manager GUI is also terribly slow when opening the settings page for a VM, presumably because it is enumerating possible pass-through disks via their iSCSI session. This also takes around ten minutes.
A query to Msvm_DiskDrive in root/virtualisation also takes an age to return..
Again, diskpart, Get-Disk etc all return in seconds. I can refresh all iSCSI targets on the system in about a minute with 500+ targets. I thought that was going to be the hard bit.
So, I have two questions.
First all, does this sound right? Is there anything at all I doing something that might
impact the speed at which WMI calls are returned? Can I speed WMI up at all?
Secondly, can anyone think of any other way – other than the MSiSCSIInitiator_SessionClass – that I could derive a disk number from an IQN? This might solve the bulk of my problems. Perhaps there other routes to this information i might have missed.
Cheers.

Getting BIOS Serial Number without WMI

I'm attempting to get the serial number of the BIOS for a WinXP Embedded 32-bit system from a Win32 user mode application (MFC if that makes any diff).
I'm trying to get the same serial number that you can get via WMI from the 'Win32_BIOS' class from member "SerialNumber." The problem is that I can't use WMI as this will have to run on older systems that don't have WMI installed.
We basically have a series of machines with data encoded in this BIOS field so it can't be changed by the users, and we sometimes need this information to be output to a file and sent to us.
I've found 'GetSystemFirmwareTable', but the minimum Win version is WinXP 64-bit. WMI is out of the question, and we already have code to read it from a directly mapped physical address, but the problem is that the software we use that allows us to map those physical addresses is tied to our software, and our software cannot run at this stage in this particular use case (licensing).
As far as I've found, the only other way to map a physical hardware address from a user-mode application is to delve into driver territory and integrate some driver libraries into the application to allow it to map physical addresses.
Is there some kind of shadow copy that the OS makes that I can access without a huge amount of configuration?
NTVDM in Windows XP map the first MiB of physical memory so you should be able to find the SMBIOS blob in that first megabyte and get the BIOS serial number from there. See the PDF specification for further reference.

Processes and threads

1a)Are MS Word and MS PowerPoint different processes or threads of a single process?
b)How does a spell checker routine (common to both, word and PowerPoint) used? I mean is the code copied 2 times for each of the processes in the main memory,
if they are different processes
if they are threads.
The question is not specific to Windows OS.
They are different processes that happen to have overlap in [certain] functionality.
1a) Different processes generally though there may exist some program out there that could try to run them both within the same process if you look at it as an O/S within an O/S sort of situation.
1b) The spell checker is likely just running over the existing entered data and confirming words are found in a dictionary along with some basic grammar preforming the odd correction here and there. Note though you don't specify which version of Office you mean as there are Mac and PC versions of the software that may have different behaviours among the versions.
On a Windows machine you could use Task Manager or Process Explorer to confirm the separate processes.