On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
set objShell = wscript.createobject("wscript.shell")
strComputer = Wscript.Arguments.Item(0)
If strComputer = "" Then strComputer = InputBox("Enter Computer name to Disable:", "CCL Disable")
If strComputer <> "" Then
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
strEntryName = "SCForceOption"
dwValue = 0
objReg.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath, strEntryName, dwValue
If (Err.Number = 0) or (Err.Number = 9) Then
wscript.echo strComputer & " SUCCESS! "& vbCrLf & "Smart Card Access Not Required Now" & _
vbCrLf &
"Upon login a GPO will reset the computer to Smart Card only."
Else If (Not Err.Number = 0) or (Not Err.Number = 9) Then
wscript.Echo "Error: "& vbCrLf & strComputer & " not found or no access.."
End If
End If
End If
No comments:
Post a Comment