Wednesday, April 29, 2009

Deleted Files are shown while performing search on Windows Vista

In order to view correct search results we should rebuild search index.

Start --> Run --> control srchadmin.dll


Search Database will be automaticly reindexed.

Read more...

Tuesday, April 28, 2009

Disable Cisco Password Recovery

Cisco devices permits to password recovery by default during the reload system. But if person has a physical access to devices he can change password.For this reason, you may want to disable password recovery procedure.

Use the “no service password-recovery” command
When you do this carefully read the warning message.

Router(config)#no service password-recovery
WARNING:
Executing this command will disable password recovery mechanism.
Do not execute this command without another plan for
password recovery.
Are you sure you want to continue? [yes/no]: yes
Router(config)#
Read more...

Block Dictionary Attack on Cisco

To block dictionary attack on Cisco routing and switching devices we can use login block- for command.
By using this command we can block for ‘x’ seconds after failed ‘y’ logins are tried within ‘z’ seconds.
The following example shows how block login access for 100 seconds after 4 failed login attempts within 20 seconds:

login block-for 100 attempts 4 within 20

During this block period all types of login attempts( Telnet, SSH, and HTTP) are denied.

But it is possible to exclude IP address for this blocking.
Ex: Exclude 192.168.1.0 Network (C Class)

login quiet-mode access-class 10
access-list 101 permit ip 192.168.1.0 0.0.0.255 any
Read more...

View Possible Bad indexes on SQL Database

Execute the following code to view possible bad indexes in SQL Database;

SELECT object_name(s.object_id) AS 'Table', i.name AS 'Index ', i.index_id,
user_updates AS 'Total Number of Writes', user_seeks + user_scans + user_lookups AS 'Total Number of Reads',
user_updates - (user_seeks + user_scans + user_lookups) AS 'Difference'
FROM sys.dm_db_index_usage_stats AS s WITH (NOLOCK)
INNER JOIN sys.indexes AS i WITH (NOLOCK)
ON s.object_id = i.object_id
AND i.index_id = s.index_id
WHERE objectproperty(s.object_id,'IsUserTable') = 1
AND s.database_id = db_id()
AND user_updates > (user_seeks + user_scans + user_lookups)
AND i.index_id > 1
ORDER BY 'Difference' DESC, 'Total Number of Writes' DESC, 'Total Number of Reads' ASC;


Read more...

View SQL Server Hardware Information by SQL Commands

Execute the following Command to view detailed CPU , Memory information.

SELECT cpu_count AS 'Logical CPU Count', hyperthread_ratio AS 'Hyperthread Ratio',
cpu_count/hyperthread_ratio As 'Physical CPU Count',
physical_memory_in_bytes/1048576 AS 'Physical Memory (MB)'
FROM sys.dm_os_sys_info;



Read more...

Monday, April 27, 2009

Hide Users from Global Address List on Exchange 2007

Open Exchange Management Shell and Execute the command Below;

Set-Mailbox "Mailbox Name" -HiddenFromAddressListsEnabled $true






Read more...

Enable HTTPS-HTTP Bridging on the TS Gateway

Open TS Gateway Manager.

In the TS Gateway Manager console tree, right click to the TS Gateway server, click Properties.





On the SSL Bridging tab, select the Use HTTPS-HTTP bridging check box, click OK.

A warning message will appear, stating that for the SSL bridging settings to take effect, you must recycle the default application pool of IIS. If you want to recycle the default application pool now click Yes. To recycle the default application pool manually later, click No.


ISA Server Configuration for TS Gateway

Read more...

Friday, April 24, 2009

View SQL Server Database Columns Collations that different from Database

Execute the code below to find out which columns have different collation.




SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, COLLATION_NAME FROM information_schema.columnsWHERE COLLATION_NAME IN (SELECT DISTINCT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNSEXCEPT(SELECT DATABASEPROPERTYEX('sds', 'Collation')UNION ALLSELECT NULL))


