Friday, December 7, 2007

Auto lock the system after Autologon and send notification.

The steps outlined below would help you with three things:

  1. Autologon to a system with a particular account
  2. Send a notification mail when that account is logged in to the system after a reboot
  3. Lock the system automatically once the account has been logged on

Step 1 - Enable Autologon:

  1. Go to Start > Run and put "regedit.exe" and click "Ok"
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon in Registry Editor
  3. Change the REG_SZ "DefaultUserName" value to the username you want to autologon to the system
  4. Change the REG_SZ "DefaultPassword" value to the password of the user you want to autologon to the system. (If the key does not exist then do create it)
  5. Change the REG_SZ "DefaultdomainName" value to the domain name you wish to logon to (If the key does not exist then do create it)
  6. Add a new REG_SZ "AutoAdminLogon" and set the value to 1
  7. Close Registry editor

Step 2 - Prepare notification files:

  1. Create a directory C:\Autologon;
  2. Create the files chkLogtime.vbs, Locksystem.cmd and Delchklog.cmd with the contents mentioned in Annexure I below

Step 3 - Setup up notification and autolock:

  1. Go to Start > Run and put "regedit.exe" and click "Ok"
  2. Navigate to HKEY_USERS\<SID of particular user>\software\Microsoft\Windows\CurrentVersion\Run in Registry Editor
  3. Add a new REG_SZ "ChkLogtime" and set the value to C:\Autologon\ChkLogtime.vbs
  4. Add a new REG_SZ "LockSystem" and set the value to C:\Autologon\Locksystem.cmd

Step 4 - Enable notification:

  1. Open Group Policy Object Editor
  2. Navigate to Local Computer Policy\Computer Configuration\Windows Settings\Scripts\ (Startup/shutdown)
  3. Double click on Shutdown in the right hand pane
  4. Click Add and Browse to the file C:\Autologon\Delchklog.cmd
  5. Click OK twice and close Group Policy Object Editor

NOTES:

  1. The Autologon would not work if the LegalNotice warning window is enabled at the domain level. You might have to do additional configuration to disable this.
  2. Automatic reboots will not work unless you specify ‘/F’ switch in your reboot script.

Annexure I


ChkLogTime.vbs

Dim WShell,SrvName
Set objFSO = Wscript.CreateObject("Scripting.FileSystemObject")
Set WShell = WScript.CreateObject("WScript.Shell")
If objFSO.FileExists("C:\Autologon\ChkLogTimeskip.txt") Then
wscript.Quit
Else
Set objFile = objFSO.CreateTextFile("C:\Autologon\ChkLogTimeskip.txt")
SrvName = Trim(WShell.ExpandEnvironmentStrings("%COMPUTERNAME%"))
User=Trim(WShell.ExpandEnvironmentStrings("%USERNAME%"))
LogTime= User &" is successfully logged onto " & SrvName &" after scheduled reboot at "& Now
objFile.writeline LogTime
objfile.close
Call SendMailAlerts(LogTime, User, SrvName)
End IF
Wscript.Quit
#################### Send Email Alerts ########################
Function SendMailAlerts(LogTime, User, SrvName)
RecipientList ="mukulag@gmail.com"
smtpsrv = "smtp.mukulag.com"
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "MyServer@mukulag.com"
objEmail.To = RecipientList
objEmail.Subject = User & " has logged on succesfully to " & SrvName " at "  & Now
objEmail.TextBody = LogTime
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpsrv
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
End Function
'##################### End Send Email Alerts ###########################

Locksystem.cmd

rundll32.exe user32.dll, LockWorkStation

DelChkLog.cmd

Del C:\Autologon\ChkLogTimeskip.txt /F

-------------- End of Document -----------------

Tags: Windows Server 2003

Published Date: 20071207

Monday, November 19, 2007

Important and basic Windbg commands

!analyze –v :analyzes the dump file and provides a best possible diagnosis of the same

!sympath :shows path to your symbol files

lm :lists all loaded modules in memory

lmf :list loaded modules with full path

lmt :list loaded modules with last modified timestamp

!lmi <module name> :Shows header information about the module, including the date and time, which can often tell you whether you're running an older version of a program and need to upgrade

vertarget :Shows information about the system on which you are debugging

!peb :Shows the PEB (process environment block) including DLL information

.trap :Dump a trap frame

.chain :Lists all loaded debugger extensions

-------------- End of Document -----------------

Tags: Windows XP, Windows Server 2000, Windows Server 2003

Published Date: 20071109

Tuesday, November 13, 2007

i8042prt failed to load on boot

When you boot up your computer you get a message that atleast one service failed to start. On checking the eventlogs you figure out that i8042prt failed to load. You do not face this issue on all your computers but mostly on 'headless' servers.

You get the following error message in Windows event logs.

Event Type:                 Error
Event Source:              Service Control Manager
Event Category:           None
Event ID:                     7026
Date:                          11/13/2007
Time:                         9:51:01 AM
User:                          N/A
Description:
The following boot-start or system-start driver(s) failed to load: i8042prt

To view the complete article please click here

 

 

 


Latest ps2 games

Are you a party maniac?

Do you like to party?

Opportunity to earn and party as well

DONT LEAVE THIS PAGE NOW.

:::::CHECK THIS SITE before you move on::::::

Fly this holiday anywhere around the world & save on huge on cheapest airfare using an exclusive CheapOair coupon Code HOLIDAY10. Simply plug in this coupon code when buying your airline ticket at CheapOair.com and save $10 on all domestic & international flights. Coupon Code Valid till Dec 2008

Infuse new life in your OLD PC

Repair Your Windows XP

-------------- End of Document -----------------

Tags: Windows Server 2003

Published Date: 20071113

Monday, November 12, 2007

Finding NIC information remotely using WMIC commands

WMIC is a very useful and very under utilized interface for server / OS management provided in Windows. One very common example that generally requires logging in to the server is to check / set Network card properties. At a command prompt type WMIC and then /? to find the available interfaces that can be queried or set.

To check NIC Configuration tyep the following sequence of commands at the command prompt. For example:

WMIC
/NODE:<hostname>
NICCONFIG Get DNSHostName

NICCONFIG Get DNSDomainSuffixSearchOrder

-------------- End of Document -----------------

Tags: Windows XP, Windows Server 2000, Windows Server 2003

Published Date: 20071112

Thursday, October 25, 2007

How to create a user-defined service in Windows

Execute the following command at the command promt. You need to have Windows Resource Kit installed on the box. ‘C:\Program Files\Resource Kit\Instsrv.exe <my Service> C:\Program Files\Resource Kit\Srvany.exe’

  1. Open Registry editor and go to the following key. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<my service>
  2. From the Edit menu, click Add Key. Type the following and click OK:
    Key Name: Parameters
    Class : <leave blank>
  3. Select the Parameters key and from the Edit menu, click Add Value. Type the following and click OK

Value Name: Application
Data Type : REG_SZ
String : <path>\<application.ext>
where <path>\<application.ext> is the drive and full path to the application executable including the extension (i.e., C:\WinNT\Notepad.exe)

-------------- End of Document -----------------

Tags: Windows XP, Windows Server 2000, Windows Server 2003

Published Date: 20071025