# Change Computer Description

**URL:** <https://forums.powershell.org/t/change-computer-description/14907>\
**Category:** PowerShell Help\
**Created:** [September 7, 2020, 4:38am UTC](https://forums.powershell.org/t/change-computer-description/14907 "2020-09-07T04:38:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielburt123](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@danielburt123](https://forums.powershell.org/u/danielburt123)\
**Post date:** [September 7, 2020, 4:38am UTC](https://forums.powershell.org/t/change-computer-description/14907/1 "2020-09-07T04:38:30Z")

</div>

Hi All

Been digging about to find a script to change an Computer Object Description from a TXT file.

Would be looking at Having column A as the Computer name and Column B as the description

Im guessing Get-ADObject would get the description but not sure how to change (Very New to powershell)

Thanks

Dan

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [September 7, 2020, 4:58am UTC](https://forums.powershell.org/t/change-computer-description/14907/2 "2020-09-07T04:58:18Z")

</div>

You should keep searching. There are thousands of examples for tasks like this available even here on [Powershell.org](http://Powershell.org).

The get an AD computer object you can use [Get-ADComputer](https://docs.microsoft.com/en-us/powershell/module/addsadministration/get-adcomputer?view=win10-ps) and to set an AD computer object you can use [Set-ADComputer](https://docs.microsoft.com/en-us/powershell/module/activedirectory/set-adcomputer?view=winserver2012-ps). I assume your TXT file is actually a CSV file. So you can use [Import-CSV](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/import-csv?view=powershell-7) to read the content. Then you use a loop either with [foreach](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_foreach?view=powershell-7) or [Foreach-Object](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-7) to glue everything together. 😉

Please, always read the complete help including the examples for the cmdlets you’re about to use to learn how to use them. Another great source for scripts or modules is the [PowershelLGallery](https://www.powershellgallery.com) or [StackOverflow](https://stackoverflow.com/questions/tagged/powershell). You can learn how to code in Powershell when you analyze the code others share with the world.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [September 7, 2020, 5:33am UTC](https://forums.powershell.org/t/change-computer-description/14907/3 "2020-09-07T05:33:34Z")

</div>

For the record, there is nothing that needs moderation in Olaf’s reply - which was helpful, and strewn with links to further reading.

They correctly suggest that OP might:

- Import the text file using Import-CSV
- Loop through each record using foreach or ForEach-Object
- Use Set-ADComputer (which has a Description parameter) to modify the descriptions

If there are still issues, post the code here and folk will be able to help.

---

<div class="post-metadata">

**Author:** ![danielburt123](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@danielburt123](https://forums.powershell.org/u/danielburt123)\
**Post date:** [September 7, 2020, 5:43am UTC](https://forums.powershell.org/t/change-computer-description/14907/4 "2020-09-07T05:43:07Z")

</div>

Hi This is the code below

CSV format is

Name, Description

---

<div class="post-metadata">

**Author:** ![danielburt123](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@danielburt123](https://forums.powershell.org/u/danielburt123)\
**Post date:** [September 7, 2020, 5:45am UTC](https://forums.powershell.org/t/change-computer-description/14907/5 "2020-09-07T05:45:13Z")

</div>

```
Get-Content 'C:\Temp\Test\Test Description.csv' |
ForEach {
    Get-ADComputer $PSItem.Name |
    Set-ADComputer $PSItem.Name -Description $PSItem.Description
}
```

&nbsp;

&nbsp;

&nbsp;

```

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [September 7, 2020, 6:22am UTC](https://forums.powershell.org/t/change-computer-description/14907/6 "2020-09-07T06:22:22Z")

</div>

Did you actually read my answer? Get-Content -\> Import-CSV !!! And you actually don’t need Get-ADComputer when your CSV file contains the correct name of the computer account.

---

<div class="post-metadata">

**Author:** ![danielburt123](https://avatars.discourse-cdn.com/v4/letter/d/ccd318/32.png) [@danielburt123](https://forums.powershell.org/u/danielburt123)\
**Post date:** [September 8, 2020, 1:11am UTC](https://forums.powershell.org/t/change-computer-description/14907/7 "2020-09-08T01:11:29Z")

</div>

```
`Import-Module ActiveDirectory
Import-CSV "Enter File Path Here" | % {
$Computer = $_.ComputerName
$Desc = $_.Description
Set-ADComputer $Computer -Description $Desc
}`
```

&nbsp;

&nbsp;

Got it working through this way thanks for the help

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:28pm UTC](https://forums.powershell.org/t/change-computer-description/14907/8 "2024-05-16T20:28:57Z")

</div>


