Nslookup range of IP adressess

I was searching for all machines in a certain IP address range to see which machines are in this range and what their host address is.

While trying to create a good working script for the purpose I needed, I came accross the following line which had like all I needed without using nslookup.

0..255 | % { [System.Net.Dns]::GetHostByAddress("192.168.1.$_") } 2> Out-Null

The range is for this script is 192.168.1.0  -> 192.168.1.255 with the 2>out-null only valid returns are replied in a nice list.

Manage Remote Desktop Sessions from CMD

I used to receive the maximum number of connections error message when I try to log on to the Windows 2003 Server in my office via Windows Remote Desktop.

This is pretty annoying if you have some urgent work to do in the server. Most of the already logged in users won’t even be using the session at the time, but I can’t login! So how to solve this? After a bit of googling, as usual, I found a simple way to disconnect other remotely logged in sessions. :D

First of all you must be logged in to your client computer as a domain Admin user. Now open the command prompt and type in the following command.

qwinsta /server:SERVERIP

The Ip address or domain name of the Remote server should be entered in place of SERVERIP
Example:

qwinsta /server:10.10.1.10

You will get a list of the Remote Sessions in the command window.

In the above sceenshot we can clearly see an Active RDP session with the ID 2 which belongs to the user Administrator. In order to disconnect that user we are going to use the session ID. Use the following command line to disconnect the remote session.

rwinsta /server:SERVERIP SESSIONID

For example in order to terminate the session of the Administrator user the following command should be given.

rwinsta /server:10.10.1.10 2

Now let’s confirm if the user is really disconnected. Just type in the qwinsta command in proper format.

As you can see our session with ID 2 is no longer there. Now for the user we just disconnected will see the following message.

The remote session was disconnected because you session was logged off at the remote computer. Your administrator or another user might have ended your connection.

Source : TechTalkz

Remote Desktop Connection Manager

I was browsing the web and found Remote Desktop Connection Manager. It should be a nice replacement and organizing tool for Remote Connections.
You can create groups, set your UID and password before connecting, see multiple screens live at a time.

You can download it at Microsoft’s website
http://www.microsoft.com/downloads/details.aspx?FamilyID=4603c621-6de7-4ccb-9f51-d53dc7e48047&displaylang=en

After you installed it, you can move the folder to another PC/Server and use it standalone.

Servers are organized into named groups. You can connect or disconnect to all servers in a group with a single command. You can view all the servers in a group as a set of thumbnails, showing live action in each session. Servers can inherit their logon settings from the group. Thus, when you change your lab account password, you only need to change the password stored by RDCMan in one place. By default passwords are stored securely by encrypting with CryptProtectData using the (locally) logged on user’s authority. Servers can be moved between groups using drag-and-drop or via their properties page.

Non-Win7/Vista users will need to get version 6 of the Terminal Services Client. You can obtain this from the Microsoft Download Center: XP; Win2003

WSUS Client Diagnostics

This tool has been designed to aid the WSUS administrator in troubleshooting the client machines that are failing to report back to the WSUS Server.
The tool will do a few preliminary checks and test the communication between the WSUS Server and the client machine.
Once the tool has completed the tests it will display the results in the console window. The WSUS administrator also has the option to have the results logged to a file in addition to being displayed on the console.

Download : http://download.microsoft.com/download/9/7/6/976d1084-d2fd-45a1-8c27-a467c768d8ef/WSUS%20Client%20Diagnostic%20Tool.EXE

Registry comparing

Due to a problem with some of our servers I was trying to compare 3 registry’s because 2 did function correct and one had an unidentified problem which caused the problem.

I found a nice and easy tool called regdiff. It once was nested inside the Windows Resource Kit.
You can download it at  http://www.p-nand-q.com/download/tools/regdiff.zip

Easiest is too export the two directories you want to  compare. You also can use the whole registry but think about all the variables which are different per server. You will get a lot of failed compares then.

If you just have a little clue where too search for your problem, try to compare some directories there instead of the whole regsitry.

You can find more information on:
http://www.p-nand-q.com/download/regdiff.html

Quitter (CLI Twitter Application)

A few days ago I found a nice very lite twitter app. It’s a CLI which works like a charm.
So don’t expect flashy visuals and gui’s like most other twitter applications. Just back to basics for fast reading and posting 🙂

It’s also completely standalone uses only one executable and one configuration file. No installer needed, just unpack the ZIP file.

You can download it at
http://quitter.codeplex.com/

With Quitter, you can…

  • Read, post, reply and retweet.
  • Organize the people you follow into groups and read tweets by group.
  • Filter (or highlight) tweets from specific users or that contain certain #hashtags.
  • Use URL shorteners like TinyUrl.com for tweeting URLs.
  • Easily open tweeted links from other users in your default browser (no copy/paste needed)
  • Send and receive direct messages
  • Follow or unfollow other users

Quitter runs on Windows 2000/XP/Vista and requires Version 2.0 of the Microsoft .NET Framework or higher (version 2.0 was released in 2006; most Windows machines should have version 2.0 or higher).

  Quitter is free (as in beer) and open-source and will always be both.

Disk Alignment

Disk Alignment

To do a disk alignment you can follow the steps below:

  • Check which disk you want to allign
  • Using diskmanager is the fastest option
  • “My Computer” – “Manage” – “Disk Management”
  • For example this is Disk 1
  • Go to “Start – run – CMD”
  • Type “Diskpart”
  • Type “List disk” to see the disks and sizes when “Size” is the same like the disk you saw in Diskmanager you are now ready to select it.
  • Type “Select Disk 1”
  • Disk 1 is now the selected disk
  • Now create the partition with the good allignment
  • Type “Create partition primary align=1024”
  • After this you will get a success message that the partition is created with the correct allignment.

For more explanation about this see:

http://technet.microsoft.com/en-us/library/dd758814(SQL.100).aspx

 

Remove folder entry eventviewer

Remove folder entry eventviewer.Official(Clean)For example we use Patchlink1. Go into Services and locate the EventLog service. Right Click the service, select Properties and Disable it under the Startup type.2. Navigate your way to the registry and find the offending Event Log under: Hkey_Local_MachineSystemCurrentControlSetServicesEventlogPatchlink. Right click the registry key and remove it.

3. Restart Windows.

4. When the operating system is back up, browse to System32Config and remove the Patchlink.evt.

5. Go back into Services and change the Startup type back to Automatic and start it.

6. The Patchlink should now be removed from the Event Viewer.

Unofficial(Dirty)

You also can remove the registry entry without restarting the computer. In that case you will have the eventviewer entry removed . But the log file in System32Config will remain. This because eventviewer starts at computer boot and claims the .evt files so they cannot be removed without stopping the service who uses the files.

Powershell
I also made a little powershell loop script which cleans all eventviewer entries in the text file


Foreach ($Server in gc "*:****server.txt")

{
Clear-EventLog patchlink -ComputerName $server
Write-Host "$Server Cleaned"
}
Write-Host "DONE" -ForegroundColor green

1 6 7 8