How to Populate Computer Model Information on Active Directory

How to Populate Computer Model Information on Active Directory

Updating the Computer Description Field in Active Directory with Computer Model Information

The computer model information is generally displayed in the description field of the computer object in the Active Directory Users and Computers console. This includes the hardware information of the computer including its manufacturer, model, and serial number. This in turn helps the administrators to obtain information about computer hardware such as the vendor, model, and serial number with ease. WMI queries and PowerShell scripts can be used to populate the description field of the computer object. The process of populating the description field with computer model information consists of the following steps.
  1. Grant permission to users for updating the computer description field
  2. Get the computer model information using a WMI query
  3. Update the description field using a PowerShell script

Granting Permission to Users for Updating the Computer Description

To populate the computer description field in Active Directory automatically, a Group Policy logon script can be used. This ensures that the data is updated at the time of start-up. This in turn requires the user to be granted the necessary access permission to update the computer objects. This permission can be granted using the Active Directory Users and Computers (ADUC) MMC snap-in, by following the steps given below.

  1. Open Active Directory Users and Computers (ADUC).
  2. Select the Advanced Features option from the View menu and ensure that this option is enabled.
  3. Right-click on the required domain from the left pane and select the Properties option.
  4. On the Security tab, click on Advanced.
  5. Click on Add and enter Authenticated Users. Click OK.
  6. From the Apply to drop-down menu, select Descendant Computer Objects.
  7. In the Permissions section, select the Read Description and Write Description checkboxes. Click OK.

Populating the Description Field with Computer Model Information using WMI Query and PowerShell Script

After granting the required permissions, the computer model information can be obtained using either a WMI query or a PowerShell script. This returns information about the vendor, model name, and the identifying number of the computer. The following WMI query can be used for this purpose.

Get-WMIObject  Win32_ComputerSystemProduct | Select Vendor, Name, IdentifyingNumber

The output of the above query would be:
Vendor – Lenovo
Name – Ideapad 320
IdentifyingNumber – PF19xxxx

The computer model information that is obtained using the above WMI query can be used to populate the description field of the computer object using PowerShell scripts. The Active Directory for Windows PowerShell module needs to be installed for this purpose.

The name of the computer whose details are to be updated is assigned to the $computer variable using the following command.

$computer = "PC-User-001"

Similarly, an array containing the list of all computers in the required organizational unit should be created. These are the computers for which the description field will be filled in. The computer model information for all these computers can then be obtained and their description fields can be updated using the PowerShell script given as follows.

  1. $computers = Get-ADComputer -Filter * -searchBase "OU=Computers,DC=ABC,DC=com"
  2. foreach ($computer in $computers)
  3. {
  4. $vendor = (Get-WMIObject-ComputerName $computer Win32_ComputerSystemProduct).Vendor
  5. $name = (Get-WMIObject-ComputerName $computer Win32_ComputerSystemProduct).Name
  6. $identifyingNumber = (Get-WMIObject-ComputerName $computer Win32_ComputerSystemProduct).IdentifyingNumber
  7. $vendor
  8. $name
  9. $identifyingNumber
  10. Set-ADComputer $computer –Description “$vendor : $name : $identifyingNumber”
  11. }
 
After this, a Group Policy Object (GPO) can be created to apply the logon script to all the computer objects within the selected organizational unit. This Group Policy Object is then linked to all the computers within the organizational unit. Thus the description fields of the computer objects in the selected organizational unit are filled in automatically with the computer model information.
    • Related Articles

    • Active Directory Computer Objects Management

      A computer object in AD is used to model a real computer in an organizational network environment. Say for example, I bought a new computer machine -01 in my organization, and want to allow people to access various organizational resources through ...
    • Active Directory Computer

      Real-world entities like Active Directory computers are fundamentally represented as objects. This video walks through Active Directory computer objects and will also give you a brief insight of its common and important attributes.  ​
    • Active Directory Computer Delegation

      The general tab When a computer is trusted for delegation it means that any services running on the local system can request services from other servers on behalf of the user. Do not trust this computer for delegation – specifies that no delegation ...
    • Active Directory Computer Delegation tab

      The general tab When a computer is trusted for delegation it means that any services running on the local system can request services from other servers on behalf of the user. Do not trust this computer for delegation – specifies that no delegation ...
    • Active Directory Computer Objects Tabs

      The general tab Some properties are assigned to a computer automatically once it’s joined to a domain, such as DNS name, Computer name, and Role etc. Even the administrator himself cannot change these properties. In the description box you can add a ...