Friday, 13 July 2012

How to lock computers when idle by using GPO

What I wanted to do is that, after my computer has been idle for 3 minutes, it should lock itself. How to achieve this is one of the trouble for me for almost two days. I have been digging around the net, but no answer. I tried to find myself in GPO (Group Policy Editor), but I don’t find the option directly.
But many articles I read on the net pointed me that I can changed four options in GPO. But that is for screensaver. I tweak a bit to achieve what I want. Remember I have told you guys about how to create shortcut to lock computer. Well, I used that tweak.
Here are the steps that I took:
  • First go to Start –>> gpedit.msc
  • Go to User Configuration –>> Administrative Templates –>> Control Panel –>> Display

There are many options there, but you just need to change four of them as follow.

  • For screen saver option, just choose Enabled.
  • For screen saver executable, choose Enabled and then type “rundll32 user32.dll,LockWorkStation
  • For password protect the screen saver, choose Enabled.
  • For screen saver timeout, choose Enabled and then type the amount of time you want to lock your computer in seconds. (For example, if you want to lock your computer after three minutes of idle time, type 180)
That’s it. Next time if you’re away, you don’t have to worry about some other would invade your computer.
BtoN’s Tips : I have tested this on Vista and should work on Windows XP too. For screen saver timeout, if I set value less than 60, it won’t work.

Sunday, 1 July 2012

Error: 1418 fails to connect sql 2008 mirror server

Error 1418, fails to connect sql 2008 mirror server:

  • The server network address can not be reached
  • Alter failed
  • Error 1418
  • Insufficient Log Data
  • Error 1478
Start with: In this example we are inside a DOMAIN. We have a domain user called khan_machine
1)      Machine A, Machine B with Sqlserver installed. NO XP or other kind of firewalls ON.
2)      khan_machine is local admin in both machines. Also is a sysadmin user in both sqlservers.
3)      khan_machine  is the MSSQLSERVER service account in both machines
4)      Machine A is gonna be the PRINCIPAL, B the MIRROR.
5)      Log on in my machine as khan_machine
6)      Open Sql server Studio. Connect to both machines using windows authenticacion.
7)      Create a New Database in A (you may need to have sysadmin role to khan_machine using sa) create a table, add some data
8)       Backup the new DB (Full backup) with .bak extension
9)       Backup the new DB (Transaction log) with .trn extension
10)    Copy the both files to a location in B machine.
11)     Restore .bak into a new DB using NORECOVERY option
12)     Restore .trn into the previous DB using NORECOVERY option
13)    Go to Machine A, open a new query
14)    Take a look to the endpoints
Run this syntax in QA:
SELECT type_desc, port FROM sys.tcp_endpoints;
SELECT name,role,state_desc FROM sys.database_mirroring_endpoints;
15)   Delete existing ones (DROP ENDPOINT [NAME])
16)   Create a new endopoint



Run this syntax in QA:
CREATE ENDPOINT [Mirroring]
AS TCP (LISTENER_PORT = 5023)
FOR DATA_MIRRORING (ROLE = PARTNER, ENCRYPTION=DISABLED)
17)   Start it
ALTER ENDPOINT [Mirroring]
STATE = STARTED
AS TCP (LISTENER_PORT = 5023)
FOR database_mirroring (ROLE = PARTNER);
GO
18)   Do steps 13 to 17 in machine B.
19)   Return to machine A. Query.
20)   Lets link to our partner in machine B. First ensure you can see it with ping and telnet to the port.
ALTER DATABASE NAME
SET PARTNER =’TCP://MACHINENAME:5023′
21)   Repeat step 20 from MACHINE B pointing to MACHINE A
22)   Note: Refresh the both databases in the UI, you should see the role and status of the mirror beside the database UI object.
23)   Lets test them: Add some new data in Machine A database.
24)   Then, right click over database, then mirror, then in the form select “FAILOVER”, then say yes.
25)   Refresh the 2 databases in the UI you should see the new status and roles changed.
26)   Open Machine B databse, the new data should be there.
To establish any mirroring session (with or without certificates) you must use FQDN (Fully Qualified Domain Names) machine name.domain.com.  ** Before going on, be sure that you can reach the 3 machines with a single PING. Also, is a good practice to ensure that you can reach a telnet call over the FQDN + the port you plan to use (5022 in this example)** 
FIX: Over the post above. When establishing a mirroring session using machine accounts (not certificates, so you are inside a DOMAIN)  ensure your 3 mssqlservices are running under NETWORK SERVICE account

