Google

2013-01-23

Workaround to get VMWare boot from USB

Plop Boot Manager Menu
This is probably not news to most VMWare users: Even with the latest VMWare Workstation 9 version, there is still no support from VMWare to boot from a USB drive.

The workaround most people use is to download Plop Boot Manager from 'http://www.plop.at/en/bootmanager/download.html', which acts like a bootable CD and gives you a list of menu options to boot from, one of which is 'USB' (see the screenshot).

I must admit that compared to Live CD, .iso boot options, USB booting is less common but you would think the most advanced solution in this space can do that...

2013-01-13

First Few Days with Windows 8

On the first (work) day of the new year, I decided to upgrade my primary work machine to Windows 8. I was not however ready to be 'down' in case things did not work out well, so I did a fresh install on the second drive.

GUI

OK, what's all this fuss about Windows 8 being Vista-2? Reading about lots of complains and all the talk about steep learning curve etc. I was expecting to be frustrated. Instead, I felt quite at home. All the usual keyboard bindings I am used to worked, I was able to quickly find any application I needed to run. Similarly it felt natural to locate power settings to tell windows not to shut itself down when I am not using it.

To be fair, I might have been frustrated if I was put in front of a Windows 8 box without knowing a single thing about it. I knew a couple of things like 'Charm' bar,  how to 'close an application' via mouse gesture,  but that's pretty much it.

I guess Microsoft could have done a better job of training people during set up or by providing some sort of welcome wizard showing people how to accomplish most common tasks to get people going.

APPS & WINDOWS APPSTORE

The first thing I did was to visit Windows AppStore to see what's available. There are bunch of 'apps' in there, though not much really. It felt more like Chrome Apps, which are 'mostly' links to existing web pages. I always like to use keyboard shortcuts, so I installed a couple of apps like "Windows 8 Shortcuts",  I installed.

...

Well, things got in the way and I could not get to finish this blog post as I intended to. I've been using Windows 8 extensively and have a much better notion of good and bad now. But before I list any of them, I would suggest anyone reading this to stop here and take a look at Paul Allen's Windows 8 review. It covers pretty much everything I wanted to touch upon if I had finished this post in the first few days as I initially aimed.

Assuming you've read that review. Here are a few additional notes from me...

WINDOWS DEFENDER

As described here by Microsoft, Windows Defender is essentially the Antivirus previously included in Windows Essentials. Like Apple's XProtect, Microsoft built this feature into the OS.

You can access it by searching it in Applications: Ctrl+Q > Windows Defender

I happen to keep a folder full of malware. When I download any anti-virus app to see how effective it is, one of the things I do is visit that folder and see if real-time protection will detect them. Because I am not really launching any of the files, some of that do not detect them that way. I won't go into details/

Then, I run a full disk scan and check the results. Comodo, for example had detected a file in a different folder that none-other had detected before. I uploaded that file to VirusTotal.com, which runs many common  anti-virus engines and reports the results. Not surprisingly, Comodo was the only AV that reported it: a false positive.

Anyway, Windows Defender detected all of them successfully when I did a full scan, which is good because I had replaced Microsoft Essentials a year ago as it had failed to detect any.

Yet, I may still need to disable Windows Defender and go with a different solution, not because of its detection rate but because I am suspecting that it has a bug that causes Windows Explorer to crash.

MYSTERIOUS WINDOWS EXPLORER CRASHES

After doing an in-place upgrade from Windows 7, I did not notice any issues for a couple of days but then started to notice that sometimes taskbar would just disappear and re-appearing. I know from experience that this happens if Windows Explorer crashes.



When I checked the Event Viewer, sure enough I saw Event ID 1000 Errors in the Application log and a couple of "Information" entries afterwards that told me "The shell stopped unexpectedly and explorer.exe was restarted".

Slowly, I detected a pattern and was able to repro the issue: It would crash when I browsed to some folders where I had tons of files. Antivirus is a suspect in such situations... To see if Windows Defender may be the culprit,

  • I browsed to the problem folder and scrolled down quickly. Explorer crashed.
  • Repeated this a few times and Windows Explorer kept on crashing each time.
  • Then I brought up Windows Defender > Settings > Real-time protection, and Turned it off.
  • Repeated the test above. This time Windows Explorer did not crash.

I am not fully convinced that Windows Defender is causing the Windows Explorer crash yet but it is the primary suspect at this point. I still need to do more testing and possibly take a crash dump to see if there any clues there.

DUAL-SCREEN CHARMING WOES

I have two monitors attached to my machine. One of the features of Windows 8 was native support for multi-monitor situations, yet I am not sure I like the implementation.

