Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

'Comment' AD Attribute for a computer

$
0
0

Hi All,

I'm having an issue adding text to the comment attribute in AD using powershell for a computer object.

I have used the follwoing (from MS technet article) to update the 'description' field but cannot use the same process for the 'comment' field.

"Import-Module ActiveDirectory
Import-CSV "D:\Dump\Scripts\CTest.csv" | ForEach-Object {
$Computer = $_.ComputerName
$Comm = $_.Comment
Set-ADComputer $Computer -comment $Comm }

obviously I changed the fields over from the MS example ($_.description & -description $desc)

even if I try and simply run the command  from powershell it doesn't work...

(WORKS)

set-adcomputer COMPUTERNAME -description DESCRIPTION_TEXT

(DOESN'T WORK)

set-adcomputer COMPUTERNAME -comment COMMENT_TEXT

Error = Set-ADComputer : A parameter cannot be found that matches parameter name 'comment'.

BUT this will pull back the current comment - I inputted some test text through AD Users n Computers

Get-ADComputer COMPUTERNAME -properties comment

Any ideas would be greatly recieved - have 2000 to update and doing via CSV is going to be MUCH easier.

Cheers


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>