Archive

Archive for the ‘Tips’ Category

Powershell Query Application error events in windows 7

By this time I am sure you find Custom filters in Windows 7/2008 R2 event viewer very useful. They just displays the results what you need. If you want to get similar functionality with powershell, you can use Get-WinEvent Powershell cmdlet.

I am using it to very good extent to find out the application crashes of given exe in remote computers. Here is a small example where I am querying iexplore.exe crash events in remote computers and I am interested only in recent 5 incidents.

Get-WinEvent -ComputerName PC1 -FilterHashtable @{logname=”Application”;providername=”application error”; data=”iexplore.exe”;} | select -first 5

This runs pretty quickly and displays the results very fast compared to other cmdlets like Get-EventLog or GWMI WIn32_NTLogEvent. You can measure the performance with measure-command cmdlet if you want.

Hope this little tip helps you. Feel free to write in comments section if you have any doubts/questions

Categories: PowerShell, Tips Tags:

Block installation of Windows 7/Windows 2008 R2 Service Pack 1

Microsoft has released a tool which helps you in blocking the installation of Windows 7/Windows 2008 R2 Service Pack 1 through windows Updates. You can download it from here.

This download contains three files.

1. SPBlockingTool.exe — A microsoft executable

2. SPReg.bat  –  A batch script

3. NoSPUpdate.ADM — A ADM file to use with GPOs

The installation of service pack 1 through Windows Update can be stopped with one of the above above given tools. If you plan to use the executable, you need to pass /B switch to it to block the installation and /U switch to unblock the installation. Similar functionality can be achieved with BAT script also. It helps you to run against remote system as well. Third approach is using the ADM file in your Group Policies. This GPO procedure is very straight forward and like using any other ADM file.

Irrespective of approach you use, it creates a key value name “DoNotAllowSP” and sets it to “1” under HKLMSoftwarePoliciesMicrosoftWindowsWindowsUpdate registry key to block the installation. It deletes this newly created key when you instruct it to unblock the installation restriction.

Hope this helps you.

Categories: Tips, Windows 2008, Windows 7 Tags:

Firefox tip: Open multiple websites at single Go

March 6, 2011 1 comment

The below command helps you to open multiple websites in single go, each one in separate tabs, in firefox. I found this tip useful, so sharing with my blog readers.

Go to Start -> Run-> and type firefox.exe “cricinfo.com” “gmail.com” “techibee.com” ” microsoft.com” and click on OK.

Categories: Tips Tags:

Powershell tip: Unlock a active directory account

With powershell, it is very easy to unlock a active directory user account. It is as easy as executing below command.

Unlock-qaduser myuser1

Only thing is, you need to have Quest Powershell cmdlets for active directory installed in your computer.

Similarly you can perform some more quick actions with Quest active directory cmdlets

Query all disabled accounts:

Get-QADuser -disabled

Query all locked accounts:

Get-QADUser -locked

Hope this helps…

Categories: Active Directory, Tips Tags:

Take easy screen shots using snipping tool in windows 7

Till windows XP, taking a screenshot of active windows or a selected area is more than an easy task. You need to be familiar and always remember the key selection(Ctrl+PrintScn) to do that. These headaches are gone with windows 7.

To capture a screenshot in windows 7, follow the below steps.

  1. Get the required screen to top of all windows — essential for any screen capture mechanism :-)
  2. Go to START -> RUN -> type “SnippingTool.exe”
  3. This will gray out your screen and launch the tool.
  4. Select the screen area that you want to screen shot and at the end of selection it will automatically converted to a image file and prompts you for saving.
  5. Before you save, it allows you to make any modifications to it if you want — like pointing some item etc.

I assume you felt this very easy. You can read more about this at http://windows.microsoft.com/en-IN/windows7/products/features/snipping-tool.

Categories: Tips, Windows 7 Tags:

Disconnect Wireless network command line

November 4, 2010 2 comments

I troubleshooted a peculiar problem today and to implement a workaround for that issue, I have to disconnect wireless at the time of logoff. I did some search in google and the below command helped me.

netsh wlan disconnect

Btw, this command is Vista/Windows 7 compatible. I am not sure about other operating systems. I did some more research and came across bunch of commands using which we can manage wireless on windows 7 computers very easily.

Refer to this Microsoft Document to know the commands.

Happy learning and happy Diwali.

Categories: Tips, Windows 7 Tags: ,

Smart and Easy way to do follow-ups

October 12, 2010 2 comments

I came across a nice service which makes the task of following up with other parties very easy. The advantage with this service is it works through email; that means you can create/read follow-ups anytime anywhere. Visit http://www.followupthen.com/ to know more about it. Btw, I started using this :-)

See this video to get a sense of what it is…

Categories: Tips, tools Tags:

Drag Drop not working in windows 7

I have seen this problem randomly on my windows 7 computer. After close observation, I found that DRAG and DROP won’t work from low privileged window to High privileged window. I generally run a command prompt with administrator and try to drag drop items from my explorer to the elevated command prompt. Since the elevated command prompt is running in high privilege mode, and my explorer in low privilege mode, drap-drop from explorer to cmd is not working. Whereas same operation to a normal command prompt is working without any issues since it is in the same privilege mode as my explorer.

I hope this small briefing helps you come out of drap-drop dilemma.

Btw, command prompt appears like below when it is in high privilege mode.

 

Categories: Tips, Windows 7 Tags:

Audit local administrator password on workstations/servers using PowerShell script

September 15, 2010 1 comment

“How to audit local administrator password on list of servers using a script” – this is the question I have seen in one of the forums I participate. The requester asked for a way to read local administrator password on a server and compare it with the standard password and report deviations if any. While this sounds like a good algorithm to audit, I wonder how one can “READ” passwords of any account in Windows Operating System. But still requirements are requirements and we need a way to address them.

After thinking for sometime, I recollected one of the old tricks I have used during my initial days of system administration. “Accessing of other systems resources(like C$) works if the source(from where you are trying to access) and target systems are running with same local administrator password”. That means you should login to system with local administrator password and then you should be able to manage remote systems if they have same password with which you logged into the current one. I felt why can’t I use this to audit the administrator password.

I quickly wrote a powershell script(code below) of few lines and tested. It worked like a champ. So, what I am trying to do here is, accessing the c$ share of remote computer. This works if the remote computer password is same as the one with which I logged into current computer; otherwise it fails. Is n’t it enough to audit the admin rights and identify the computers which are not having the correct password? I feel this should be good and quick.

$servers = Get-Content c:tempserverslist.txt$servers | % {

if(Test-Path “\$_c`$windows”) {

Write-Host “Local administrator account on $_ has same password”

}  else  {

Write-Host “Local administrator account on $_ has different password”
}
}
 
 
 

 

I would be more happy if you can suggest a more efficient way of doing this.

Categories: PowerShell, Tips, tools Tags: , ,

Calculate RAID Disk space outcomes online

September 15, 2010 Leave a comment

I came across a couple of RAID disk space calculators day before yesterday and thought of sharing them. They basically helps you to figure out the usable space you get out of your available disks when configured under a particular RAID level(say RAID 0, RAID 1, RAID 5, etc). It also gives sufficient information about each RAID level like no. of disks it should have etc. Another good thing is, they are available online. So you can connect and calculate anytime. Below are the links.

http://www.z-a-recovery.com/art-raid-estimator.htm

http://www.icc-usa.com/raid-calculator.asp

Let me know have comes across any such interesting tools.

Categories: Tips, tools Tags: , ,