Windows server 2003 – How to check FSMO role holders

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

0

I`ll show you two quick ways to check FSMO roles on Windows 2003 server.

1. open command line and type :

netdom query fsmo

2. copy this code to notepad and save as fsmo.vbs script :

Set objRootDSE = GetObject(”LDAP://rootDSE”)

Set objSchema = GetObject _
(”LDAP://” & objRootDSE.Get(”schemaNamingContext”))
strSchemaMaster = objSchema.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strSchemaMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Forest-wide Schema Master FSMO: ” & objComputer.Name

Set objNtds = Nothing
Set objComputer = Nothing

Set objPartitions = GetObject(”LDAP://CN=Partitions,” & _
objRootDSE.Get(”configurationNamingContext”))
strDomainNamingMaster = objPartitions.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strDomainNamingMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Forest-wide Domain Naming Master FSMO: ” & objComputer.Name

Set objDomain = GetObject _
(”LDAP://” & objRootDSE.Get(”defaultNamingContext”))
strPdcEmulator = objDomain.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strPdcEmulator)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Domain’s PDC Emulator FSMO: ” & objComputer.Name

Set objRidManager = GetObject(”LDAP://CN=RID Manager$,CN=System,” & _
objRootDSE.Get(”defaultNamingContext”))
strRidMaster = objRidManager.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strRidMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Domain’s RID Master FSMO: ” & objComputer.Name

Set objInfrastructure = GetObject(”LDAP://CN=Infrastructure,” & _
objRootDSE.Get(”defaultNamingContext”))
strInfrastructureMaster = objInfrastructure.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strInfrastructureMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Domain’s Infrastructure Master FSMO: ” & objComputer.Name

Then open command line and type:

cscript fsmo.vbs



Windows tips – How to hide file in Alternate Data Streams (ADS)

Posted by aidas | Posted in Windows 2003, Windows XP | Posted on 14-06-2009

0

This post will show you how to hide file in Alternate Data Streams.

ADS (Alternate Data Streams) is a “feature” of the NTFS that permit files to be completely hidden from the system.

Lets say we have  secret.txt file that contains confidential info and it is placed in C:\Test folder . We want to hide secret.txt file from unwanted eyes and hidden file attribute is too simple solution for us.

secret

In this case we can use ADS feature to completely hide it from system. Lets fork secret.txt file to C:\Windows\Zapotec.bmp file which is one of desktop backgrounds installed by default on Windows XP.

To fork it press “Start” > “Run”, type cmd and press “OK”.

In command line window type:

type c:\test\secret.txt > c:\Windows\Zapotec.bmp:secret.txt

ads-hide

Press “Enter”.

Ok, you forked secret.txt file to zapotec.bmp.

Now go to c:\Test folder and delete secret.txt file. Yep, you got it right, delete it.

After that you can start windows Search and try to locate secret.txt file. No traces… it is gone…

And now the Magic moment!

Open command line and type:

notepad c:\Windows\Zapotec.bmp:secret.txt

and press “Enter”

ads-show

Secret info file is there and it is hidden pretty well this time.

Well done!

Windows RUN commands – How to start Add/Remove programs

Posted by Mark | Posted in Windows 2003, Windows XP | Posted on 13-06-2009

0

This post will show you how to start “Add/Remove programs” via Run on your Windows computer. To start Add/Remove programs press “Start” > “Run” and type:

appwiz.cpl

windows add remove

Press “OK” and you are Done!

Windows RUN commands – How to start Administrative Tools

Posted by aidas | Posted in Windows 2003, Windows Vista, Windows XP | Posted on 28-05-2009

0

This post will show you how to start “Administrative Tools” via Run on your Windows computer. To start Administrative Tools press “Start” > “Run” and type:

control admintools

administrative-tools

Press “OK” and you are Done!


Windows XP and Windows server 2003 – How to remove invalid boot path

Posted by aidas | Posted in Windows 2003, Windows XP | Posted on 28-05-2009

0

This post will show you how to remove invalid boot paths from boot.ini file on your Windows machine.

To do it press “Start” > “Run” and type:

msconfig

Press “OK”.

In “System Configuration Utility” window press “Check All Boot Paths” button.

boot_paths

Computer will check all boot paths and will remove invalid ones.

After check restart your computers and you are Done!

Windows RUN commands – How to start Certificate Manager

Posted by aidas | Posted in Windows 2003, Windows XP | Posted on 27-05-2009

0

This post will show you how to start “Certificate Manager” via Run on your Windows computer. To start Certificate Manager press “Start” > “Run” and type:

certmgr.msc

certificate_manager

Press “OK” and you are Done!

Windows XP and Windows server 2003 – How to reinstall Internet Explorer

Posted by aidas | Posted in Windows 2003, Windows XP | Posted on 26-05-2009

0

This post will show you how to reinstall Internet Explorer on your Windows computer.  Note that you will need Windows install CD or Windows install files on your disk to reinstall internet explorer.

To perform reinstal press “Start” > “Run” and type:

rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %windir%\inf\ie.inf

explorer_reinstall

Press “OK” and browse to Windows install CD or files on your disk to start reinstall.

Windows RUN commands – How to start Event Viewer

Posted by aidas | Posted in Windows 2003, Windows XP | Posted on 26-05-2009

0

This post will show you how to start “Event Viewer” via Run on your Windows computer. To start Event Viewer press “Start” > “Run” and type:

eventvwr.msc

windows event viewer

Press “OK” and you are Done!

Windows XP – How to block unwanted web sites on your Windows computer

Posted by aidas | Posted in Windows 2003, Windows XP | Posted on 25-05-2009

0

This post will show you how to block unwanted web sites by editing hosts file on your Windows computer. Lets say you want that all computer users were unable to browse web site named www.badsite.com .

To block web site click “Start” > “Run” and type:

notepad c:\windows\system32\drivers\etc\hosts

Note that there is space between notepad and c:\windows…

In “hosts” file select empty row and type:

127.0.0.1 www.badsite.com

windows server hosts

On “hosts” file menu click “File” and and select “Save” to save changes you just made.

After saving changes you can close file and you are done!

Windows XP and Windows server 2003 – How to disable Windows auto restart on system failure

Posted by aidas | Posted in Windows 2003, Windows Vista, Windows XP | Posted on 25-05-2009

0

This post will show you how to disable automatic restart when system error occurs on your Windows computer. If this option is enabled you are unable to view Blue Screen of Death (BSOD) output and to check system error code for further investigation.

To disable auto restart right click mouse on “My Computer” icon and choose “Properties”. In “System properties” window select “Advanced” tab.

windows system

In “Advanced” tab click “Settings” under “Startup and Recovery” section. In “Startup and Recovery” window uncheck “Automatically restart” option.

windows system 2

Press “OK” and You are done!

Windows server 2008 – How to list IIS websites on Windows 2008

Posted by aidas | Posted in Command line, Windows 2008 | Posted on 20-05-2009

0

This post will show you how to list IIS 7.0 websites on your Windows server 2008 using command line tool appcmd .

Appcmd tool is used to query, create and configure IIS 7.0 server properties, web sites and application pools.

To list all web sites on IIS 7.0 open command line and type:

appcmd list sites

Done!

Windows server 2008 – How to open secure command line on remote server

Posted by aidas | Posted in Command line, Windows 2008 | Posted on 19-05-2009

0

This post will show you how to open secure command line on remote Windows server 2008. All communications between client and remote host will be encrypted by Kerberos or NTLM keys. Lets say we want to connect to server named “testserver”. To do it open command line on your Windows server 2008 and type:

winrs -r:testserver cmd