Solved

Need a script to change the value of Registry Dword

Posted on 2014-02-19
7
1,178 Views
Last Modified: 2014-02-25
I am looking for a script to modify the Reg_Dword value for the following registry Key as 2:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Lsa\restrictanonymous
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Lsa\restrictanonymoussam

Thnx
0
Comment
Question by:jmohan0302
  • 4
  • 3
7 Comments
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 39871702
Plain batch (save as Whatever.cmd); and the correct key btw is ...\CurrentControlSet\Control\Lsa:
reg.exe add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v "restrictanonymous" /t REG_DWORD /d 2 /f
reg.exe add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v "restrictanonymoussam" /t REG_DWORD /d 2 /f

Open in new window

0
 

Author Comment

by:jmohan0302
ID: 39872326
I ran the above command, but the value didnt change....
Also want to know how to do this by vbscript
Thnx
0
 
LVL 83

Expert Comment

by:oBdA
ID: 39872552
Works just fine here. Any error message?
Note that as this is in HKLM, you need to run this elevated if UAC is active.
What's the output of
reg.exe query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa"

Open in new window

0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:jmohan0302
ID: 39872981
Below is the output of the reg query, you could see the value of DWORD is not changed. Thnx

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Mohan>cd\

C:\>reg.exe query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa"

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
    auditbaseobjects    REG_DWORD    0x0
    auditbasedirectories    REG_DWORD    0x0
    crashonauditfail    REG_DWORD    0x0
    fullprivilegeauditing    REG_BINARY    00
    Bounds    REG_BINARY    0030000000200000
    LimitBlankPasswordUse    REG_DWORD    0x1
    NoLmHash    REG_DWORD    0x1
    Notification Packages    REG_MULTI_SZ    DPPassFilter\0scecli
    Security Packages    REG_MULTI_SZ    kerberos\0msv1_0\0schannel\0wdigest\0ts
pkg\0pku2u
    Authentication Packages    REG_MULTI_SZ    msv1_0
    LsaPid    REG_DWORD    0x270
    SecureBoot    REG_DWORD    0x1
    ProductType    REG_DWORD    0x6
    disabledomaincreds    REG_DWORD    0x0
    everyoneincludesanonymous    REG_DWORD    0x0
    forceguest    REG_DWORD    0x0
    restrictanonymous    REG_DWORD    0x0
    restrictanonymoussam    REG_DWORD    0x1

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\AccessProviders
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Audit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Credssp
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Data
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\GBG
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\JD
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Skew1
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\SSO
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\SspiCache

C:\>
0
 
LVL 83

Expert Comment

by:oBdA
ID: 39873203
Any error message when running the "reg add" commands?
Did you run the "reg add" commands from an elevated prompt?
0
 

Author Comment

by:jmohan0302
ID: 39873573
No error message. Yes ran from elevated command prompt
0
 
LVL 83

Expert Comment

by:oBdA
ID: 39873615
Can you please repost the exact command you ran to set the values?
Note that in your question, you had an incorrect registry path; check if the values appear directly under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Lsa (note that there's no key "Control" between "CurrentControlSet" and "Lsa"). If so, correct the path and try again.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

816 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now