Dear all, How can I get Windows Product Key from Active Directory Users Machine via power shell or any tools? In our company, we have 300 PC. Somehow they lost Windows product keys. So now they want all users machine windows product keys. Is it not possible to go physically all end users and in that case i can't use also key finder software. Company authority assigned me to find a way get windows product key for all machines but I am unable to find this. Any one can help me about this.Thanks in advanced.
The Windows Product key is not stored in Active Directory. It is stored in the registry on each machine. It is not stored in a readable format. However, if you search you will find scripts that will extract the Product Key from the registry.
I don't know what management's intent is, but this is not as straightforward as I'm sure they assumed. This is why customers buy solutions like Microsoft's SCCM, or Network Inventory Advisor, or Spiceworks (free), etc. Keep in mind that software is per machine, not user. So it's a little misguided to "align" software to users.
So you really need to have the conversation with management as to what the end goal is, otherwise you're going to waste a lot of time and not get to what they want. Ideally it should fit into existing tools you already use. That said, I'm not sure PowerShell is going to get you there quickly or painlessly. And as Sean mentioned, the key is not in "clear text".
If their goal is to move software around so it's used fully before buying more, that's admirable. Make sure you understand the licensing.
Just another wrinkle in this whole mess.
In our company, we have 300 PC. Somehow they lost Windows product keys. So now they want all users machine windows product keys. Is it not possible to go physically all end users and in that case i can't use also key finder software. Company authority assigned me to find a way get windows product key for all machines but I am unable to find this.
So essentially you want to ...
The good news is that there are dozens of scripts out there that you can use. Do a Bing/Google search on "powershell find windows product key" or something similar. There is no point in generating "new" code to do this.
Use your Google Fu.
NOTE: This will probably use WMI as the underlying technology (depending on the script you choose) to gather the information from the workstations. That may or may not work in your environment depending on firewall settings. Using CIM_Instance instead will probably not work in your environment since it requires PSRemoting to be enabled, which is rare in most organizations.
In the meantime you should still be thinking about making a case for a real asset management system.
Now it's probably the best time to purchase a volume license and install license activation server :))
In reply to nohandle: