Link to home
Create AccountLog in
Windows OS

Windows OS

--

Questions

--

Followers

Top Experts

Avatar of baleman2
baleman2

Get List of Serial Numbers of all Domain Computers
I'm working from a Windows 7 computer connected to our domain via a VPN.
I'd like to get a list of the serial numbers of ALL computers currently running in our domain.  I'm assuming this would be done from accessing information via Active Directory.
Can a powershell command be run from my Windows 7 computer or must I run the command from the Domain Controller itself?

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of 65td65td🇨🇦

Are you referring to the hardware serial number of the computer?

I am assuming you mean the Windows server keys used to activate Windows server, and not the hardware manufacturers serial number.

In either case I am not sure how you can run ANY command that would accomplish either.

You can go into AD Users and Computers > The domain you want to see > Computers and this is the list of all the computers that are in that domain who are in your AD.

So out of curiosity I clicked on one of the computers in my AD computers group clicked on the "Attribute Editor" tab and scrolled to "serialNumber" and I'll be a **** **** **** that there is an object just for that, however you would had to have already previously set that in order for it to be filled otherwise it will be "<not set>"

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of baleman2baleman2

ASKER

To Nathan:
My AD OU named Computers populates with what you described.  The attribute is <not set>.
It is that serial number that I need to retrieve - not for just 1 computer but for all computers in our domain.
I was hoping to find a PowerShell command that would work.

To 65td:
Your link provided me with some PowerShell commands, but it looks as though I need to know the HostName of the computer before I can retrieve the serial number, as in:
Get-WMIObject -Class Win32_BIOS -ComputerName DomCon1 | Format-List SerialNumber
The above command provided me only with the serial number of DomCon1

$computers = get-adcomputer -filter * | select-object -expandproperty Name
foreach ($computer in $computers) {
$serial = Get-WMIObject -Class Win32_BIOS -ComputerName $computer | select-object -expandproperty  SerialNumber
write-output ("Computer {0} Serial Number: {1}" -f $computer,$serial)
}

Open in new window


To David:
This exact command can be copied/pasted at my powershell prompt - no changes necessary?  If so:
1) Can it be run from my own pc . . .or,
2) Must it be run from the powershell on the Domain Controller itself?

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Yeah. You would need some sort of 3rd party tool to populate that object so that you could then run that/those power shell command/s to query a DC and get every computer and that object's value, which is why I said initally I dont know of any Windows command that will populate that field and then a command to then query the newly populated fields and give you that list.

The second part I was pretty sure some AD script guru would be able to cobble something together, but its pretty useless if that field wasn't already populated (as seems to be the case).

paste it into your ISE  It should run from any computer that has the activedirectory module (rsat tools installed) otherwise run it from any dc

To David:
Apologies to you, but:
The only acronym I associate with ISE is Cisco's "Identity Services Engine".  What exactly do you mean "paste it into your ISE"?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CDDavid Johnson, CD🇨🇦

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

So sorry that I left the results of David's suggestions unanswered.  His solution was the perfect solution to my question.

hello,

what if the remote laptops are using vpn to connect to the network?

Thanks

Ric
Windows OS

Windows OS

--

Questions

--

Followers

Top Experts

This topic area includes legacy versions of Windows prior to Windows 2000: Windows 3/3.1, Windows 95 and Windows 98, plus any other Windows-related versions including Windows Mobile.