Skip to main content

Posts

Showing posts from 2021

PowerShell script to update computers' “Description” field

Hello All, There are some requirements to update Active Directory Computer's Description field with the computer details like Vender, Identification number/Serial number, Operation system installed to date, etc.. How to do this? Of course, we will use PowerShell to perform this task. Also, be aware that we can do this for Active Directory User's description field as well. $computers = Get-Content C:\PSScript\Description\coplist.txt $output = foreach ($computer in $computers) { $WMI=Get-WMIObject -ComputerName $Computer Win32_ComputerSystemProduct $vendor = $wmi.Vendor.name $name = $wmi.Name $identifyingNumber =$wmi.IdentifyingNumber #$InstallDate = ([WMI]'').ConvertToDateTime((Get-WmiObject -ComputerName $computer Win32_OperatingSystem).InstallDate) $vendor $name $identifyingNumber #$InstallDate #get current Description details $CurrentDescription = (Get-ADComputer $computer -Properties * | Select -Property Description).description $Current...