Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "COMPUTERNAME"
Set objRegistry = GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system"
strValueName = "ScForceOption"
strValue = 0
objRegistry.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
If IsNull(strValue) Then
Wscript.Echo "The registry key does not exist."
ElseIf strValue = 1 Then
Wscript.Echo "Force Smart Card Logon is now enabled on " & strComputer
ElseIf strValue = 0 Then
Wscript.Echo "Force Smart Card Logon is now disabled on " & strComputer
End If
rem Use DOS prompt with admin rights. Useage: cscript ***.vbs //nologo //S
|