Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Friday, January 30, 2009

Solution for Windows Server 2008 Network Problem

This is to resolve the network issue for Windows Server 2008 cannot be up after reboot:

1.       Check the network adapter device ID using powershell (http://blogs.msdn.com/daiken/archive/2007/02/09/enable-disable-network-connection.aspx) :

a.        Open powershell



b.       key in the following command to find out which network adapter:

Get-wmiobject win32_NetworkAdapter | format-table



You will see the device ID and key in the following command to the detail of the network adapter and open the network properties to reconfirm:

                   Get-WmiObject win32_networkadapter | where {$_.DeviceId -eq 5}


2.       Create a script, in folder C:\Windows\restart_lan.ps1

a.        Content for restart_lan.ps1 (make sure you have the correct "deviceid")
$lannetwork = Get-WmiObject win32_networkadapter | where {$_.DeviceId -eq 5}

$lannetwork.Disable()

$lannetwork.Enable()

3.       Create a bat file to run the powershell script in folder C:\Windows\restart_lan.bat

a.        Content for restart_lan.bat
powershell c:\windows\restart_lan.ps1

4.       Add the script to windows startup (http://www.tutorial5.com/content/view/157/47/ )

a.        Click Start - Run and type mmc

b.       On the Management console that starts, click File -> Add/Remove Snap-in.

c.        On the window that opens, search for Group Policy Object editor on the left panel, click Add and in the properties window that pops out leave the settings that are selected (Local computer) and click ok.

d.       Navigate through the left panel by opening each branch like this: Console Root -> Computer configuration -> Windows Settings -> Scripts (Startup/shutdown)

e.       Open the properties window for Startup or Shutdown as you desire from the right panel; on the window that pops out add, edit or remove scripts that you want.

Sunday, January 25, 2009

Check system info in Windows

systeminfo.exe /s srvmain

How to kill all process by user in Windows

kill all processes belong to user ayam
taskkill /F /FI "USERNAME eq ayam"

Just kill all calc.exe processes that belong to ayam.
taskkill /F /FI "USERNAME eq ayam" /im calc.exe

To check ddos attack in Windows OS

To check ddos attack

netstat -ano | find /i /c "80

Start >> cmd >> Type the command
netstat -ano

Note : You can see the attacking IPs in Foreign address

How to use nslookup

    nslookup

Server: Your.Main.Server
Address: 123.45.67.8

set type=mx

Windows RDC Force Login

mstsc.exe {ConnectionFile | /v:ServerName[:Port]} [/console] [/f] [/w:Width/h:Height]

/v - specifies the remote computer and port (optional) you wish to connect to
/console – connects to the console of a Windows Server 2003 based system
/f – starts the remote desktop connection in full screen mode
/w & /h – specifies the width and height of the remote desktop connection

Checking Windows Firewall Port


netstat -an |find /i "listening" 

netstat -anop TCP

netstat -anop UDP