Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How do i change registry keys on a remote computer with powershell 2?

Posted on 2010-09-13
Medium Priority
Last Modified: 2012-05-10
I am trying to find a way to change the value of a registry key on a lot of computers. The key i want to change is basically the 'Computer Description' which is located in HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\LanmanServer\Parameters\srvcomment
. Anyone know how this is possible with powershell or even any other way this can be done remotly.
 Thanks in advance
Question by:MOSADMIN
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 33661340
this artical explain every thing you want to know

Assisted Solution

kooswillem earned 600 total points
ID: 33661372
1. Export your registry key
2. This will give something like this:

Windows Registry Editor Version 5.00

"srvcomment"="Description changed by script"

3. Delete all irrelevant value lines
4. copy the *.reg file to each workstation
5. Double click the file or execute it by script.

Or use the information on this page:
LVL 14

Accepted Solution

Ben Personick (Previously QCubed) earned 1400 total points
ID: 33669482

You have Windows Batch scripting as on of yoru zones, asuming a batch file is an acceptable method then you can easily edit a remote computer's registry file however you like assuming that you have administrator credentials to that machine as follows:

REG ADD "\\ComputerName\HKLM\SYSTEM\ControlSet001\Services\LanmanServer\Parameters" v/ srvcomment /t REG_SZ /d "This will be the new Description of the Computer!" /f

For a bit more likely usage in a script see attached.
SET "Cmp=RemoteComputerName"
SET "Key=HKLM\SYSTEM\ControlSet001\Services\LanmanServer\Parameters
SET "Item=srvcomment"
SET "Data=This will be the new Description of the COmputer!"

REG ADD "\\%cmp%\%Key%" /v %Item% /t REG_SZ /d "%Data%" /f

Open in new window


Author Closing Comment

ID: 33670140
cheers guys
LVL 14
ID: 33671590
Thanks for rhe points, glad to help

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question ( here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question