Read more...

Wednesday, April 22, 2009

Get Creation Time for SQL Database

Execute The Command Below;

select @@servername + ' '+ convert(varchar(20),crdate,111) + ' '+ [Name] from sys.sysdatabases order by crdate desc



Read more...

Get Last Modified Date for SQL Server Objects

Execute the command below;


SELECT name
FROM sys.objects
WHERE DATEDIFF(D,modify_date, GETDATE()) <>




Read more...

Get SQL Server Version

Execute the command below on SQL Server Management Studio

select @@version
Read more...

Monday, April 20, 2009

Block Conficker Script ISA 2004 & ISA 2006

Download the script file from the link above.

Block_Conficker_Script

Execute on the server that ISA server installed by double clicking the file.

New HTTP signatures will be automaticly created.



Read more...

Friday, April 17, 2009

Disable Autorun via Group Policy

In order to disable autorun features of all drives in domain computers follow these steps below.

Open Group Policy Object Editor , and edit releated Domain Policy.

Locate Computer Policy\Computer Configuration\Administrative Templates\System in the left pane then find "Turn Off Autoplay" in the right pane.







Double click and set feature to enable set Turn of Autoplay to : All Drives

Disable Autorun in Vista;

Open : Gpedit.msc

Locate the following policy;

Local Computer Policy\Computer Configuration\Administrative Templates\Windows Components\AutoPlay Policies


Read more...

Thursday, April 16, 2009

SQL 2005 Processes Detailed Status Query

Use the quey below to find detailed information about processes.
How many process are working? , How many are sleeping..., and the total number of processes.

SELECT COUNT(*) AS ProcessStatusCount,CASE Status
WHEN 'Running' THEN 'Number of Process Currently Running One or More Requests '
WHEN 'Sleeping ' THEN 'Number of Process Currently Sleeping'
ELSE 'Dormant – Session resets
END Status
FROM sys.dm_exec_sessions GROUP BY Status


Read more...

Exchange 2007 Mailbox Size

Use the command below on Exchange Management Shell to get Mailbox Sizes on Exchange 2007.

Get-MailboxStatistics -database “Mailbox Database” Select DisplayName, TotalItemSize Format-Table



Read more...

Wednesday, April 15, 2009

W32Time Error Event ID:48

Possible reason is you have problem about connecting to time server or time server is experiencing diffuculties.

List of time servers is available at ;
http://support.microsoft.com/kb/262680

After choosing time server follow the steps below;

net stop w32time
w32tm /unregister
w32tm /register
net time /setsntp:TimeServerIPNumber
net start w32time

If you want to use a FQDN instead of the IP address as time server, add ",0x1" at the end of the net time command

net time /setsntp:time-a.nist.gov,0x1


Read more...

Block or Allow Google Earth Through Firewall

In order to deny or allow access to Google Earth , block or allow access to these address on your firewall;

http://maps.google.com/
http://auth.keyhole.com/
http://kh.google.com/
Read more...

View SQL 2005 Database Logical File Name

Execute the EXEC sp_helpfile command on New Query window.
First Columns indicates the logical name of database file(s).


Read more...

Windows 2008 Certification Paths

WinServer2008-CertPaths ew

Read more...

Friday, April 10, 2009

Check if Group Policy Applied on Domain Group

You can check if your Group Policy is applied on Group by using ,
GPRESULT command.

Start -> Run -> (Execute the Commands Below) .

GPRESULT
GPRESULT /USER targetusername /V
GPRESULT /S system /USER targetusername /SCOPE COMPUTER /Z
GPRESULT /S system /U username /P password /SCOPE USER /V


Read more...

Check If Group Policy Applied on Client

You can check if group policy applied on client by using "Resultant set of Group Policy" Console

Execute Start -> Run -> rsop.msc










After policy is processed;

Check if your Group Policy is applied on Client successfully.




Read more...

Thursday, April 9, 2009

Disconnect all users from SQL Database

