Windows Server 2003 – How To change Domain Admin password

Posted by aidas | Posted in Active directory, Security, Windows 2003 | Posted on 27-07-2010

0

Hello there!

To change domain admin password under windows server 2003 AD You will need:

* physical access to domain controller

* directory restore administrator password

* SRVANY and INSTSRV resource kit tools provided by Microsoft

1.

Restar Your Windows server 2003 domain controller into Directory Restore service mode (mode available in list after hitting F8 when booting PC)

Login as Administrator (using directory restore administrators password)

2.

Copy SRVANY and INSTSRV tools into temp folder located for example in c:\TMP

Also copy cmd.exe that is located in “%WINDIR%\System32″ to c:\TMP folder

3.

Start command line.

Type: cd c:\TMP and hit Enter

Type: instsrv PassRecovery “c:\TMP\srvany.exe” and hit Enter

4.

Start registry editor and navigate to:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\PassRecovery

Create new subkey named Parameters and add following values:

name: Application
type: REG_SZ (string)
value: C:\TMP\cmd.exe

name: AppParameters
type: REG_SZ (string)
value: /k net user administrator [New Password]

Replace [New Password] with complex password You will set for Administrator user.

5.

Open Services (Start>Run>services.msc>OK)

Click on PassRecovery service and change starting type to Automatic

Then go to “Log on” tab and check “Allow service to interact with desktop” option

6.

Restart server in normal mode and wait for command prompt to show up.

Log on as Administrator with new password [New Password]

7.

To uninstall service You created open command line and type:

net stop PassRecovery and hit Enter

sc delete PassRecovery and hit Enter


Windows server and Windows XP – How to troubleshoot Group Policy from the command line using GPRESULT

Posted by aidas | Posted in Group policy, Windows 2003, Windows 2008, Windows XP | Posted on 26-07-2010

0

If you are trying to determine why Your new GPO policy is not being applied as expected, one of first things you should do is examine the Resultant Set of Policy (RSoP) for the user and computer experiencing problems with policy settings on Your Windows Server 2008.

Using the Gpresult command-line utility, you can view RSoP.

Gpresult command provides details on the following:

  • special settings applied for folder redirection, software installation, disk quota, IPSec, and scripts;
  • last time Group Policy was applied;
  • domain controller from which policy was applied and the security group memberships for the computer and user accounts;
  • complete list of GPO that were applied and complete list of GPO that were not applied because of filters.

Gpresult has the following syntax:
gpresult /s [ComputerName] /user [Domain\UserName]

[ComputerName] – is the name of the computer that you want to log policy results for

[Domain\UserName] – domain user that you want to log policy results for

Lets for example view the RSoP for server named “TestServer1” and the user “testuser1” in the “test.lan” domain. In this case open command line on Your Windows server and type:
gpresult /s TestServer1 /user test.lan\testuser1

Also You can view more detailed output by using one of the two verbose options.

/v parameter turns on verbose output and results are displayed only for policy settings in effect

/z parameter turns on verbose output with settings for policy settings in effect and all other GPOs that have the policy set

In additionYou can create an HTML report using the /h parameter or an XML report using the /x parameter.

Have fun !

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 2003 – How to change Distributed File System (DFS) staging size

Posted by Thomas | Posted in Registry, Windows 2003 | Posted on 23-07-2009

0

Have you ever encountered error when using Distributed File System on your Windows server 2003 that states – your staging file is full?

I`ll show you how to fix that.

By default staging file limit is set to 675840Kb.

To change that open registry editor by typing regedit and navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Ntfrs\Parameters

Here you will see Binary value named “Staging Space limit in KB“.

regedit

Open it, change base to Decimal and enter your new value.

Press “OK”

Thats it!

Windows server 2003 and Windows XP – How to script file download from FTP server

Posted by Mark | Posted in Scripting, Windows 2003, Windows XP | Posted on 22-07-2009

1

Do you know how to script basic  FTP server connect/copy operations?

I`ll show you that.

Lets assume you want every Friday at 06:00pm to connect to specific FTP server and download all files from it to directory named D:\Scanfiles.

On your Windows server 2003 or Windows XP start notepad and type:

@echo off
echo user username> ftpbat.dat
echo password>> ftpbat.dat
echo prompt>> ftpbat.dat
echo mget *.*>> ftpbat.dat
echo quit>> ftpbat.dat
ftp -n -s:ftpbat.dat FTPserverIP
del ftpbat.dat

notepad

Save file as ftp.bat and place it in D:\Scanfiles folder.

Change this data:

username – your ftp username
password – your ftp password
FTPserverIP – ip address of ftp server to connect

After that create new scheduled task to run ftp.bat file every Friday at 06:00pm .

Cheers! :)

Windows server 2003 and Windows XP – How to reset Outlook 2003 folder language

Posted by Erica | Posted in Windows 2003, Windows XP | Posted on 20-07-2009

0

Have you ever wanted to reset Outlook 2003 folder language to default?

How to do it?

It is pretty simple.

Login to your Windows server 2003 or Windows XP machine where Outlook 2003 is installed.

Click Start>Run and type:

outlook.exe /resetfoldernames

outlook_reset

Press “OK” and you are done !

Windows server 2003 and Windows XP – How to delete files when path is too long

Posted by Erica | Posted in Tools, Windows 2003, Windows XP | Posted on 09-07-2009

0

I hate this one really…

Then path to file exceeds 255 symbols it becames corrupted and you can have very hard time to delete or rename it.

Ok, how to deal with this.

At this case you have three choices:

1. Dont use too long paths! Use short names for you folders and avoid naming folders this way:

“Very important documents for financial department that were copied from local storage at 20080607″

2. If you did already,  you can try to follow path to file and try to rename some very long folder names to shorter one.

3. You can use third party software that will run on your Windows server 2003, Windows XP and even older machines to deal with these files.

One of really great and free utils is “DelinvFile”.

You can download it from here .

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 and Windows XP – How to shedule disk defragmenting

Posted by Mark | Posted in Scripting, Windows 2003, Windows XP | Posted on 07-07-2009

0

I`ll show you how to create very nice .bat script which will defragment your disks and generate report in log file.

This script was tested on Windows server 2003 or Windows XP machines.

Ok then, lets say you want to defragment C: and D: disks every Monday and Friday starting job at 10:00pm.

Also you want to store log file on C:\Tools folder.

OK, lets open notepad and copy paste this text:

@Ecxo off
Set logfile=C:\Tools\defrag.log
Echo Start %date%,%time% >>%logfile%
Echo *************************** >>%logfile%
Echo Defragmenting C: disk >>%logfile%
Echo. >>%logfile%
defrag.exe c: -f >>%logfile%
Echo *************************** >>%logfile%
Echo Defragmenting D: disk >>%logfile%
Echo. >>%logfile%
defrag.exe d: -f >>%logfile%
Echo *************************** >>%logfile%
Echo Finished %date%,%time% >>%logfile%
Echo *************************** >>%logfile%

Save this file as Defrag.bat and place it to C:\Tools folder

Now open command line and shedule defragmenting by typing:

at 10:00pm /every:M,F C:\Tools\Defrag.bat

defrag

Press “Enter”

And we are finished !

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:\