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