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 7 – Top Keyboard Shortcuts

Posted by Erica | Posted in Windows 7 | Posted on 31-07-2009

0

Make sure you will check these keyboard shortcuts on your shiny Windows 7 machine !

Windows Key + Tab = Cycle between Windows

Windows Key + F = Search

Windows Key + E = Windows Explorer is launched

Windows Key + R = Run Command is launched

Windows Key + X = Mobility Center

Windows Key + L = Lock Computer (It is there from the earlier versions as well)

Windows Key + U = Ease of Access

Windows Key + P = Projector

Windows Key + T = Cycle Super Taskbar Items

Windows Key + S = OneNote Screen Clipping Tool [requires OneNote]

Windows Key + M = Minimize All Windows

Windows Key + D = Show/Hide Desktop

Windows Key + Up = Maximize Current Window

Windows Key + Down = Restore Down / Minimize Current Windows

Windows Key + Left = Tile Current Window to the Left

Windows Key + Right = Tile Current Windows to the Right

Windows Key + # = Quicklaunch

Windows Key + = = Magnifier

Enjoy ! :)

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 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 !