support Link:-

http://addarr.me/2011/06/20/error-1418-fails-to-connect-sql-2008-mirror-server/
 

Friday, 18 May 2012

Setup SQL Server 2008 Maintenance Plan Email Notifications

For most of the SQL installs that I maintain, nightly SQL dumps to disk and then copy to tape is my preferred backup method. I use a simple maintenance plan that dumps all user databases to the local disk and then a cleanup task that purges backup files older than a set number of days. An email alert with either success or fail in the subject line is sent out after each maintenance plan task is completed. This article will review step by step how to add email notifications to your existing SQL 2008 maintenance plan.

First step is to configure Database Mail. Open Microsoft SQL Server Management Studio then right-click on Database Mail > select Configure Database Mail.


Skip the welcome screen and select Next on the Select Configuration Task window.






Create new profile > fill out Profile name > Select Add under SMTP accounts:

Fill out New Database Mail Account info:
Configure Profile Security > check Public > set as Default > Next > Finish > close

Send test email. Right-click on Database Mail
Fill out test info, select Send Test Email.
Check inbox, select OK on the confirmation screen. If you dont recieve test email then double check and verify smtp settings.
Next step is to configure Operators. Under Object Explorer right-click on Operators >
New Operator

Fill out New Operator info (minimum name and email address)
Select OK.
Next, right click on designated maintenance plan (assuming one is already configured) and select Modify
This should bring up the design window with the current tasks
From the Toolbox window Drag and drop Notify Operator Task to Design window twice. One for success and the other for fail.
Connect the backup database task to each Notify Operator Task and make sure the arrows are pointing down
Designate one of the Notify Operator Task objects connection arrows as Failure. Right click on connection and select Failure. This will turn the connection arrow red.

Double click each Notify Operator Task > check which operators to notify if there are more than one > fill out Subject and Body fields > select OK
Save Maintenance Plan and test.

How to Create an IWAM User Account in XP

1.    Creating an Account
o    1 Click the Windows "Start" button and select "Run." In the textbox, enter "regedit" and press "Enter." This opens the Windows registry.
o    2 Navigate to the registry folder at "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp."
o    3 Right-click the "InetStp" directory and select "New DWORD Value" from the menu.
o    4 Type "DisableUserAccountRestore" in the key textbox and leave the default value. Press "OK."
o    5 Close the Windows registry window.
o    6 Click the Windows "Start" button and select "Run." In the textbox, type "cmd" and press "Enter."
o    7 Type "iisreset" in the command prompt and press "Enter." This command resets the IIS server and      automatically reestablishes the "IWAM" and "IUSR" accounts.

Read more: How to Create an IWAM User Account | eHow.com http://www.ehow.com/how_5164710_create-iwam-user-account.html#ixzz1fB6Yh8MN

Friday, 20 April 2012

Microsoft SQL Server 2008 Service Pack 2(10.00.1600.22) right now we are using in sreego

You can write in Query window to find which version of SQL Server 2008 is running ?

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
(or)
SELECT  @@Version
Microsoft SQL Server 2008 Service Pack 2 (SP2) is now available for download.

http://www.microsoft.com/download/en/details.aspx?id=12548

SQL Server 2008SQL Builds Version


Supported Link - To Check All version in SQL server 2008&2005&2000.

http://sqlsecurity.com/FAQs/SQLServerVersionDatabase/tabid/63/Default.aspx


