Last active
January 22, 2016 21:22
-
-
Save AJ-Acevedo/ea7356c8127f7c3434eb to your computer and use it in GitHub Desktop.
Update the Description of a Windows Computer with PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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