Saturday, September 21, 2013
How to configure an authoritative time server in Windows Server
Open registry editor
1. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Type = NTP
2. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags = 5
3. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer\Enabled = 1
4. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\NtpServer = some1.ntp.server,0x1 some2.ntp.server,0x1
5. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient\SpecialPollInterval = 900
6. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\MaxPosPhaseCorrection = 72000 (decimal)
7. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\MaxNegPhaseCorrection = 72000 (decimal)
Close Registry Editor.
At the command prompt, type the following command to restart the Windows Time service, and then press Enter:
net stop w32time && net start w32time
Monday, July 29, 2013
How to Reset Your Forgotten Domain Admin Password on Server 2008 R2
Replacing Utilman.exe
Boot off the Windows disk and select the “Repair your computer” option from the lower left-hand corner.
Follow through until you get to the option to open the Command Prompt, which you’ll want to select.
First you’ll want to type in the following command to backup the utilman.exe file:
MOVE C:\Windows\System32\Utilman.exe C:\Windows\System32\Utilman.exe.bak
Now you will need to copy cmd.exe and rename it Utilman.exe:
COPY C:\Windows\System32\cmd.exe C:\Windows\System32\Utilman.exe
Now you can go ahead and reboot your machine. When its done booting up again and you are at the Logon screen click on the Ease of access icon.
The command prompt window will be displayed. To change the password type:
net user administrator *
Once you press enter you will asked to set a new password and then confirm it, when entering your new password don’t worry if you can’t see them as you type, they are invisible, they are however being remembered.
Once you’re logged in again don’t forget to delete Utilman.exe and then rename Utilman.exe.bak back to plain old Utilman.exe.
Reference: www.howtogeek.com/106333/how-to-reset-your-forgotten-domain-admin-password-on-server-2008-r2
Monday, September 17, 2012
How to combat DoS attacks without any firewall in Windows?
- Run regedit.exe
- Navigate to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters registry subkey.
- From the Edit menu, select New, DWORD Value.
- Enter the name TcpMaxHalfOpen, then press Enter.
- Double-click the new value, set it to 100, then click OK.
- Enter the name TcpMaxHalfOpenRetried, then press Enter.
- Double-click the new value, set it to 80, then click OK.
- Enter the name SynAttackProtect, then press Enter.
- Double-click the new value, set it to 1, then click OK.
- Reboot the machine.
Hardening the TCP/IP stack to SYN attacks
by Mariusz Burdach
Most people know how problematic protection against SYN denial of service attacks can be. Several methods, more or less effective, are usually used. In almost every case proper filtering of packets is a viable solution. In addition to creating packet filters, the modification of the TCP/IP stack of a given operating system can be performed by an administrator. This method, the tuning of the TCP/IP stack in various operating systems, will be described in depth in this article.
While SYN attacks may not be entirely preventable, tuning the TCP/IP stack will help reduce the impact of SYN attacks while still allowing legitimate client traffic through. It should be noted that some SYN attacks do not always attempt to upset servers, but instead try to consume all of the bandwidth of your Internet connection. This kind of flood is outside the scope of scope of this article, as is the filtering of packets which has been discussed elsewhere.
What can an administrator do when his servers are under a classic, non-bandwidth flooding SYN attack? One of most important steps is to enable the operating system's built-in protection mechanisms like SYN cookies or SynAttackProtect. Additionally, in some cases it is worth tuning parameters of the TCP/IP stack. Changing the default values of stack variables can be another layer of protection and help better secure your hosts. In this paper I will concentrate on:
Increasing the queue of half-open connections (in the SYN RECEIVED state).
Decreasing the time period of keeping a pending connection in the SYN RECEIVED state in the queue. This method is accomplished by decreasing the time of the first packet retransmission and by either decreasing the number of packet retransmissions or by turning off packet retransmissions entirely. The process of packet retransmissions is performed by a server when it doesn't receive an ACK packet from a client. A Packet with the ACK flag finalizes the process of the three-way handshake.
Note that an attacker can simply send more packets with the SYN flag set and then the above tasks will not solve the problem. However, we can still increase the likelihood of creating a full connection with legitimate clients by performing the above operations.
We should remember that our modification of variables will change the behavior of the TCP/IP stack. In some cases the values can be too strict. So, after the modification we have to make sure that our server can properly communicate with other hosts. For example, the disabling of packet retransmissions in some environments with low bandwidth can cause a legitimate request to fail. In this article you will find a description of the TCP/IP variables for the fallowing operating systems: Microsoft Windows 2000, RedHat Linux 7.3, Sun Solaris 8 and HP-UX 11.00. These variables are similar or the same in current releases.
Definitions: SYN flooding and SYN spoofing
A SYN flood is a type of Denial of Service attack. We can say that a victim host is under a SYN flooding attack when an attacker tries to create a huge amount of connections in the SYN RECEIVED state until the backlog queue has overflowed. The SYN RECEIVED state is created when the victim host receives a connection request (a packet with SYN flag set) and allocates for it some memory resources. A SYN flood attack creates so many half-open connections that the system becomes overwhelmed and cannot handle incoming requests any more.
To increase an effectiveness of a SYN flood attack, an attacker spoofs source IP addresses of SYN packets. In this case the victim host cannot finish the initialization process in a short time because the source IP address can be unreachable. This malicious operation is called a SYN spoofing attack.
We need to know that the process of creating a full connection takes some time. Initially, after receiving a connection request (a packet with SYN flag set), a victim host puts this half-open connection to the backlog queue and sends out the first response (a packet with SYN and ACK flags set). When the victim does not receive a response from a remote host, it tries to retransmit this SYN+ACK packet until it times out, and then finally removes this half-open connection from the backlog queue. In some operating systems this process for a single SYN request can take about 3 minutes! In this document you will learn how to change this behavior. The other important information you need to know is that the operating system can handle only a defined amount of half-open connections in the backlog queue. This amount is controlled by the size of the backlog queue. For instance, the default backlog size is 256 for RedHat 7.3 and 100 for Windows 2000 Professional. When this size is reached, the system will no longer accept incoming connection requests.
How to detect a SYN attack
It is very simple to detect SYN attacks. The netstat command shows us how many connections are currently in the half-open state. The half-open state is described as SYN_RECEIVED in Windows and as SYN_RECV in Unix systems.
We can also count how many half-open connections are in the backlog queue at the moment. In the example below, 769 connections (for TELNET) in the SYN RECEIVED state are kept in the backlog queue.
# netstat -n -P tcp | grep SYN_RECV | grep :23 | wc -l 769
The other method for detecting SYN attacks is to print TCP statistics and look at the TCP parameters which count dropped connection requests. While under attack, the values of these parameters grow rapidly.
In this example we watch the value of the TcpHalfOpenDrop parameter on a Sun Solaris machine.
# netstat -s -P tcp | grep tcpHalfOpenDrop
tcpHalfOpenDrop = 473
It is important to note that every TCP port has its own backlog queue, but only one variable of the TCP/IP stack controls the size of backlog queues for all ports.
The backlog queue
The backlog queue is a large memory structure used to handle incoming packets with the SYN flag set until the moment the three-way handshake process is completed. An operating system allocates part of the system memory for every incoming connection. We know that every TCP port can handle a defined number of incoming requests. The backlog queue controls how many half-open connections can be handled by the operating system at the same time. When a maximum number of incoming connections is reached, subsequent requests are silently dropped by the operating system.
As mentioned before, when we detect a lot of connections in the SYN RECEIVED state, host is probably under a SYN flooding attack. Moreover, the source IP addresses of these incoming packets can be spoofed. To limit the effects of SYN attacks we should enable some built-in protection mechanisms. Additionally, we can sometimes use techniques such as increasing the backlog queue size and minimizing the total time where a pending connection in kept in allocated memory (in the backlog queue).
Built-in protection mechanisms
Operating system: Windows 2000
The most important parameter in Windows 2000 and also in Windows Server 2003 is SynAttackProtect. Enabling this parameter allows the operating system to handle incoming connections more efficiently. The protection can be set by adding a SynAttackProtect DWORD value to the following registry key:
HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
In general, when a SYN attack is detected the SynAttackProtect parameter changes the behavior of the TCP/IP stack. This allows the operating system to handle more SYN requests. It works by disabling some socket options, adding additional delays to connection indications and changing the timeout for connection requests.
When the value of SynAttackProtect is set to 1, the number of retransmissions is reduced and according to the vendor, the creation of a route cache entry is delayed until a connection is made. The recommended value of SynAttackProtect is 2, which additionally delays the indication of a connection to the Windows Socket until the three-way handshake is completed. During an attack, better performance in handling connections is achieved by disabling the use of a few parameters (these parameters are usually used by the system during the process of creating new connections). The TCPInitialRTT parameter, which defines the time of the first retransmission, will no longer work. It's impossible to negotiate the window size value. Also, the scalable windows option is disabled on any socket.
As we can see, by enabling the SynAttackProtect parameter we don't change the TCP/IP stack behavior until under a SYN attack. But even then, when SynAttackProtect starts to operate, the operating system can handle legitimate incoming connections.
The operating system enables protection against SYN attacks automatically when it detects that values of the following three parameters are exceeded. These parameters are TcpMaxHalfOpen, TcpMaxHalfOpenRetried and TcpMaxPortsExhausted.
To change the values of these parameters, first we have to add them to the same registry key as we made for SynAttackProtect.
The TcpMaxHalfOpen registry entry defines the maximum number of SYN RECEIVED states which can be handled concurrently before SYN protection starts working. The recommended value of this parameter is 100 for Windows 2000 Server and 500 for Windows 2000 Advanced Server.
TcpMaxHalfOpenRetried defines the maximum number of half-open connections, for which the operating system has performed at least one retransmission, before SYN protection begins to operate. The recommended value is 80 for Windows 2000 Server, and 400 for Advanced Server.
The TcpMaxPortsExhausted registry entry defines the number of dropped SYN requests, after which the protection against SYN attacks starts to operate. Recommended value is 5.
Operating system: Linux RedHat
RedHat, like other Linux operating systems, has implemented a SYN cookies mechanism which can be enabled in the following way:
# echo 1 > /proc/sys/net/ipv4/tcp_syncookies
Note that to make this change permanent we need to create a startup file that sets this variable. We must do the same operation for other UNIX variables described in this paper because the values for these variables will return to default upon system reboot.
SYN cookies protection is especially useful when the system is under a SYN flood attack and source IP addresses of SYN packets are also forged (a SYN spoofing attack). This mechanism allows construction of a packet with the SYN and ACK flags set and which has a specially crafted initial sequence number (ISN), called a cookie. The value of the cookie is not a pseudo-random number generated by the system but instead is the result of a hash function. This hash result is generated from information like: source IP, source port, destination IP, destination port plus some secret values. During a SYN attack the system generates a response by sending back a packet with a cookie, instead of rejecting the connection when the SYN queue is full. When a server receives a packet with the ACK flag set (the last stage of the three-way handshake process) then it verifies the cookie. When its value is correct, it creates the connection, even though there is no corresponding entry in the SYN queue. Then we know that it is a legitimate connection and that the source IP address was not spoofed. It is important to note that the SYN cookie mechanism works by not using the backlog queue at all, so we don't need to change the backlog queue size. More information about SYN cookies can be found at http://cr.yp.to/syncookies.html.
Also note that the SYN cookies mechanism works only when the CONFIG_SYNCOOKIES option is set during kernel compilation.
The next section will describe other useful methods of protection against SYN attacks. I would like to emphasize that under heavy SYN attacks (like Distributed SYN flooding attack) these methods may help but still not solve the problem.
Increasing the backlog queue
Under a SYN attack, we can modify the backlog queue to support more connections in the half-open state without denying access to legitimate clients. In some operating systems, the value of the backlog queue is very low and vendors often recommend increasing the SYN queue when a system is under attack.
Increasing the backlog queue size requires that a system reserve additional memory resources for incoming requests. If a system has not enough memory for this operation, it will have an impact on system performance. We should also make sure that network applications like Apache or IIS can accept more connections.
Operating system: Windows 2000
Aside from described above TcpMaxHalfOpen and TcpMaxHalfOpenRetried variables, in Windows 2000 the number of connections handled in the half-open state can be set through a dynamic backlog. Configuration of this dynamic backlog is accomplished via the AFD.SYS driver. This kernel-mode driver is used to support Windows Socket applications like FTP and Telnet. To increase the number of half-open connections, AFD.SYS provides four registry entries. All of these values, corresponding to AFD.SYS, are located under the following registry key:
HKLM\System\CurrentControlSet\Services\AFD\Parameters
The EnableDynamicBacklog registry value is a global switch to enable or disable a dynamic backlog. Setting it to 1 enables the dynamic backlog queue.
MinimumDynamicBacklog controls the minimum number of free connections allowed on a single TCP port. If the number of free connections drops below this value, then additional free connections are created automatically. Recommended value is 20.
The MaximumDynamicBacklog registry value defines the sum of active half-open connections and the maximum number of free connections. When this value is exceeded, no more free connections will be created by a system. Microsoft suggests that this value should not exceed 20000.
The last DynamicBacklogGrowthDelta parameter controls the number of free connections to be created when additional connections are necessary. Recommended value: 10.
The table below shows the recommended values for the AFD.SYS driver:
| Subkey Registry Value Entry | Format | Value |
|---|---|---|
| EnableDynamicBacklog | DWORD | 1 |
| MinimumDynamicBacklog | DWORD | 20 |
| MaximumDynamicBacklog | DWORD | 20000 |
| DynamicBacklogGrowthDelta | DWORD | 10 |
Operating system: Linux
A tcp_max_syn_backlog variable defines how many half-open connections can be kept by the backlog queue. For instance 256 is a total number of half-open connections handled in memory by Linux RedHat 7.3. The TCP/IP stack variables can be configured by sysctl or standard Unix commands. The following example shows how to change the default size of the backlog queue by the sysctl command:
# sysctl -w net.ipv4.tcp_max_syn_backlog="2048"
Operating system: Sun Solaris
In Sun Solaris there are two parameters which control the maximum number of connections. The first parameter controls the total number of full connections. The second tcp_conn_req_max_q0 parameter defines how many half-open connections are allowed without the dropping of incoming requests. In Sun Solaris 8, the default value is set to 1024. Using the ndd command we can modify this value.
# ndd -set /dev/tcp tcp_conn_req_max_q0 2048
Operating system: HP-UX
In HP-UX, a tcp_syn_rcvd_max TCP/IP stack variable is responsible for control of the maximum number of half-open connections in the SYN RECEIVE state. In HP-UX 11.00 this value is set to 500. We can change this value by using the ndd command, similar to the one used in a Sun Solaris system.
# ndd -set /dev/tcp tcp_syn_rcvd_max 2048
Decreasing total time of handling connection request
As we know, SYN flooding/spoofing attacks are simply a series of SYN packets, mostly from forged IP addresses. In the last section we tried to increase the backlog queue. Now that our systems can handle more SYN requests, we should decrease the total time we keep half-open connections in the backlog queue. When a server receives a request, it immediately sends a response with the SYN and ACK flags set, puts this half-open connection into the backlog queue, and then waits for a packet with the ACK flag set from the client. When no response is received from the client, the server retransmits a response packet (with the SYN and ACK flags set) several times (depending on default value in each operating system) by giving the client a chance to send the ACK packet again. It is clear that when the source IP address of client was spoofed, the ACK packet will never arrive. After a few minutes the server removes this half-open connection. We can speed up this time of removing connections in the SYN RECEIVED state from the backlog queue by changing time of first retransmission and by changing the total number of retransmissions.
Another technique of protection against SYN attacks is switching off some TCP parameters that are always negotiated during the three-way handshake process. Some of these parameters are automatically turned off by mechanisms described in the first section (SynAttackProtect and Syncookies).
Now, I will describe TCP/IP stack variables which allow a decrease in the time half-open connections are kept in the backlog queue.
Operating system: Windows 2000
In Windows 2000, the default time for a first retransmission is set to 3 seconds (3000 milliseconds) and can be changed by modifying the value of the TcpInitialRtt registry entry (for every interface). For example, to decrease time of a first retransmission to 2 seconds we have to set this registry value to 2000 milliseconds in decimal format. The number of retransmissions (packets with the SYN and ACK flags set) is controlled by a TcpMaxConnectResponseRetransmissions registry parameter which has to be added to HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters registry key.
The table below contains a few examples of values and corresponding times for keeping half-open connections in the backlog queue (the time of a first retransmission is set to 3 seconds).
| Value | Time of retransmission | Total time to keep half-open connections in the backlog queue |
|---|---|---|
| 1 | in 3rd second | 9 seconds |
| 2 | in 3rd and 9th second | 21 seconds |
| 3 | in 3rd , 9th and 21st second | 45 seconds |
We can set this registry value to 0, whereby Windows doesn't try to retransmit packets at all. In this case, the system sends only one response and cancels the half-open connection after 3 seconds. This setting is ignored when its value is equal or greater than 2 and when SynAttackProtect is enabled.
Operating system: Linux RedHat
A tcp_synack_retries variable is responsible for controlling the number of retransmissions in Linux operating system. Its default value is set to 5 for most Linux operating systems, which causes the half-open connection to be removed after 3 minutes. In the below table there are calculations for other values.
| Value | Time of retransmission | Total time to keep half-open connections in the backlog queue |
|---|---|---|
| 1 | in 3rd second | 9 seconds |
| 2 | in 3rd and 9th second | 21 seconds |
| 3 | in 3rd , 9th and 21st second | 45 seconds |
Operating system: Sun Solaris
In this operating system it is impossible to turn off retransmissions of packets directly using the ndd command. Moreover, in Sun Solaris there are parameters which are non-configurable by ndd and which control the number of retransmissions (at least 3) and total time of packet retransmissions (at least 3 minutes). More information about these parameters can be found in the "Solaris 2.x - Tuning Your TCP/IP stack and More" document.
Operating system: HP-UX
For HP-UX, the time spent handling half-open connections in the backlog queue is controlled by the tcp_ip_abort_cinterval parameter. By using the ndd command we can define how long a HP-UX operating system will be waiting for the ACK packet. We can control how many retransmissions will be performed indirectly by changing this value. Have a look at the table below.
| Value | Time of retransmission | Total time to keep half-open connections in the backlog queue |
|---|---|---|
| 1000 | - | 1 seconds |
| 5000 | in 2nd second | 5 seconds |
| 10000 | in 2nd and 5th second | 10 seconds |
| 60000 | in 2nd, 5th, 11th, 23rd and 47th second | 1 minute |
We can change the time of a first retransmission by modifying tcp_rexmit_interval_initial. Intervals of subsequent retransmissions are controlled by two parameters: tcp_rexmit_interval and tcp_rexmit_interval_min. These three variables are the same as in a Sun Solaris operating system.
Summary
The methods of hardening the TCP/IP stack that are presented in this article make servers more resistant to SYN flooding and SYN spoofing - Denial of Service attacks. A modification of your default TCP/IP stack settings is also recommended during the process of securing of the operating system.
Reference:
http://www.symantec.com/connect/articles/hardening-tcpip-stack-syn-attacks
Sunday, January 29, 2012
How to determine the version and edition of SQL Server
Select @@version
An example of the output of this query is as follows:
Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) Mar 29 2009 10:11:52 Copyright (c) 1988-2008 Microsoft Corporation Express Edition (64-bit) on Windows NT 6.1(Build 7600: )
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Thai_CI_AS"

Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Thai_CI_AS" in the equal to operation.
Cause: Temp Table that was created by your sql statement use conflict collation with default collations of database or table you querying
Resolution: I install language in Control Panel > Regional and Language Settings for Thai then restart computer. After that, it works normally.
Sunday, December 11, 2011
Why does the Green Bar not appear for Google Chrome?
When accessing a secure site with a Extended Validation (EV) SSL certificate, the green bar and the company name does not display to the right of the lock icon in the Google Chrome address bar.
Resolution
- Click the Tools menu
- Select Options
- Click the Under the Hood tab
- Select the "Check for server certificate revocation" checkbox
- Click Close
If the green bar or the organization's name is still not displayed, it may be due to one of the following conditions:
- The website might not use an EV-SSL certificate. EV certificates provide extra assurance as to the identity of the website, but not all websites using SSL use EV-SSL certificates.
- The website might contain security errors, such as mixed content or expired certificates.
Firefox does not display green address bar when visiting a web site with Extended Validation certificate
When accessing a web site with an Extended Validation certificate, you may experience the following behavior:
Green bar does not appear for Firefox users
Cause
Currently, Extended Validation certificates are natively supported by Internet Explorer 7, Firefox 3.x+, Opera 9 and Safari 3.2+.
Resolution
To resolve this problem, ensure Online Certificate Status Protocol (OCSP) is enabled.
- Open Firefox browser
- From the tool bar, click Tools > Options > Advanced > Encryption tab > Validation
- Ensure Use OCSP to validate only certificates that specify an OCSP service URL is checked
Green address bar does not appear with Microsoft Internet Explorer
When accessing a website securely with Extended Validation SSL Certificate, you may experience the following behavior:
The green address bar does not appear.
This issue occurs when one of the following conditions are true:
- The Phishing Filter built into Internet Explorer 7 is not enabled
- Smart Screen Filter built into Internet Explorer 8/9 is not enabled
- Any certificate related error message prior to accessing the secure site will prevent the Green Bar from being displayed when connecting to a secure web site with an Extended Validation SSL certificate installed
- The Root CA Certificate does not exist on the computer
- The Intermediate Certificate Authority (CA) certificates are not installed on the Web server
- Non secure content displayed on the web page
Resolution
Method 1: Enable Phishing Filter/Smart Screen Filter on Internet Explorer
To resolve this problem for Internet Explorer 7, perform the following steps:
1. Open Internet Explorer 7
2. Click Tools > Phishing Filter > Turn Off/On Automatic Website checking
3. Ensure Turn on automatic Phishing Filter (recommended) is selected
4. Click OK
If web site is access through the Local Intranet zone, the phishing filter is turned off by default. To enable:
1. Open Internet Explorer 7
2. Click Tools > Internet Options > Security
3. Select Local intranet zone
4. Click Custom level
5. Under Miscellaneous, ensure Use Phishing Filter is enabled for all zones
To resolve this problem for Internet Explorer 8/9, perform the following steps:
1. Open Internet Explorer 8
2. From the top menu, click Tools > Internet Options
3. Click Advanced tab
4. Under Security, check the box Enable SmartScreen Filter
5. Click Apply > OK
If the problem persists, determine which security zone is used when accessing the website.
1. After accessing the website, in the lower right hand corner, confirm the zone: Internet, Intranet, or Trusted Site
2. From the top menu, click Tools > Internet Options > Security tab
3. Select the appropriate zone from step 1
4. Click Custom Level
5. Under Miscellaneous > Use SmartScreen Filter, click Enable
6. Click OK
Method 2: Check for possible certificate errors
The security certificate presented by this web site was not issued by a trusted certificate authority
Note: If the Root CA is not uploaded to the Windows XP machine via Windows Update, the chain of trust will not be complete and the certificate will not be trusted
The security certificate presented by this web site has expired or is not yet valid
The security certificate presented by this web site was issued for a different web site's address
Non secure content displayed on the web page. Typically these are images or scripts that reside on a server that is not secured. Links to this type of content must contain 'https'
If any of theses alerts are presented by Internet Explorer, the Green Bar will not display.
Method 3: Enable the Check for Server Certificate Revocation
- Start an Internet Explorer 7 browser session
- Go to Tools > Internet Options
- Click on the Advanced tab
- Under the Security section, check the box next to Check for server certificate revocation
- Click Apply > OK
Method 4: Ensure Update Root Certificate component is enabled
1. Click Start > Control Panel > Add or Remove Programs > Add/Remove Windows Components
2. Ensure Update Root Certificates is checked
You can download Update for Root Certificate from Microsoft.
Note: This will not take effect until after you restart Internet Explorer
The EV OID must be activated on behalf of Microsoft for the Green Bar to appear. Tentatively this is set to occur On January 31, 2007.
Tuesday, January 4, 2011
Windows x64 problem: The 'Microsoft.Jet.OLEDB. 4.0' provider is not registered on the local machine.
There is no 64 bit version of Microsoft Jet OLE DB driver.
Resolution:
1. Install lastest service pack for windows
2. Force program to run as a 32 Bit application. In order to do this, you need utility found in .NET SDK named corflags.exe.
>> corflags program.exe /32BIT+
2. For run on IIS, you need to enable 32 bit applications on IIS
>> cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
Tuesday, December 21, 2010
How to Restore SQL Server 2005 Suspect Database
If your project's database is in suspect mode, then no transaction will take place until and unless you repair your database. That causes a show stopper for your up and running application. Here, you will find a way to get out of this.
Background
Your Database is in Suspect Mode. I guess, you haven't experienced this problem till now. But, if it comes to you and if the database is LIVE, then it's time to read this article to get out of this tension.
Using the Code
If you find your database in Suspect mode, then please keep your nerve strong. Just proceed step by step what I am written below. I think you will get out of this trouble. SQL Server 2005 introduced a new DB Status called Emergency. This mode can change the DB from Suspect mode to Emergency mode, so that you can retrieve the data in read only mode. The steps are... After executing the script given below, you will get back your database in operational mode. Actually I have tried with two of my existing live systems and found no data loss.
Note: Obviously there are two more options available. Run REPAIR_ALLOW_DATA_LOSS to ensure the database is returned to a structurally and transitionally consistent state. Here are a few things to bear in mind about emergency mode repair: it's a one-way operation. Anything it does cannot be rolled back or undone. If this worries you (if someone ever got into that state, then surely don't have the healthy concern about data that they should have in the first place) then make a copy of the damaged database before you run emergency mode repair.
As it's a one-way operation, you cannot wrap it in an explicit user-transaction.
It's the only repair option available in emergency mode - if you try to use REPAIR_REBUILD, then it won't work.
Collapse
EXEC sp_resetstatus 'yourDBname';
ALTER DATABASE yourDBname SET EMERGENCY
DBCC checkdb('yourDBname')
ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('yourDBname', REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE yourDBname SET MULTI_USER
Points of Interest
You will be happy that your database as well as the application are still in workable condition. :)
License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
About the Author
Suvendu Banik
Reference: http://www.codeproject.com/KB/reporting-services/SQL_2005_Suspect_Database.aspx
Thursday, October 21, 2010
How can I check the password of the IUSR and IWAM local accounts on a machine?
You first need to update the adsutil.vbs script, which you'll find in the AdminScripts folder under the Inetpub folder, to display sensitive information (e.g., passwords) instead of just asterisks. Open the adsutil.vbs file in Notepad and search for the text "IsSecureProperty = True", replace this text with "IsSecureProperty = False" and save the file. Now run the following commands to return the passwords (/anonymoususerpass is the IUSR account; /wamuserpass is the IWAM_ account).
C:\Inetpub\AdminScripts>cscript adsutil.vbs get w3svc/anonymoususerpass
C:\Inetpub\AdminScripts>cscript adsutil.vbs get w3svc/wamuserpass
wamuserpass : (STRING) "ikI37Q"W5\[,uu%"
If you want to reset the passwords to match the passwords you had already set in Local Users and Groups, use the following command:
C:\Inetpub\AdminScripts>cscript adsutil.vbs set w3svc/anonymoususerpass "Pa55word"
anonymoususerpass : (STRING) "Pa55word"
C:\Inetpub\AdminScripts>cscript adsutil.vbs set w3svc/wamuserpass "Pa55word"
wamuserpass : (STRING) "Pa55word"
You should now run the command below to sync the password from IIS with Microsoft Transaction Server (MTS) and component services:
C:\Inetpub\AdminScripts>cscript.exe synciwam.vbs -v
IIS Applications Defined:
Name, AppIsolated, Package ID
You should now restart IIS via the "All Tasks" context menu option of the IIS server in the MMC Internet Information Services (IIS) Manager snap-in.
Retrieve the IUSR (Anonymous) password using the IIS Resource Kit Metabase Explorer
Download and install the IIS Resource Kit and used it to retrieve the password of the IUSR account (IIS Anonymous User.)
After installing the IIS Resource Kit, follow these steps to retrieve the IUSR password using the Metabase Explorer:
- Open the IIS Metabase Explorer by going to Start > All Programs > IIS Resources > Metabase Explorer > Metabase Explorer
- Go to the "View" menu and click on "Secured Data" (this will make sure the password is not displayed as asterisks) and Inherited Data (this will display any data that the web site is inheriting from the default)
- Expand the W3SVC Branch
- Expand the Branch of an IIS site that is running anonymous access
Note: To determine the ID of the IIS Site; select the "Web Sites" node in IIS and look for the Identifier column in the right pane. - Select the "Root" node and look for the AnonymousUserPass property in the right pane.
Tuesday, October 12, 2010
How To Change PostgreSQL Root Password
# su postgres
# psql -d template1
template1=# ALTER USER postgres WITH PASSWORD '${POSTGRESQL_POSTGRES_PASSWORD}';
You can replace “postgres” with any user name
Thursday, September 23, 2010
How to change the listening port for Remote Desktop
1. Start Registry Editor.
2. Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
3. On the Edit menu, click Modify, and then click Decimal.
4. Type the new port number, and then click OK.
5. Quit Registry Editor.
Thursday, August 5, 2010
Clarification of changes on "allow-recursion" and "allow-query-cache" in BIND 9.4.1
Wednesday, August 4, 2010
How to list running application pool in IIS 6.0?
You can use the command-line script iisapp.vbs, which is stored in systemroot\system32, to view any worker processes that are currently running. This command is often used for troubleshooting.
The computer issuing the command must be running Windows XP or a member of the Windows Server 2003 family. The computer that the command affects must be running a member of the Windows Server 2003 family with IIS 6.0.
!!! Important
You must be a member of the Administrators group on the local computer to run scripts and executables. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type runas /profile /User:MyComputer\Administrator cmd to open a command window with administrator rights and then type cscript.exeScriptName (include the script's full path and any parameters).
This topic includes the following information:
| • | Syntax: The order in which you must type a command and any arguments and options that follow it. |
| • | Parameters: The values that are given to variables in the command. |
| • | Examples: Sample code and an explanation of the results. |
Syntax
iisapp [/a AppPoolName | /p PID]
Parameters
/aAppPoolName
Optional. Specifies the name of a particular application pool.
/pPID
Optional. Specifies an application pool by its ID number.
Examples
Example 1:
The following command displays all of the application pools that are running on the local computer:
iisapp
In response, iisapp displays all of the currently running applications, identifying each application pool by its process ID (PID) and application pool ID (AppPoolID). Iisapp omits all of the optional parameters and accepts the default values.
W3wp.exe PID: 2232 AppPoolID: DefaultAppPool
W3wp.exe PID: 2608 AppPoolID: MyAppPool
Example 2:
Use the following command to view a specific application by entering its PID:
iisapp /p 2608
In response, iisapp displays the specified application.
W3wp.exe PID: 2608 AppPoolID: MyAppPool
Thursday, July 29, 2010
Default Seach Provider corrupt in IE8
If you upgrade IE7 to IE8 on winxp sp3, you may receive following error when you launch IE.
Resolution:
1. Click Start.
2. Click Run.
3. Type in regedit and press enter.
4. In the registry editor, expand and navigate to the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders.
5. Right click User Shell Folders.
6. Select New and then Expandable String value.
7. A new value is added in right pane.
8. Type in AppData and press enter.
9. Double click AppData.
10. Under value data type in:
%USERPROFILE%\Application Data
11. Note: If there is already AppData in the right pane, double click and correct it to %USERPROFILE%\Application Data
If the above steps do not work,
1. Click Start.
2. Click Control Panel.
3. Click User Accounts.
4. Click Create a new user account.
5. Choose appropirate name for the new user account.
6. Choose Administrator or Limited or Standard user. It's upto you.
7. Click Create.
8. Click Start, Log out from the current user account and log back in with the new one.
9. If the new user account is working for you, obviously, the old user account has got corrupted and you will have to use the new user account. Also, FYI: you can transfer old user settings and files to the new user account.
Friday, July 23, 2010
Found Solutions for Different Windows Problems
Unable to register jscript.dll, getting the following error: DllRegisterServer in jscript.dll failed.Return code was: 0x80004005.
For the above error message, we need to follow troubleshooting steps depending upon the operating system. For windows vista, we need to register the dll file in command prompt with administrator rights for which we need to follow the below steps:
1. Click Start. 2. Type in cmd. 3. Don't press enter. 4. On the top, right click cmd and click run as administrator. 5. Type in
regsvr32 jscript.dll and press enter. Now it should say DllRegisterServer in jscript.dll succeeded.
If the above error message is in windows xp pro,
1. Click Start. 2. Click Run. 3. Type in
secedit /configure /cfg %windir%\repair\secsetup.inf /db secsetup.sdb /verbose and press enter.
If it is windows xp home, run microsoft fixit at http://support.microsoft.com/kb/313222.
Please let us know whether the above steps helped or not. Even if you have any further suggestions or questions, please use Comment/Ask a question down at the bottom of the page.
----------------------------------------------------------------------------------
PROBLEM #2
Unable to install internet explorer 8, getting the following errors
Setup exit code: 0x13371337 (Undefined Error Code) or Installer Process exit code: 0x00000017.
For the above error messages, run a microsoft fixit at http://support.microsoft.com/default.aspx/kb/949220 and try to reinstall internet explorer 8. If the fixit tool does not help, we need to install internet explorer 8 in safe mode with networking with administrator login by following the below steps:
1. Restart the computer. 2. As soon as it restarts, tap F8 key on the keyboard. 3. Choose Safe mode with networking and press enter. 4. If it asks to choose your operating system, choose whatever operating system you are using such as windows xp. 5. If you are using windows xp, choose your user name Administrator. 6. If you are using windows vista, log in with your regular user account but make sure you are an administrator. 7. Now, try to reinstall internet explorer 8.
Please let us know whether the above steps helped or not. Even if you have any further suggestions or questions, please use Comment/Ask a question down at the bottom of the page.
----------------------------------------------------------------------------------
PROBLEM #3
Unable to download java, giving "Internet explorer cannot display the webpage" error, also when you try to update java from control panel, it says "Java update cannot proceed with the current internet connection settings of your system. Please check your Control Panel -> Internet Options, and make sure the settings and proxy information are correct...".
For the above error, first make sure no proxy server is configured by following the below steps:
1. Click Start. 2. Click Cotrol Panel. 3. Click Internet Options. 4. Click Connections. 5. Click LAN settings. 6. Make sure Use a proxy server for LAN....is unchecked.
If no proxy server is configured for you, the problem seems to be related to your ISP, so try using global dns servers by following the below steps:
1. Click Start. 2. Click Control Panel. 3. Click Network Connections. 4. Right click Local area connection or Wireless connection whichever saying connected and being used by you. 5. Click Properties. 6. Highlight Internet Protocol TCP/IP or Internet Protocol TCP/IP Version 4. 7. Click Properties. 8. Select Use the following DNS server address. 9. Put 4.2.2.2 next to Preferred DNS server and 4.2.2.1 next to Alternate DNS server. 10. Click OK. 11. Again, click OK.
Please let us know whether the above steps helped or not. Even if you have any further suggesions or questions, please use Comment/Ask a question down at the bottom of the page.
----------------------------------------------------------------------------------
PROBLEM #4
Unable to uninstall internet explorer 8, getting "cannot find the file" errors or other errors.
If you are getting different errors while uninstalling internet explorer 8, use internet explorer 8 removal tool from the link below. Even if it says, internet explorer 8 beta removal tool, it works fine for all versions.
http://cid-2347850efe92080a.skydrive.li ... 20V1.1.exe
Please let us know whether the above steps helped or not. Even if you have any further suggesions or questions, please use Comment/Ask a question down at the bottom of the page.
----------------------------------------------------------------------------------
PROBLEM #5
An error after opening internet explorer 8: "A program on your computer has corrupted IE8 default search provider settings. IE8 will reset the search provider setting to default setting of xxx search. IE8 will open the search provider dialog where you can change your search provider".
For the above error follow the below steps:
1. Click Start. 2. Click Run. 3. Type in regedit and press enter. 4. In the registry editor, expand and navigate to the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders. 5. Right click User Shell Folders. 6. Select New and then Expandable String value. 7. A new value is added in right pane. 8. Type in AppData and press enter. 9. Double click AppData. 10. Under value data type in
%USERPROFILE%\Application Data. 11. Note: If there is already AppData in the right pane, double click and correct it to %USERPROFILE%\Application Data
If the above steps do not work,
1. Click Start. 2. Click Control Panel. 3. Click User Accounts. 4. Click Create a new user account. 5. Choose appropirate name for the new user account. 5. Choose Administrator or Limited or Standard user. It's upto you. 6. Click Create. 7. Click Start, Log out from the current user account and log back in with the new one. 8. If the new user account is working for you, obviously, the old user account has got corrupted and you will have to use the new user account. Also, FYI: you can transfer old user settings and files to the new user account.
Please let us know whether the above steps helped or not. Even if you have any further suggesions or questions, please use Comment/Ask a question down at the bottom of the page.
----------------------------------------------------------------------------------
PROBLEM #6
Error 126: The specified module could not be found while trying to start remote access connection manager service.
1. Click Start-Run-C:\windows\system32 and press Enter.
2. Make sure rasman.dll, rasmans.dll, rasppp.dll, raschap.dll, and rastls.dll are present.
3. If any file is missing, insert the operating system cd in and copy the file by clicking Start-Run-cmd(in vista and windows 7, right click cmd and click Run as administrator).
4. Type in expand e:\i386\xxx.dl_ c:\windows\system32\xxx.dll and prese enter (wherein e: is the cd drive letter and xxx is the missing dll file).
5. If all the files are intact, click Start-run-regedit and press enter.
6. Go to HKLM/SYTEM/CurrentControlSet/Services/RasMan/PPP/EAP and delete entries other than 13,25, and 26.
7. If your problem is related to an AT&T wireless card, most probably, you will find 21 and 43 which need to be deleted.
8. Reboot the computer and the service should be started now.
Please let us know whether the above steps helped or not. Even if you have any further suggestions or questions, please use Comment/Ask a question down at the bottom of the page.
----------------------------------------------------------------------------------
PROBLEM #7
Error 1747 authentication service is unknown while trying to start WLAN auto config (wireless) service.
For the above error, simply reset winsock by
1. Start-Run-cmd (if it is windows vista or 7, right click cmd and click run as administrator).
2. Type netsh winsock reset, press enter, and restart the computer.