Patch LevelPSS OnlyLinkBuildSorted By Build In Descending OrderVersion
2008 R2 SP1 + Cumulative Update 3GO2,78910.50.2789
2008 R2 SP1 + Cumulative Update 2GO2,77210.50.2772
2008 R2 SP1 + Cumulative Update 1GO2,76910.50.2769
2008 R2 + SP1GO2,50010.50.2500
2008 R2 + SP1 CTPGO2,41810.50.2418
2008 R2 + Cumulative Update 9GO1,80410.50.1804
2008 R2 + Cumulative Update 8GO1,79710.50.1797
2008 R2 + Q2494086GO1,79010.50.1790
2008 R2 + Cumulative Update 7GO1,77710.50.1777
2008 R2 + Cumulative Update 6GO1,76510.50.1765
2008 R2 + Cumulative Update 5GO1,75310.50.1753
2008 R2 + Cumulative Update 4GO1,74610.50.1746
2008 R2 + Cumulative Update 3GO1,73410.50.1734
2008 R2 + Cumulative Update 2GO1,72010.50.1720
2008 R2 + Cumulative Update 1GO1,70210.50.1702
RTMN/A1,60010.50.1600.1
RC 0N/A1,45010.50.1450.3
SQL Server 2008 Builds
 Patch LevelPSS OnlyLinkBuildSorted By Build In Descending OrderVersion
2008 + Service Pack 3GO5,50010.00.5500
2008 SP2 + Cumulative Update 6GO4,32110.00.4321
2008 SP2 + Cumulative Update 5GO4,31610.00.4316
2008 SP2 + Q2494094GO4,31110.00.4311
2008 + Cumulative Update 4 for SP2GO4,28510.00.4285
2008 + Cumulative Update 3 for SP2GO4,27910.00.4279
2008 + Cumulative Update 2 for SP2GO4,27210.00.4272
2008 + Cumulative Update 1 for SP2GO4,26610.00.4266
2008 SP2 + Q2494089GO4,06410.00.4064
2008 + Service Pack 2GO4,00010.00.4000
2008 + Cumulative Update 16 for SP1GO2,85010.00.2850
2008 + Cumulative Update 15 for SP1GO2,84710.00.2847
2008 SP1 + Q2494100GO2,84110.00.2841
2008 + Cumulative Update 14 for SP1GO2,82110.00.2821
2008 + Cumulative Update 13 for SP1GO2,81610.00.2816
2008 + Cumulative Update 12 for SP1GO2,80810.00.2808
2008 + Q2413738GO2,80410.00.2804
2008 + Cumulative Update 10 for SP1GO2,79910.00.2799
2008 + Cumulative Update 9 for SP1GO2,78910.00.2789
2008 + Cumulative Update 8 for SP1GO2,77510.00.2775
2008 + Cumulative Update 7 for SP1GO2,76610.00.2766
2008 + Q978839GO2,76010.00.2760
2008 SP1 + Q978791GO2,75810.00.2758
2008 + Cumulative Update 6 for SP1GO2,75710.00.2757
2008 + Cumulative Update 5 for SP1GO2,74610.00.2746
2008 + Q976761GO2,74010.00.2740
2008 + Cumulative Update 4 for SP1GO2,73410.00.2734
2008 + Cumulative Update 3 for SP1GO2,72310.00.2723
2008 + Cumulative Update 2 for SP1GO2,71410.00.2714
2008 + Q970507GO2,71210.00.2712
2008 + Cumulative Update 1 for SP1GO2,71010.00.2710
2008 + Service Pack 1GO2,53110.00.2531
2008 + Cumulative Update 10GO1,83510.00.1835
2008 + Cumulative Update 9GO1,82810.00.1828
2008 + Cumulative Update 8GO1,82310.00.1823
2008 + Q973601GO1,81810.00.1818
2008 + Cumulative Update 6GO1,81210.00.1812
2008 + Cumulative Update 5GO1,80610.00.1806
2008 + Cumulative Update 4GO1,79810.00.1798
2008 + Cumulative Update 3GO1,78710.00.1787
2008 + Q958186 (Cumulative HF2, available by request.)GO1,77910.00.1779
2008 + Q958611GO1,77110.00.1771
2008 + Q956717GO1,76310.00.1763
2008 + Q957387GO1,75510.00.1755
2008 + Q956718GO1,75010.00.1750
2008 RTMGO1,60010.00.1600.22
2008 February CTPGO1,30010.00.1300.13
2008 July CTP (requires Virtual Server 2005 R2)GO1,04910.00.1049.14
2008 June CTPGO1,01910.00.1019.17