2 Nov 2011

Getting the size of all files within a folder tree using Powershell


Here's a script that will output the size of all files within a folder, and the files in all its sub-folders. 

Outout in Kilobytes:

Get-ChildItem D:\Software -recurse | Select-Object Name, @{Name="KiloBytes";Expression={$_.Length / 1KB}} 

Outout in Megabytes:

Get-ChildItem D:\Software -recurse | Select-Object Name, @{Name="MegaBytes";Expression={$_.Length / 1MB}}

26 Oct 2011

How to recover missing Taskbar icons!!

Have you ever lost Taskbar icons after fixing a malware infection? ..."Yes"  ...Me too. So here's the fix! :)

1. Back up the Registry by creating a restore point. 
2. Go to Start > Run (or Windows-key + R), type in regedit and hit OK. 
3. Navigate to the key HKEY_CURRENT_USER\Software\Cla sses\Local Settings\Software\Microsoft\Windows\CurrentVersion \TrayNotify. 
4. Delete the values IconStreams and PastIconsStream. 
5. Open up the Task Manager (Ctrl + Shift + Esc), go to the Processes tab, select explorer.exe and click End Process. 
6. Open the Applications tab and click New Task at the bottom-right of the window. 
7. In the message box that pops up type in explorer.exe and hit OK. 
8. Explorer.exe will reload, and the missing icons should now be back in the system-tray where they belong. 
9. Then if the volume bar isnt there, go to taskbar properties (where the volume was gray) and simply tick the box. 



Enjoy! :)

17 Feb 2011

Google Commands and Operators


site:
If you include [site:] in your query, Google will restrict the results to those websites in the given domain. For instance, [help site:www.google.com] will find pages about help within www.google.com. [help site:com] will find pages about help within .com URLs. Note there can be no space between the "site:" and the domain.
allintitle:
If you start a query with [allintitle:], Google will restrict the results to those with all of the query words in the title. For instance, [allintitle: google search] will return only documents that have both "google" and "search" in the title.
intitle:
If you include [intitle:] in your query, Google will restrict the results to documents containing that word in the title. For instance, [intitle:google search] will return documents that mention the word "google" in their title, and mention the word "search" anywhere in the document (title or no). Note there can be no space between the "intitle:" and the following word. Putting [intitle:] in front of every word in your query is equivalent to putting [allintitle:] at the front of your query: [intitle:google intitle:search] is the same as [allintitle: google search].
allinURL:
If you start a query with [allinURL:], Google will restrict the results to those with all of the query words in the URL. For instance, [allinURL: google search] will return only documents that have both "google" and "search" in the URL. Note that [allinURL:] works on words, not URL components. In particular, it ignores punctuation. Thus, [allinURL: foo/bar] will restrict the results to page with the words "foo" and "bar" in the URL, but won't require that they be separated by a slash within that URL, that they be adjacent, or that they be in that particular word order. There is currently no way to enforce these constraints.
inURL:
If you include [inURL:] in your query, Google will restrict the results to documents containing that word in the URL. For instance, [inURL:google search] will return documents that mention the word "google" in their URL, and mention the word "search" anywhere in the document (URL or no). Note there can be no space between the "inURL:" and the following word.
cache:
The query [cache:] will show the version of the web page that Google has in its cache. For instance, [cache:www.google.com] will show Google's cache of the Google homepage. Note there can be no space between the "cache:" and the web page URL. If you include other words in the query, Google will highlight those words within the cached document. For instance, [cache:www.google.com web] will show the cached content with the word "web" highlighted.
link:
The query [link:] will list webpages that have links to the specified webpage. For instance, [link:www.google.com] will list webpages that have links pointing to the Google homepage. Note there can be no space between the "link:" and the web page URL.
related:
The query [related:] will list web pages that are "similar" to a specified web page. For instance, [related:www.google.com] will list web pages that are similar to the Google homepage. Note there can be no space between the "related:" and the web page URL.
info:
The query [info:] will present some information that Google has about that web page. For instance, [info:www.google.com] will show information about the Google homepage. Note there can be no space between the "info:" and the web page URL.
define:
By using the Google command, define: and then a word or phrase such as "hospital", for instance [define: hospital], will return a definition or a group of definitions from various online websites, portals and online encyclopedias.

21 Aug 2010

You May Lose the Default Gateway on SBS 2008 Every Time You Reboot


