Powershell Get Serial Number
How can I get this script to show serial number as well as name and model in the output? Also I would like to output to Excel. Also, is using a txt file list the best way to input the list of PCs? I am just getting my feet wet in PS Scripting so would love some assistance. The Get-PhysicalDisk cmdlet gets a list of all PhysicalDisk objects visible across any available Storage Management Providers, or optionally a filtered list of disks. Examples Example 1: Getting all physical disks. Feb 11, 2014 - The HP product number is in the registry so can be retrieved in PowerShell. Get-WmiObject Win32_BIOS Select-Object SerialNumber.
-->- Getting the Computer name, serial number and model from all connected PC. Welcome › Forums › General PowerShell Q&A › Getting the Computer name, serial number and model from all connected PC. This topic contains 9 replies, has 7 voices, and was last updated.
- Powershell - Get Machine Serial Number.
- Tiny script to get the Computer name and Serial number from SCCM 2012 By Jonathan on October 19, 2014 in Configuration Manager, PowerShell This script will connect to the Configuration Manger 2012 database and read the database tables to get information about computer clients and their serial number.
Syntax
Description
The Get-Disk cmdlet gets one or more Disk objects visible to the operating system, or optionally a filtered list.
Examples
Example 1: Get all disks
This example gets all disks visible to the operating system.
Example 2: Get a disk by disk number
This example gets disk 6.
Example 3: Get all USB disks
This example gets all disks attached via the USB bus by piping the output of Get-Disk to the Where-Object cmdlet, and filtering by the USB value of the Bustype property.
Example 4: Get the iSCSI sessions for all iSCSI disks
This example gets all disks attached via the iSCSI bus by piping the output of Get-Disk to the Where-Object cmdlet, and filtering by the iSCSI value of the Bustype property.It then passes the Disk objects in the pipeline to the Get-IscisSession cmdlet, which gets the associated iSCSI sessions, and then pipes the output to the Format-Table cmdlet for simplified display.
Optional Parameters
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Runs the cmdlet in a remote session or on a remote computer.Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet.The default is the current session on the local computer.
Powershell Get Serial Number Certificate
Type: | CimSession[] |
Aliases: | Session |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Gets the disk with the specified friendly name.Enter a friendly name, or use wildcard characters to enter a name pattern.
Type: | String[] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the disk number for which to get the associated Disk object.
Type: | UInt32[] |
Aliases: | DeviceId |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Accepts a Partition object as input.The Partition CIM object is exposed by the Get-Partition cmdlet.
Type: | CimInstance |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByValue) |
Accept wildcard characters: | False |
Contains valid path information.
Type: | String[] |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies an array of serial numbers associated with disks that this cmdlet gets.
Type: | String[] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a storage job object that is associated with disks that this cmdlet gets.To obtain a storage job, use the Get-StorageJob cmdlet.
Type: | CimInstance |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByValue) |
Accept wildcard characters: | False |
Type: | CimInstance |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByValue) |
Accept wildcard characters: | False |
Specifies the storage subsystem from which this cmdlet gets disks.To obtain a StorageSubsystem object, use the Get-StorageSubSystem cmdlet.
Type: | CimInstance |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByValue) |
Accept wildcard characters: | False |
Specifies the maximum number of concurrent operations that can be established to run the cmdlet.If this parameter is omitted or a value of 0
is entered, then Windows PowerShell速 calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer.The throttle limit applies only to the current cmdlet, not to the session or to the computer.
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Gets only the disks with the specified IDs.Type one or more IDs (separated by commas).
Type: | String[] |
Aliases: | Id |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Accepts a VirtualDisk object as input.The Virtual Disk CIM object is exposed by the Get-VirtualDisk cmdlet.
Type: | CimInstance |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByValue) |
Accept wildcard characters: | False |
Accepts an iSCSIConnection object as input.The iSCSI Connection CIM object is exposed by the Get-IscsiConnection cmdlet.
Type: | CimInstance |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByValue) |
Accept wildcard characters: | False |
Accepts an iSCSISession object as input.The iSCSI Session CIM object is exposed by the Get-IscsiSession cmdlet.
Type: | CimInstance |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByValue) |
Accept wildcard characters: | False |
Inputs
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_IscsiConnection
You can pipe an iSCSIConnection object to the iSCSIConnection parameter.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_IscsiSession
You can pipe an iSCSISession object to the iSCSISession parameter.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_Partition
You can pipe a Partition object to the Partition parameter.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_VirtualDisk
You can pipe a VirtualDisk object to the VirtualDisk parameter.
Powershell Get Serial Number Only
Outputs
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_Disk
This cmdlet outputs one or more objects representing disks.
Notes
- The
Microsoft.Management.Infrastructure.CimInstance
object is a wrapper class that displays Windows Management Instrumentation (WMI) objects. The path after the pound sign (#
) provides the namespace and class name for the underlying WMI object. - Some objects such as disks might include trailing spaces in their friendly names. If you suspect that an object name could have trailing spaces, you can use a wildcard at the end of the name, for example Disk, or use the **Match* parameter to instruct Windows PowerShell to include all strings that include the specified characters, instead of only strings that include only the specified characters.
Powershell Get Serial Number From Fru
Related Links
I wanted to get the serial number assigned by Hard disk manufacturer.
The serial number is usually printed in the hard disk. Normally to get the serial number, I have to take out the hard disk.
Is it possible to know the hard drive serial number from command prompt or in other way.
Amz-al51 driver for mac. Before posting this question I have gone through this question but I am getting the error in the following screenshot:
Powershell Get Serial Number Lenovo
6 Answers
CrystalDiskInfo will display this information as well as all other S.M.A.R.T. data if the computer supports it. It's free, check it out.
If this is unable to pull the serial number then I would double check your BIOS settings and make sure that you have S.M.A.R.T. enabled.
If this is not an option I'd Google the computer model specs to see if there is a BIOS update that supports it, if not then the computer is too old and you have to open the machine.
The Win32_PhysicalMedia class suggest that
should do the trick.
However, the WMI struct holding the DiskDrive information
specifically mentions that
SerialNumber: Number allocated by the manufacturer to identify the physical media.
Windows Server 2003 and Windows XP: This property is not available.
I know of no other way to obtain it, sorry.
Cheers,
Press Windows Key + R
type
It will show details of almost everything in the system. Locate to storage and find the details.
Use below powershell script to get the serial number of hard disk.
Get-WmiObject Win32_PhysicalMedia Format-Table Tag, SerialNumber
If you can't just pull the drive out then try:
Start > Control Panel > System > Device Manager
Expand the Disk Drive and right click the HDD you want. Select Properties > Details Tab. From the drop down select Hardware IDs. It should be listed in there.
EDIT: Since it was different in device manager you could try cmd command:
wmic diskdrive get serialnumber
See if this matches.
It availaible in WindowsXP, you need use command
wmic diskdrive get pnpdeviceid
you receive something like this
KINGSTON SV300S37A60G IDEDISKKINGSTON_SV300S37A60G___________________580ABBF03035323042363237423436304335393820202020
where last long number (3035323042363237423436304335393820202020) it's serial number in Hex.
After you getting this number, try to use this program or python-script to view correct SN.
Thanks.