Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This VBscript prompts for a computer name or IP Address, connects to that system’s registry over the network and changes the scforceoption key to allow for immediate logon without a smart card.
- Many organizations now require CAC cards or another type of smart card to logon to workstations. A common way to enforce this is to use the Interactive logon: Require smart card group policy setting. When there is a problem with smart card authentication, this setting makes it difficult for troubleshooting.
- ‘******************************************************************************
- ‘cac_bypass.vbs
- ‘
- ‘Changes registry key on remote computer to allow logon without CAC card ‘ ‘Jason Hofferle
- ’21 June 2007
- ‘ ‘****************************************************************************** Option Explicit Const HKEY_LOCAL_MACHINE = &H80000002 Dim objReg, strComputer
- strComputer = InputBox(“Computer Name or IP Address”)
- On Error Resume Next
- Set objReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & strComputer & “\root\default:StdRegProv”)
- objReg.SetDwordValue HKEY_LOCAL_MACHINE, “SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system”, “scforceoption”, 0
- If Err <> 0 Then
- WScript.Echo “Error changing registry key on ” & strComputer
- Else
- WScript.Echo “Registry Key changed on ” & strComputer
- End if
- Set objReg = Nothing
- If you are not familiar with power shell and VB Script, then you could use a computer with the same administrator account setup (same user name and password) to remotely access your computer registry.
- 1. Login to the source machine.
- 2. Go to RUN and type ‘REGEDIT’. Press Enter
- 3. This will launch the Registry Editor utility
- 4. Now go to File menu and click on ‘Connect Network Registry’, as seen in the below picture
- 5. Type in the name of the target computer in the pop up window and press OK
- 6. If Target computer is not completely out of network, the Registry settings will be loaded
- 7. Now, you can use the Registry of remote computer to diagnose and troubleshoot the issue
- 8. Make sure that you have taken a backup of Registry settings before editing
- 9. Follow the registry path below
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system
- 10. Look for the registry key scforceoption
- 11. Change its value to 0
Advertisement
Add Comment
Please, Sign In to add comment