Windows server 2003 and Windows XP – How to use advanced search for files via command line

Posted by aidas | Posted in Command line, Tools, Windows 2003, Windows XP | Posted on 13-08-2009

0

Windows server 2003 has very nice tool “forfiles.exe” which provides you with quick and nice file search function.

If you want to use it with your Windows XP machine download it from here .

This tool can be played with mass of functions and in this article i`ll show how to use it with some of them.

For example i want to search through all *.log files in C:\Windows folder and subfolders.

If i find any *.log file there that size is greater than 1MB i want to export  path, size and modify time information of that file into C:\Data\LogFileInfo.txt .

In that case open command line and type:

forfiles.exe /p C:\Windows /s /m *.log /c “cmd /c IF @fsize GTR 1000000 (echo @path @fsize @fdate)” >C:\Data\LogFileInfo.txt

Syntax:

/p – what path to search
/m – what file type to search
/s – include subfolders
GTR – greater than

Windows server 2003 and Windows XP – How to redirect offline files to another server

Posted by Mark | Posted in Command line, Tools, Windows 2003, Windows XP | Posted on 05-08-2009

0

Few weeks ago i got tough situation when share i made offline was moved to another server by local administrator and all users were still trying to synchronize offline files with old server.

How to act in this situation You would ask?

First of all you must download Windows server 2003 Resource Kit Tools from this site .

In this case we will need csccmd.exe tool which will work on Windows XP systems too.

Install tools pack you downloaded, open command line and navigate to Resourse Kit Tools folder.

When you are in place type:

csccmd.exe /moveshare:\\oldserver\oldshare \\newserver\newshare

offlinefiles

Press “Enter” and you are done !

Windows server 2008 Core – How to set static IP address via command line

Posted by Mark | Posted in Command line, Networking, Windows 2008 | Posted on 30-07-2009

0

This topic will show how to set static IP 192.168.0.10 with mask 255.255.255.0 to your Windows server 2008 Core interface named “Local Area Connection” .

Also we will set DNS server IP 192.168.0.11.

To set static IP address and mask type:

netsh interface ipv4 set address name=”Local Area Connection” source=static address=192.168.0.10 mask 255.255.255.0

To set DNS server IP type:

netsh interface ipv4 add dnsserver name=”Local Area Connection” address=192.168.0.11

Windows server 2008 Core – How to activate server

Posted by Mark | Posted in Command line, Scripting, Windows 2008 | Posted on 28-07-2009

0

This post will show you way how to activate Windows server 2008 Core.

You can do that with script named slmgr.vbs.

To perform activation type this in command line:

slmgr.vbs -ato

win2008_act

Press Enter and you are done!

Windows XP – How to add Command Prompt to Windows explorer right-click menu

Posted by Mark | Posted in Command line, Windows XP | Posted on 24-07-2009

1

This post will show you how to add functionality to right click on any directory and select “Command Prompt Here” from the menu to open command line in that location.

First of all open registry editor Start > Run, type regedit and press OK.

Browse to:

HKEY_CLASSES_ROOT\Directory\shell

regedit1

Right click “shell” and choose the New > Key option

regedit2

Name the new key  “CommandPrompt” without the quotes and then double-click on the default value in the right .

Change value data to “Command Prompt Here”

regedit3

Right click on the key you created and select New > Key

regedit4

Name the new key “Command” and then double-click the default value on the right.

Set Value data to:

cmd.exe /k cd %1

regedit5

Press “OK” .

Now when you right-click any folder in your Windows machine you will see “Command Prompt Here” option to open command line in that location.

regedit6

Cheers!

Windows server 2003 – How to find Global Catalogs (GC) via command line

Posted by Thomas | Posted in Command line, Windows 2003 | Posted on 08-07-2009

0

If you want to test quick way how to query your Global Catalogs open command line on Windows server 2003 and type:

dsquery server -isgc

gc

Press “Enter” button and you are done !


Windows server 2003 – How to check and reset RDP sessions via command line

Posted by aidas | Posted in Command line, Windows 2003 | Posted on 03-07-2009

0

Have you ever encountered this annoying window when trying to access Windows server 2003 via Remote Desktop connection?

Terminal sessions exceeded

It draws me mad every time i see it !

So  i`ll show you how can we get rid of it in a few seconds.

Lets say that session limit was reached on server named “Testserver”.

Login to another Windows server 2003 in your domain, open command line and type:

query session /server:Testserver

terminal1

Press “Enter”

In output you will get information about taken sessions: what user is using it, session ID and status.

If you want to reset specific session note session ID you are going to reset. Lets say ID number is 2.

Open command line and the type following:

reset session 2 /server:Testserver

terminal2

Press “Enter”

Thats all ! The road is clear for now…

Windows server 2003 and Windows XP – How to create “dummy” file via command line

Posted by Mark | Posted in Command line, Windows 2003, Windows XP | Posted on 02-07-2009

0

Here is quick tip how to create dummy file with size of your choice using Windows server 2003 or Windows XP machine.

To do that i will use utility named “fsutil”. Basic syntax for creating a file is:

fsutil file createnew <name of file> <size in bytes>

For example following command:

fsutil file createnew C:\dummyfile.txt 1000000

fsutil

will create 1Mb file named dummyfile.txt in C:\

Windows server 2003 – How to find DHCP servers in your AD via command line

Posted by Thomas | Posted in Command line, Windows 2003 | Posted on 01-07-2009

0

Lets check quick tip how to find authoritative DHCP servers for your domain.

For this open command line in Windows Server 2003 and type:

netsh dhcp show server

dhcp_find

Press “Enter” and you are done !

Easy as pie!

Windows – How to find local Certification Authority

Posted by aidas | Posted in Command line, Windows 2003 | Posted on 29-06-2009

0

This post will show you how to find out which server is responsible for issuing certificates in your domain and get some additional information related to local certification authority.

To do it open command line on Windows computer and type:

certutil.exe -TCAinfo

certificates

Press “Enter” and you are done !

Windows server 2003 and Windows XP – How to share folder via command line

Posted by aidas | Posted in Command line, Windows 2003, Windows XP | Posted on 26-06-2009

0

This post will show you how to use net share command to share folder.

Lets say we want to share “D:\Test” folder with share name “TestDocs”.

Open command line on your Windows server 2003 or Windows XP computer and type:

net share TestDocs=D:\Test

net_share

Press “Enter” button and you are done !

Windows server 2008 – How to find Terminal servers in your domain

Posted by Mark | Posted in Command line, Terminal services, Windows 2008 | Posted on 24-06-2009

0

This post will show you how to find Windows server 2008 with Terminal server role installed in your domain.

To perform search in domain named “Testdomain.com” domain open command line and type:

query termserver /domain:Testdomain.com

win2008_terminals

Press “Enter” and you are done !