Link to home
Start Free TrialLog in
Avatar of jmohan0302
jmohan0302

asked on

Need a script to change the value of Registry Dword

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
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jmohan0302
jmohan0302

ASKER

I ran the above command, but the value didnt change....
Also want to know how to do this by vbscript
Thnx
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

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:\>
Any error message when running the "reg add" commands?
Did you run the "reg add" commands from an elevated prompt?
No error message. Yes ran from elevated command prompt
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.