My first "annoyance" is with bringing up Windows Charm Bar (Win + C), which is supposed to show up when I am point at the upper right corner edge of the screen. That works, but it is not smooth. Sometimes, mouse will jump into next screen and I have to pay special attention to where exactly I am pointing it to.

The second "annoyance" is about the taskbar, it is mirrored on each screen. It seems redundant to me but I could not yet find an option to tell Windows 8 to display it only on one screen.

SHORTCUTS


You can help yourself a lot by learning a couple of shortcuts. There are tons of lists, tips and tricks out there you can find on the net but here are just the few to get you started. Even, if you insist on not learning anything else, learn these...

On your keyboard:
Windows Key  = Win
Control Key = Ctrl
Alt Key = Alt

Shortcuts:
Win      ->  Simply pressing Windows key let you switch between desktop and Start screen
Win + E -> Windows Explorer
Win + C -> Charms Bar
Win + I -> Windows Settings
Win + D -> Windows Desktop
Win + Q -> Search installed apps
Win + X -> Menu (see screenshot below)

Alt + F4 -> Closes active window, keep doing it and you can even restart windows.

"Win + X" shortcut displays a menu at the bottom left corner of Desktop, where "Start" menu used to be.

The bottom option will take you to Desktop as well.









FINAL THOUGHTS
I personally felt it was well worth spending $40 to get this upgrade. Microsoft is here to stay with us for quite some time and so is Windows. Adapting to new environment is a "built-in feature" of human beings as is resisting to change yet as we learned from Star Trek "resistance is futile" (extra points if you are playing Ingress and you are 'Englightened').

I am sure Microsoft will keep on ironing out pain points for users and make the UI better but no, Metro is not a disaster and as far as I can tell, Windows 8 is an OK release so far.

2013-01-11

Getting Members of Large Groups via PowerShell


PowerShell AD module make checking group membership a trivial task. If I wanted to get the list of members for a group, I can use Get-ADGroupMember cmdlet. Problem with module is that, it's an 'extra' component on top of standard installation and if you will use it, you need to make sure that your script will have access to it. You may be using PowerShell as your logon/start-up script and your machines may not have the AD module. Yes, there are techniques remote-session techniques that can be employed to work around this but most would prefer to enumerate group members some other way.

One common method is using .Net classes, specifically "DirectoryServices.DirectorySearcher". I had a function that was using this class to enumerate group members, something like this:

function Get-GroupMembers {

  param ([string]$group)

  $searcher=new-object directoryservices.directorysearcher   
  $filter="(&(objectClass=group)(cn=${group}))"
  $searcher.PageSize=1000
  $searcher.Filter=$filter
  $result=$searcher.FindOne()
  $members = $result.properties.item("member")
  if ($members) {
    return $members
  }

  return $false

}


I noticed that this stopped working for a specific group, and when I manually looked into the group properties,  I found that "member" property of the group was empty. There was; however, another noticeable property that got populated instead: "member;range=0-1499".

Long story short, when members of a group exceed 1500, AD was populating that property instead of plain 'member' property and I needed to use a different technique called 'ranged retrieval'.

The main change is that we use 'PropertiesToLoad' property to feed $searcher object the range of members we would like to get and loop through them. When we give $searcher object an invalid range, it throws an error at us and we catch that to exit the loop. Here is the modified function.

## Return members of given AD group

function  Get-GroupMembers {

    param ([string]$group)

    if (-not ($group)) { return $false }
  

    $searcher=new-object directoryservices.directorysearcher   
    $filter="(&(objectClass=group)(cn=${group}))"
    $searcher.PageSize=1000
    $searcher.Filter=$filter
    $result=$searcher.FindOne()

    if ($result) {
        $members = $result.properties.item("member")

        ## Either group is empty or has 1500+ members
        if($members.count -eq 0) {                       

            $retrievedAllMembers=$false           
            $rangeBottom =0
            $rangeTop= 0

            while (! $retrievedAllMembers) {

                $rangeTop=$rangeBottom + 1499               

               ##this is how it would show up in AD
                $memberRange="member;range=$rangeBottom-$rangeTop"  

                $searcher.PropertiesToLoad.Clear()
                [void]$searcher.PropertiesToLoad.Add("$memberRange")

                $rangeBottom+=1500

                try {
                    ## should cause and exception if the $memberRange is not valid
                    $result = $searcher.FindOne() 
                    $rangedProperty = $result.Properties.PropertyNames -like "member;range=*"
                    $members +=$result.Properties.item($rangedProperty)          
                   
                     # UPDATE - 2013-03-24 check for empty group
                      if ($members.count -eq 0) { $retrievedAllMembers=$true }
                }

                catch {

                    $retrievedAllMembers=$true   ## we received all members
                }

            }

        }

        $searcher.Dispose()
        return $members

    }
    return $false   
}