0

is it possible to get the serial number of a network printer in the AD via a Powershell command?

I have several Brother printers in the AD, and their IP Addresses, and I could install any Printer on my PC and look in the driver, but is there a Powershell command where I can "put" the IP Address and get the SN without installing it?

Thanks

2 Answers 2

1

You can only get info that the OS provides it, or the driver manufacturer exposes via the OS, either using the provider's tools/apps or interfaces.

This is all there is available to check for printer information and Serial Number is not in the property options.

https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-printer

# Getting Printer Information

Get-Command -Name '*printer*'
Find-Script -Name '*printer*'
Find-Module -Name '*printer*'

(Get-CimInstance -Class Win32_Printer).Name
(Get-CimInstance -Class Win32_Printer)[6] | 
Get-Member

($PrinterName = ((Get-CimInstance -Class Win32_Printer)[6]).Name)

Get-Printer -Name $PrinterName | 
Get-Member | 
Select-Object -Property Name, MemberType

Get-PrinterPort -ComputerName $env:COMPUTERNAME

Get-PrinterDriver -ComputerName $env:COMPUTERNAME | 
Select-Object -Property '*'

Get-PrinterDriver
((Get-PrinterDriver).Name)[3] | 
Select-Object -Property '*'

Get-PrinterProperty -ComputerName $env:COMPUTERNAME -PrinterName $PrinterName

(Get-PrinterProperty -ComputerName $env:COMPUTERNAME -PrinterName $PrinterName).Value

Get-PrintConfiguration -PrinterName $PrinterName | 
Get-Member | 
Select-Object -Property Name, MemberType
0

Disclosure: I am not a printer person.

I just pulled a list of all properties for a few printers I have in AD. Unfortunately, I do not see serial number as being a published property. So, in general, I do not believe what you are asking for is possible--but again, I am not a dedicated printer person. Perhaps your environment is different? Here is a way to check if it is an AD property for you:

Get-ADObject -filter { name -eq "Brother_Printer_Name" } -Properties *

In my environment, these are the available methods and properties available on an AD printer object:


   TypeName: Microsoft.ActiveDirectory.Management.ADObject

Name                            MemberType            Definition
----                            ----------            ----------
Contains                        Method                bool Contains(string propertyName)
Equals                          Method                bool Equals(System.Object obj)
GetEnumerator                   Method                System.Collections.IDictionaryEnumerator GetEnumerator()
GetHashCode                     Method                int GetHashCode()
GetType                         Method                type GetType()
ToString                        Method                string ToString()
Item                            ParameterizedProperty Microsoft.ActiveDirectory.Management.ADPropertyValueCollection Item(stri…
CanonicalName                   Property              System.String CanonicalName {get;}
CN                              Property              System.String CN {get;}
Created                         Property              System.DateTime Created {get;}
createTimeStamp                 Property              System.DateTime createTimeStamp {get;}
Deleted                         Property              System.Boolean Deleted {get;}
Description                     Property              System.String Description {get;set;}
DisplayName                     Property              System.String DisplayName {get;set;}
DistinguishedName               Property              System.String DistinguishedName {get;set;}
driverName                      Property              System.String driverName {get;set;}
driverVersion                   Property              System.Int32 driverVersion {get;set;}
dSCorePropagationData           Property              Microsoft.ActiveDirectory.Management.ADPropertyValueCollection dSCorePro…
flags                           Property              System.Int32 flags {get;set;}
instanceType                    Property              System.Int32 instanceType {get;}
isDeleted                       Property              System.Boolean isDeleted {get;}
LastKnownParent                 Property              System.String LastKnownParent {get;}
location                        Property              System.String location {get;set;}
Modified                        Property              System.DateTime Modified {get;}
modifyTimeStamp                 Property              System.DateTime modifyTimeStamp {get;}
Name                            Property              System.String Name {get;}
nTSecurityDescriptor            Property              System.DirectoryServices.ActiveDirectorySecurity nTSecurityDescriptor {g…
ObjectCategory                  Property              System.String ObjectCategory {get;}
ObjectClass                     Property              System.String ObjectClass {get;set;}
ObjectGUID                      Property              System.Nullable`1[[System.Guid, System.Private.CoreLib, Version=5.0.0.0,…
portName                        Property              Microsoft.ActiveDirectory.Management.ADPropertyValueCollection portName …
printBinNames                   Property              Microsoft.ActiveDirectory.Management.ADPropertyValueCollection printBinN…
printCollate                    Property              System.Boolean printCollate {get;set;}
printColor                      Property              System.Boolean printColor {get;set;}
printDuplexSupported            Property              System.Boolean printDuplexSupported {get;set;}
printEndTime                    Property              System.Int32 printEndTime {get;set;}
printerName                     Property              System.String printerName {get;set;}
printKeepPrintedJobs            Property              System.Boolean printKeepPrintedJobs {get;set;}
printMaxResolutionSupported     Property              System.Int32 printMaxResolutionSupported {get;set;}
printMaxXExtent                 Property              System.Int32 printMaxXExtent {get;set;}
printMaxYExtent                 Property              System.Int32 printMaxYExtent {get;set;}
printMediaReady                 Property              Microsoft.ActiveDirectory.Management.ADPropertyValueCollection printMedi…
printMediaSupported             Property              Microsoft.ActiveDirectory.Management.ADPropertyValueCollection printMedi…
printMemory                     Property              System.Int32 printMemory {get;set;}
printMinXExtent                 Property              System.Int32 printMinXExtent {get;set;}
printMinYExtent                 Property              System.Int32 printMinYExtent {get;set;}
printOrientationsSupported      Property              Microsoft.ActiveDirectory.Management.ADPropertyValueCollection printOrie…
printPagesPerMinute             Property              System.Int32 printPagesPerMinute {get;set;}
printRate                       Property              System.Int32 printRate {get;set;}
printRateUnit                   Property              System.String printRateUnit {get;set;}
printShareName                  Property              Microsoft.ActiveDirectory.Management.ADPropertyValueCollection printShar…
printSpooling                   Property              System.String printSpooling {get;set;}
printStaplingSupported          Property              System.Boolean printStaplingSupported {get;set;}
printStartTime                  Property              System.Int32 printStartTime {get;set;}
priority                        Property              System.Int32 priority {get;set;}
ProtectedFromAccidentalDeletion Property              System.Boolean ProtectedFromAccidentalDeletion {get;set;}
sDRightsEffective               Property              System.Int32 sDRightsEffective {get;}
serverName                      Property              System.String serverName {get;set;}
shortServerName                 Property              System.String shortServerName {get;set;}
uNCName                         Property              System.String uNCName {get;set;}
url                             Property              Microsoft.ActiveDirectory.Management.ADPropertyValueCollection url {get;…
uSNChanged                      Property              System.Int64 uSNChanged {get;}
uSNCreated                      Property              System.Int64 uSNCreated {get;}
versionNumber                   Property              System.Int32 versionNumber {get;set;}
whenChanged                     Property              System.DateTime whenChanged {get;}
whenCreated                     Property              System.DateTime whenCreated {get;}

If serial number is a published property, then you should be able to pull it this way:

Get-ADObject -filter { name -eq "Brother_Printer_Name" } -Properties serialNumber | Select serialNumber

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .