I am trying to update my AD computers using PowerShell to read the items from a CSV file. I have successfully updated the Description and other standard items, but I cannot get the non-common hidden attributes to updated. I am very green on PowerShell. I'm not even sure I'm using the correct commands.
The contents of the CSV file looks like as below:
Name = preexisting Computer object name
Description = Information I want to place in the description field (Non-hidden \ standard)
comment = Information I want to place in the comments field (Hidden field)
name,description,comment
Computer1,Computer Model - 123456789 - Office 1111,Comment1
Computer2,Computer Model - 234567891 - Office 1112,Comment2
Computer2,Computer Model - 345678912 - Office 1113,Comment3
Below is the script:
# Update Computer Description and Comments
Import-module ActiveDirectory
Import-CSV "C:\temp\Computers.csv" | % {
$Computer = $_.name
$Description = $_.description
$Comment = $_.comment
Set-ADComputer $Computer -description $Description
Set-ADComputer $Computer -comment $Comment
}