Run the code below on SQL Management Studio,

DECLARE @User VARCHAR(8000)
SELECT @user=COALESCE(@user,'')+'Kill '+CAST(spid AS VARCHAR(10))+ '; '
FROM sys.sysprocesses WHERE DBID=DB_ID('EF_GR') EXEC(@user)

//EF_GR is a name of database


Read more...

Wednesday, April 8, 2009

Exchange 2007 Check User Storage Limits

Excute the command below on Exchange Management Shell to get Storage statistics.
get-mailboxstatistics



Read more...

Exchange 2007 "Send As" Feature

How to Grant Send As Permission.
Open Exchange Management Shell.

Execute the following command.

Add-ADPermission "Mailbox" –User "Domain\User" –Extendedrights SendAs

Example:
This command grant test2 user to send as permission for egemen mailbox

Read more...

Tuesday, April 7, 2009

Remove, Disable, Enable etc .. Devices by Command Prompt (Devcon.exe)

Download devcon.exe

Download And Extract it to any Folder.

Enter to the folder by using command prompt.

Example (Com port remove and rescan)

devcon remove @ACPI\PNP0501\*
devcon rescan

Example (Listing all classes)

devcon classes

Example (Listing all usb devices Hardware IDs)

devcon /hwids *usb*
Read more...

If you get [::1] while ping to localhost



::1 is a short way of writing 0000:0000:0000:0000:0000:0000:0000:0001

Disable IPv6 from network connections properties , if you don't use.
Read more...

Modify Group Policy Refresh Interval

By default, Group Policy refresh happens every 90 minutes for clients and users , every 5 minutes for domain controllers (DCs).

We can modify these refresh intervals by following the steps below.

Open the relevant Group Policy Object (GPO). Then click Edit.Expand Computer Configuration, Administrative Templates, System, Group Policy.




For Computers
Find "Group Policy refresh interval for computers," then select Enabled. Enter the new refresh rate and the maximum random time to wait for the refresh (to prevent all machines getting GPO updates at the same time), click OK.
For DCs
If required, open Group Policy refresh interval for domain controllers," then select Enabled. Enter the new refresh rate, this refresh rate must be significantly less than average computer policy refresh rate, and the maximum random time to wait for the refresh (to avoid all machines updating at the same time), click OK.
For Users
Expand User Configuration, Administrative Templates, System, Group Policy.



Double-click "Group Policy refresh interval for users."

Select Enabled, set the values, then click OK.

Close the Group Policy Editor (GPE).


Read more...

Monday, April 6, 2009

Block Skype using Group Policy

   Copy the following below  code to the text file and save as Skype.adm then import to your Domain Group Policy.

 Then use various options to limit Skype usage.
  

Read more...

Block Skype on ISA 2006 & ISA 2004

There is a research from Columbia University about Skype Blocking.
http://www1.cs.columbia.edu/~library/TR-repository/reports/reports-2004/cucs-039-04.pdf

By preventing all protocols access to 80.160.91.11 (Skype Auth Server), you can Block Skype.
Read more...

View MAC Addresses of devices connected to HP Procurve Switch

Connect to HP Procurve Switch via Telnet.

Execute show mac-address command.
You will see the connected devices MAC addresses and which port they are connected to.



Read more...

Remove APEX SQL Log tables from database

If you want to remove all tables about APEX SQL Log from database after uninstalling the program.


Execute the code below;


IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogMonitor_Stop') EXEC master.dbo.xp_ApexSqlLogMonitor_Stop
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlConnectionMonitor_Stop') EXEC master.dbo.xp_ApexSqlConnectionMonitor_Stop
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLog') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogApi') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogApi'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_InitLogNav') EXEC master.dbo.sp_dropextendedproc 'xp_InitLogNav'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_UnInitLogNav') EXEC master.dbo.sp_dropextendedproc 'xp_UnInitLogNav'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogMonitor') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogMonitor'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogMonitor_Stop') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogMonitor_Stop'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogMonitor_Info') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogMonitor_Info'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogMonitor_Enable') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogMonitor_Enable'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogMonitor_Disable') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogMonitor_Disable'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlConnectionMonitor') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlConnectionMonitor_Stop') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor_Stop'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlConnectionMonitor_Info') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor_Info'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlConnectionMonitor_Enable') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor_Enable'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlConnectionMonitor_Disable') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor_Disable'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_EnableLiveLog') EXEC master.dbo.sp_dropextendedproc 'xp_EnableLiveLog'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_DisableLiveLog') EXEC master.dbo.sp_dropextendedproc 'xp_DisableLiveLog'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_GetLiveLogStatus') EXEC master.dbo.sp_dropextendedproc 'xp_GetLiveLogStatus'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_open') EXEC master.dbo.sp_dropextendedproc 'ln_open'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_is_open') EXEC master.dbo.sp_dropextendedproc 'ln_is_open'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_is_valid') EXEC master.dbo.sp_dropextendedproc 'ln_is_valid'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_seekga') EXEC master.dbo.sp_dropextendedproc 'ln_seekga'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_seekgr') EXEC master.dbo.sp_dropextendedproc 'ln_seekgr'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_tellg') EXEC master.dbo.sp_dropextendedproc 'ln_tellg'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_read') EXEC master.dbo.sp_dropextendedproc 'ln_read'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_close') EXEC master.dbo.sp_dropextendedproc 'ln_close'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'sp_ApexSqlLogMonitor_Start') EXEC master.dbo.sp_procoption 'sp_ApexSqlLogMonitor_Start', 'startup', 'false'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'sp_ApexSqlLogMonitor_Start') EXEC master.dbo.sp_executesql N'DROP PROCEDURE sp_ApexSqlLogMonitor_Start'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'sp_ApexSqlConnectionMonitor_Start') EXEC master.dbo.sp_procoption 'sp_ApexSqlConnectionMonitor_Start', 'startup', 'false'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'sp_ApexSqlConnectionMonitor_Start') EXEC master.dbo.sp_executesql N'DROP PROCEDURE sp_ApexSqlConnectionMonitor_Start'
DBCC LogNavXp (FREE)
DBCC ApexSqlLogXprocs (FREE)
DBCC ApexSqlServerXprocs (FREE)




Read more...

Update Statistics on SQL 2005 Database

Execute the command Below;

SELECT

sum(cache_plan.size_in_bytes)

FROM sys.dm_exec_cached_plans as cache_plan

outer apply sys.dm_exec_sql_text (cache_plan.plan_handle) as sql_text 

Read more...

Total Used Cache SQL Server 2005

Use the Query below to find total used cache in bytes;

SELECT

sum(cache_plan.size_in_bytes)

FROM sys.dm_exec_cached_plans as cache_plan

outer apply sys.dm_exec_sql_text (cache_plan.plan_handle) as sql_text 

Read more...

Check SQL Database Health Status

Execute ;
DBCC Checkdb

Read more...

Exchange 2007 Local Continuous Replication

You can provide High Availibility to your Exchange 2007 server by using Local Continious future without using another hardwares.


To enable this future open Exchange Management Console. Choose Mailbox Under Server Configuration.

In the right pane in database managment TAB, Right click "First Storage Group" and Choose "Enable Local Continuous Replication".



click NEXT .



Enter path for system and log files .



Cick Next and Enter the path for LCR database.


(Using another physical disk will increase performance of your replication.)

You must use identical name for your LCR database file name.

Click Next. And click Enable on the next screen.
After successful completion . Click finish.



Control creation of new files by comparing two locations.


LatestAvailableLogTime
The time stamp on the source storage group of the most recently detected new transaction log file.
LastCopyNotificationedLogTime
The time associated with the last new log generated by the active storage group and known to the copy.
LastCopiedLogTimeThe time stamp on the source storage group of the last successful copy of a transaction log file.
LastInspectedLogTimeThe time stamp on the target storage group of the last successful inspection of a transaction log file.
SeedingIndicates that seeding is in progress. Possible values are True and False.


