Hi,
The script below works on Windows PowerShell but doesn't work on PowerShell Studio 2017. I kept getting an error and I don't know what it means.
I've been trying to find a workaround for the last 2 days and I am stuck. What I am trying to do is have the script identify my computer and update the computer description to "SAMPLE DESCRIPTION" ...Can I please get some help?
Duckie
---Script---
$OSValues = Get-WmiObject -class Win32_OperatingSystem -computername "DUCKIE"
$OSValues.Description = "SAMPLE DESCRIPTION"
$OSValues.put()
---Error---
ERROR: Exception calling "Put" with "0" argument(s): "Access denied "
Description Updater.ps1 (18, 1): ERROR: At Line: 18 char: 1
ERROR: + $OSValues.put()
ERROR: + ~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
ERROR: + FullyQualifiedErrorId : DotNetMethodException
ERROR:
*** PowerShell Script finished. ***
>> Execution time: < 1 second
>> Script Ended
Change Computer Description
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.