Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-09-13
5
Medium Priority
?
1,199 Views
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
0
Comment
Question by:MOSADMIN
5 Comments
 
LVL 1

Expert Comment

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

http://support.microsoft.com/kb/310516/en-us
0
 
LVL 3

Assisted Solution

by:kooswillem
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

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\LanmanServer\Parameters]
"ServiceDll"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,\
  00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,\
  73,00,72,00,76,00,73,00,76,00,63,00,2e,00,64,00,6c,00,6c,00,00,00
"ServiceDllUnloadOnStop"=dword:00000001
"NullSessionPipes"=hex(7):6e,00,65,00,74,00,6c,00,6f,00,67,00,6f,00,6e,00,00,\
  00,6c,00,73,00,61,00,72,00,70,00,63,00,00,00,73,00,61,00,6d,00,72,00,00,00,\
  62,00,72,00,6f,00,77,00,73,00,65,00,72,00,00,00,00,00
"autodisconnect"=dword:0000000f
"enableforcedlogoff"=dword:00000001
"enablesecuritysignature"=dword:00000000
"requiresecuritysignature"=dword:00000000
"restrictnullsessaccess"=dword:00000001
"Lmannounce"=dword:00000000
"Size"=dword:00000001
"AdjustedNullSessionPipes"=dword:00000002
"Guid"=hex:cd,d5,3d,19,02,3a,98,4c,bb,0f,97,01,f4,47,07,49
"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:
http://blogs.technet.com/b/heyscriptingguy/archive/2005/12/07/how-can-i-change-the-description-for-a-computer.aspx
0
 
LVL 14

Accepted Solution

by:
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

0
 

Author Closing Comment

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

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

A brief introduction to what I consider to be the best editor for PowerShell.
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline

772 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