When you reboot an SBS 2008 server, you may experience some of the following symptoms:
  • The SBS server will be unable to browse to the Internet.
  • Users will not be able to connect remotely to the SBS server using utilities such as remote web workplace or Outlook web access.
  • Client PCs that rely solely on the SBS server for DNS may not be able to browse the Internet.
If you run ipconfig on the SBS 2008 server you will notice that the default gateway is blank.
clip_image001
If you manually assign the default gateway the connectivity will be restored until you reboot the server. After you reboot the server, the default gateway may again be lost.
This issue occurs because of a problem with the netsh utility in Windows Server 2008. The issue is documented in knowledge base article 973243: The default gateway is missing on a computer that is running Windows Server 2008 or Windows Vista after the computer restarts if the default gateway is set by using the Netsh command
In certain conditions, the netsh command improperly adds a Unicode Null character before the real value for the default gateway in the registry. Note: The Small Business Server Connect to the Internet Wizard uses the netsh command to set the default gateway on the server.
Use the following steps to resolve this problem.
  1. Go into the TCP/IP properties of the network card and enter in the proper default gateway. 

    clip_image002 
  2. Download and install the hotfix associated with article 973243. This fix will prevent the netsh command from adding the Null value in the future.
  3. Manually edit the affected registry key to remove the improper value set by the netsh command.
      1. Run regedit.exe
      2. Navigate to 
        HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Para 
        meters\Interfaces\\DefaultGateway 
        Where is the interface value for the network card.
      3. Double click the value for DefaultGateway
      4. Remove any blank lines in the value.
      Here is an example of an incorrect registry value:
      clip_image003
      After you remove the blank line, the registry value should look like:
      clip_image004
      If you receive the following warning while saving the registry value, simply click OK
      clip_image005
  4. Once the update is installed and the registry change has been made, you must reboot the server.

11 Apr 2010

How to disable Internet Explorer Enhanced Security Configuration (IE ESC) in Windows Server 2008/2003

For Windows Server 2003 Users
I didn’t find a way to turn it off in the IE configuration and It seems one has to uninstall it: Go to Control Panel, then Add or Remove Programs, then click on Add/Remove Windows Components uncheck the Internet Explorer Enhanced Security Configuration and click on next.






For Windows Server 2008 Users
In Windows Server 2003, one has to uninstall the corresponding Windows Component. In Windows Server 2008, this doesn’t work anymore. You have to click on the root folder in Server Manager. Then you scroll down to the Security Information Section and click “Configure IE ESC”. You can turn off IE ESC for Administrators and/or for users. The latter probably only makes sense in a Terminal Server environment.

How to turn on automatic logon in Windows Server

This article describes how to configure Windows to automate the logon process by storing your password and other pertinent information in the registry database. With this feature, other users can start your computer and use the account that you establish to automatically log on
  1. Click Start, and then click Run.
  2. In the Open box, type Regedt32.exe, and then press ENTER.
  3. Locate the following subkey in the registry:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
  4. Double-click the DefaultUserName entry, type your user name, and then click OK.
  5. Double-click the DefaultPassword entry, type your password, and then clickOK.NOTE: If the DefaultPassword value does not exist, it must be added. To add the value, follow these steps:
    1. On the Edit menu, click New, and then point to String Value.
    2. Type DefaultPassword, and then press ENTER.
    3. Double-click DefaultPassword.
    4. In the Edit String dialog, type your password and then click OK.
    NOTE: If no DefaultPassword string is specified, Windows automatically changes the value of the AutoAdminLogon key from 1 (true) to 0 (false), disabling the AutoAdminLogon feature.
  6. On the Edit menu, click New, and then point to String Value.
  7. Type AutoAdminLogon, and then press ENTER.
  8. Double-click AutoAdminLogon.
  9. In the Edit String dialog box, type 1 and then click OK.
  10. Quit Registry Editor.
  11. Click Start, click Shutdown, and then type a reason in the Comment text box.
  12. Click OK to turn off your computer.
  13. Restart your computer. You can now log on automatically.

Applies to 2003, 2008 & 2008 R2.

ChromeAccess Puts Quick Access to About: Pages in the Navigation Bar

If you frequently use the About: pages in Chrome and want a speedier way to access them than typing in the URL in the address bar, ChromeAccess adds a quick-access button in the navigation bar.






You can always type about:cache or about:memory to access the hidden features in Chrome, but for frequent access, the two-click interface of ChromeAccess is much faster. Click on the navigation bar icon of ChromeAccess, a small Chrome logo, to access popular pages including the extensions menu, download history, bookmarks, and even more obscure items like cache info and histograms.