PowerShell for Windows Admins

Jul 16 2017   3:56AM GMT

Change a computer’s description

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Tags:
CIM
Powershell

The Win32_OperatingSystem class exposes the machines Description. This is how you can easily change a computer’s description.

PS> Get-CimInstance -ClassName Win32_OperatingSystem | select Description

Description
-----------

PS> Get-CimInstance -ClassName Win32_OperatingSystem | Set-CimInstance -Property @{Description = 'Richards Laptop'}
PS> Get-CimInstance -ClassName Win32_OperatingSystem | select Description

Description
-----------
Richards Laptop

You can see that the description is originally blank. Get the CimInstance of Win32_OperatingSystem and pipe it to Set-CimInstance. The property to change and its new value are held in the hash table that’s the value given to the –Property parameter. You can modify multiple properties at once – just add them as property-value pairs to the hash table

2  Comments on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.
  • pa1adin
    On my machine (Winy) it exposes the Operating System's Description, not, as the article title claims, the Machine Description.
    0 pointsBadges:
    report
  • Richard Siddaway
    On my Windows 10 machine it returns the description of the machine PS> Get-CimInstance -ClassName Win32_OperatingSystem | select description description ----------- Richards Laptop which matches the description in Control panel -> System -> Advanced system settings -> Computer name tab -> computer description field can you show me your code that produces the operating system's description
    8,280 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: