0

I'm fairly new to scripting in PowerShell, therefore, please pardon my skill...

I have this mini project to update AD computers descriptions based on the following format from a CSV file I have: last user logged in, full name of that user, IP address of the machine, Computer manufacturer and model, serial number

jdrit | Joe Dirt | 10.10.10.10 | Dell OptiPlex 380 | 123456

... I searched the internet, but seems that everything needs to be done via WMCI object call. I was able to complie some code

$computers = Get-ADComputer 
foreach ($computer in $computers)
{
$vendor = (Get-WMIObject -ComputerName $computer.Name Win32_ComputerSystemProduct).Vendor
$name = (Get-WMIObject -ComputerName $computer.Name Win32_ComputerSystemProduct).Name
$identifyingNumber = (Get-WMIObject -ComputerName $computer.Name Win32_ComputerSystemProduct).IdentifyingNumber
$vendor
$name
$identifyingNumber
Set-ADComputer $computer –Description “$vendor | $name | $identifyingNumber”
}

Would someone help a brother out? or point me in the right direction.

Help is greatly appreciated

  • Nice that you posted some code. Where is it going wrong? What error message? Please edit the question and update. Do not reply in the comments. – DavidPostill Dec 19 '18 at 13:45
  • There is no error. I just need help completing the script. For example, how do I tell the script to look at a CSV file for the computer name I'm trying to update the description for? I also need help ID the WMI object to get the IP, last user and user full name. – Chris Dec 19 '18 at 21:56

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.