Skip to content

Instantly share code, notes, and snippets.

@AJ-Acevedo
Last active January 22, 2016 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AJ-Acevedo/ea7356c8127f7c3434eb to your computer and use it in GitHub Desktop.
Save AJ-Acevedo/ea7356c8127f7c3434eb to your computer and use it in GitHub Desktop.
Update the Description of a Windows Computer with PowerShell
# Update-Description
# Description: Update the Computer Description of a Windows Computer with PowerShell. The description is updated in both Active Direcotry and on the PC.
# Usage: UpdateDescription -computername 420XX-XXXX -description "First Last Desktop"
#
# URL: AJAlabs.com
# Author: AJ Acevedo
# Copyright (c) 2016 AJ Acevedo
# License: MIT - https://opensource.org/licenses/MIT
#
# Version: v0.4
#
Param(
[string]$computername,
[string]$description
)
function UpdateDescription() {
$OSValues = Get-WmiObject -class Win32_OperatingSystem -computername $computername
$OSValues.Description = $description
$OSValues.put()
Set-ADcomputer $computername -description $description
}
UpdateDescription
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment