Solved

Force computer to lock after 15 minutes of no activity (Windows 2000 Server & Professional)

Posted on 2004-09-16
5
2,089 Views
Last Modified: 2012-05-05
For out security policies, I need to know how to lock down a computer automatically after so many minutes of inactivity.

What would the proper registry configuration be for this type of task?  The computers are not on a domain and there are no existing policies.  I just need a simple way to use the screensave lock method but I can't find anything very specific on the web.

Thanks,

kruegerste
0
Comment
Question by:kruegerste
  • 3
  • 2
5 Comments
 
LVL 17

Expert Comment

by:Jared Luker
Comment Utility
0
 
LVL 4

Author Comment

by:kruegerste
Comment Utility
I see where it lets you set the number of seconds before the screen saver comes on but how do I get it to lock the computer so they must logon again to gain access to the computer.  

Same as Alt + Ctrl + Delete and then lockdown computer.  I want it to do this but automatically.  
0
 
LVL 17

Accepted Solution

by:
Jared Luker earned 500 total points
Comment Utility
That is what setting ScreenSaveIsSecure to 1 does.  It makes it so that once the screen saver comes on, they need to hit ctrl-alt-delete to enter their password to get back into their boxes.

Here is a vbscript that I wrote to do this.  It might need some tweaking.

Dim NoScreen, SSTimeOut, SSActive, SSLogout, Secure
Dim WshShell, WshSysEnv, WshFSO, WshNetwork
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("SYSTEM")
Set WshFSO = CreateObject("Scripting.FileSystemObject")            'File System Object
Set WshNetwork = WScript.CreateObject("WScript.Network")      'Network Object

WScript.Echo("start screen saver")

      
SSActive = WshShell.RegRead ("HKCU\Control Panel\Desktop\ScreenSaveActive")
Secure = WshShell.RegRead ("HKCU\Control Panel\Desktop\ScreenSaverIsSecure")
SSTimeOut = WshShell.RegRead ("HKCU\Control Panel\Desktop\ScreenSaveTimeOut")
SSLogout = 0


If SSActive = 0 Then
      'WScript.Echo("Screen Saver Not Active")
      WshFSO.CopyFile ScriptFiles + "\ssbezier.scr", windir + "\System32\ssbezier.scr"
      WshShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveActive","1","REG_SZ"
      WshShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaverIsSecure","1","REG_SZ"
      WshShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveTimeOut","900","REG_SZ"
      WshShell.RegWrite "HKCU\Control Panel\Desktop\SCRNSAVE.EXE", WinDir + "\System32\ssbezier.scr"
      WshShell.RegWrite "HKCU\Control Panel\Screen Saver.Bezier\Fill",""
      SSLogout = 1
Else
      If Secure = 0 Then
            'WScript.Echo("screen saver active not secure")
            WshShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaverIsSecure","1","REG_SZ"
            WshShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveTimeOut","900","REG_SZ"
            SSLogout = 1
      End If
End If

if SSTimeOut < 900 Then
      WScript.Echo("time less than 900")
      WshShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveTimeOut","900","REG_SZ"
      SSLogout = 1
End If

If SSLogout = 1 Then
      Dim oUser, Group
      Set oUser = GetObject("WinNT://hill-2k/" & objUser & ",user")
      For each Group in oUser.Groups      
            Select Case Group.Name
                  Case "LI OU System Admins"
                        WScript.Echo("Admin detected... not rebooting")
                        Exit Function
                  Case "LI OU Func Admins"
                        WScript.Echo("Admin detected... not rebooting")
                        Exit Function
            End Select
      Next
      
      if strOSVersion = "4.0" Then
            WshShell.Popup "Changes To your screen saver security settings require the computer to be rebooted",15,"Reboot for SS Changes"      
            'Reboot NT Machines
            wshShell.Run ScriptFiles & "\shutdown.exe /l /c /t:1",1,False
            WScript.Sleep(5000)
            WScript.Quit
      Else

      'Log user out on 2000/XP Machines
      Dim objWmiService
      WshShell.Popup "Changes To your screen saver security settings require you to log out and back in.",15,"Reboot for SS Changes"            
      strComputer = "."
      Set colOperatingSystems = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem")
      For Each objOperatingSystem in colOperatingSystems
      ObjOperatingSystem.Win32Shutdown(logoff)
      Next

      End If
End If
WScript.Echo("Exit screen saver")
0
 
LVL 4

Author Comment

by:kruegerste
Comment Utility
This is what it gives me but I can't find it in the registry.  It doesn't give me any path.  I used the "find" feature but still nothing.  

 Hive: HKEY_CURRENT_USER
  Key: Control Panel\Desktop
  Value Name: ScreenSaveIsSecure
  Data Type: REG_SZ
  Value: 0  

Do you know what the path is to get to this Key?
0
 
LVL 4

Author Comment

by:kruegerste
Comment Utility
Nevermind.  Thanks for your help.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

14 Experts available now in Live!

Get 1:1 Help Now