Read more...

Enable Anti-Spam updates on Exchange 2007

Open Exchange Management Shell,

Execute the command below;

This command will enable Antispam automatic updates and options in Microsoft Update.

"Enable-AntispamUpdates -Identity SV2008 -IPReputationUpdatesEnabled $True -MicrosoftUpdate RequestNotifyDownload -UpdateMode Automatic -SpamSignatureUpdatesEnabled $True"

Type your Exchange server name to the bold part (SV2008).Do not use quotas.
Read more...

Exchange Server 2007 Limit Mailbox Sizes

Start Exchange Management Console,
Under the Server Configuration ,Clik Mailbox. On the right pane find the database that you want to set quotas. Right click ,click properties.


Chose Limits TAB from the window and enter the limits for users mailbox.

Read more...

Exchange 2007 Mailbox Sizes

Open Exchange Management Shell and execute the command below.


Get-MailboxStatistics Sort-Object TotalItemSize –Descending ft DisplayName,TotalItemSize,ItemCount



Read more...

Search and Delete Files on Windows Domain Structure

Use the script below to find and delete files according to their extensions.

strComputer = "."Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set colFiles = objWMIService.ExecQuery _("Select * from CIM_DataFile where Extension = 'mp3' OR Extension = 'mp4'")For Each objFile in colFilesobjFile.DeleteNext
Read more...

Friday, April 3, 2009

Windows DHCP Server MAC Filtering

By Default Windows Server 2003 DHCP hasn't got any ability to filter client mac address.

To enable this function you should install "MAC Filter Callout" third party tool to enable this feature.
You can download this tool from the link below.

Download

After downloading. Install it on your DHCP Server. And Restart DHCP Server service from services console. After installation check for registry keys for macfiltercallout.

HKLM\System\ControlSet001\Services\DHCPServer\Parameters\


In the right pane check for registry keys stated in the picture below.






CalloutEnabled (DWORD) value = 1 (Enable) 0(Disable)

CalloutErrorLogFile = Indicating the place of Error Log file

CalloutInfoLogFile = Indicating the place of Information Log file

CalloutMACAddressListFile = Indicating the place of file that will be used for allowing or denying MAC Address


MAC Filtering



Locate and open the MACList.txt file. This file can be used for one purpose at a time.(Allowing or Denying)



For using allowing purpose first line in the file should be like MAC_ACTION={allow} (Devices that have these MAC addresses will be allowed other will be denied to get IP Address from DHCP Server)



For using denying purpose first line in the file should be like MAC_ACTION={deny}


MAC Address should be written in Lowercase.



You should Restart DHCP Server service every time you change MACList.txt







Read more...

Thursday, April 2, 2009

SQL Query that search all column names based on criteria

Search All Column that names like (at..)

select * from INFORMATION_SCHEMA.COLUMNS where
"COLUMN_NAME" LIKE '%at%';
Read more...

GFI Mail Essentials Log View

Firstly each GFI MailEssentials anti-spam module may be configured to record all blocked emails to a log file. This can be enabled as follows:

Open the GFI MailEssentials configuration.
Expand ‘Anti-Spam’ and click on the module you want to enable logging for.
Click on ‘Properties’ and select the ‘Other’ tab.
Enable ‘Log occurrence to this file’.
Configure the path to the log file or leave as default.
Lastly you can gind GFI Mail Essentials system logs on "C:\Program Files\GFI\MailEssentials\DebugLogs" directory.

Read more...

Wednesday, April 1, 2009

SQL Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection.

If you getting this error on SQL Server 2005 SP2




Add the following registry key and reboot the server. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\SycAttackProtect{DWORD} = 0





SynAttackProtect


Read more...
 
span.fullpost {display:none;}