4/24/2009

More PSEXEC

Hier, other usefull psexec commands, let’s take the ip 10.20.198.58 al example:

See remote network configurations in a remote workstation or server:

c:\>psexec \\10.20.198.58 ipconfig /all

Start a command prompt in a remote workstation or server

c:\>psexec \\10.20.198.58 cmd.exe

To see the status of a remote Windows XP SP2 firewall in a domain, type:

C:\>psexec \\10.20.198.58 Netsh firewall show state verbose=enable

You will get a lot information to troubleshoot a windows firewall, but this is not the issue now.

To enable the Windows firewall remotely in a Windows XP SP2, hier the little LAB. Have fun !

C:\>psexec \\10.20.198.58 Netsh firewall set opmode enable

4/16/2009

LOGOFF Remote users and administrators

Use it when you want to logoff a remote admin because you hate using the Windows Terminal Services Console or because sometimes it crashes. Functions in Windows Server 2003.

The syntax for these exercise:

C:\Administrator>psexec \\192.168.0.2 -u testing\administrator cmd

PsExec v1.94 - Execute processes remotely
Copyright (C) 2001-2008 Mark Russinovich
Sysinternals - www.sysinternals.com

Password: ********

Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\WINDOWS\system32>query session

SESSIONNAME USERNAME ID STATE TYPE DEVICE
>console Administrator 0 Active wdcon
rdp-tcp 65536 Listen rdpwd
rdp-tcp#4 Spiderman 1 Active rdpwd
rdp-tcp#5 Superman 2 Active rdpwd

C:\WINDOWS\system32>logoff 1

C:\WINDOWS\system32>logoff 2

And here you have the LAB, clic the image to enlarge:



Somebody will ask to logoff users in worksations, well we are here with psexec, but as a preview for the psshutdown tool, this script forces the remote opened applications to close and proceeds with the logoff of the console user:

>psshutdown \\MarketingPC -f -o

4/09/2009

Sysinternals Networking Utilities (Pstools- PSEXEC)

Under the Network Tools from Sysinternals, are of course the pstools with a subcategory of tools, I leaved all other tools like AdInsight and AdExplorer for the last posts in this category.

Install software using PStools:

Let’s see the scenario where you want to run a program, a hotfix, any update in the workstations in your domain, for example, to update the Windows Installer in your Windows XP infrastructure in your Windows 2003 Domain.

1. Open notepad and save it as a bat file, add the following code:

psexec @c:\Folder\PChostnameList.txt -d -c WindowsInstaller-KB893803-v2-x86.exe /q /norestart
pause


execute it from the command line and you will have a silent deployment. Copy the WindowsInstaller executable in the same folder path. The PChostnameList.txt are just the hostnames from the PCs you want to affect. We will have a similar output like this, in this case for testing purposes I have just one hostname added:



If you can not see the image, clic on it.