IThastobecool.com Geeks have opinions too!

18Dec/090

WBEMTest: Handy tool for testing your WMI Queries

When you are working with deployments, whether it is SCCM, MDT, Altiris, LanDesk or whatever tool you are using, or you’re building a script which uses WMI queries, there’s always some actions you only want to perform on certain computers. In SCCM and MDT there’s builtin support for WMI queries. For instance, you want to apply a mass storage driver only to a computer that has that controller present.

image

To build these WMI Queries, in the past I always used the WMIC commandline tool. A very handy tool, but the syntax for this tool is a bit different then your average:

SELECT * FROM Win32_ComputerSystem WHERE model LIKE ‘%DC7900%’

In WMIC this query would be translated to:

WMIC PATH Win32_ComputerSystem WHERE “model LIKE ‘%DC7900%’

For this particular query it’s not that different, but what if you only want to get certain values?

SELECT Model FROM Win32_ComputerSystem WHERE model LIKE ‘%DC7900%’

Would be translated to:

WMIC PATH WIN32_ComputerSystem WHERE “model LIKE ‘%DC7900%’ GET model

 

As you see, it’s not really hard translating the commands, but there’s an even easier way to get your WMI Queries :)

Use the builtin Windows Management Instrumentation Tester: wbemtest.exe
Start>Run>wbemtest.exe

image

Click on connect and type the namespace you want to connect to: (Default for WMI is root\cimv2)

image

Now we have all sorts of buttons available… we can easily open and explore a class and see it’s methods and properties… we can create a query in the syntax of:

SELECT * FROM Win32_ComputerSystem

 

Happy exploring and testing with WMI :)

Tagged as: No Comments
30Aug/096

Xenocode: A damn good alternative to VMware Thinapp!

As Mark pointed out in his earlier post: The VMware Thinapp team really needs to wake up… it’s not acceptable (from my point of view) to still not have Windows 7 support for you application virtualization product!!

Mark pointed me to an alternative called Xenocode: This is looks a LOT like Thinapp/Thinstall and works on Windows 7 as well :)

Virtualizing Applications

To get started, first go to www.xenocode.com and download the Virtual Application Studio.
When you fire up the VAS you get a wizard which provides you with 3 ways of virtualizing your application:

image

The first option allows users to easily virtualize an application using a template. This template contains all the settings for virtualizing an application. It’s as easy as next next finish :) . This is really awesome for organizations where you want your application support team to virtualize the application, as they don’t have to know in-depth how application virtualization works :) .

The second option allows users to virtualize an application the way we know it from VMware Thinapp. It first takes a snapshot of the computer, then prompts the user to install the application /set configuration options etc and then takes another snapshot and does a diff on the snapshots to determine what files and registry settings should be in the virtual application.

The third option allows users to manually specify the files/folders and registry settings that are required for this application to run (really useful when virtualizing your in-house developed applications, seeing as the developers know exactly what file should go where, and you don’t get any clutter from background processes etc.)

After you captured your application, you can easily include common runtimes from the runtimes tab (such as the .NET frameworks, java, flash etc)

image

The toolbar on the left side of the screen gives us access to the various parts of the virtual application, such as File system, Registry etc.

image

I’ts also possible to generate a MSI package for the virtual application for easier deployment using SCCM/MDT/GPO/Whatever you use to deploy your software to your users.

image

For troubleshooting your virtual application Xenocode provides a checkbox to Generate diagnostic-mode executable. Basically what this does is create an executable that will output logging in 3 log files next to the application, so if something is not working in your application, you can easily troubleshoot :)

image

If you enabled it in your application settings (on by default) it’s also possible to pass command line switches to your application at startup time.

    • /XEnv=Variable Name=Value Specifies additional environment variables.  Multiple /XEnv arguments can be used to add additional environment variables.
    • /XLayerPath=Layer Path Adds the given xlayer file into the virtual environment.  Multiple /XLayerPath arguments can be used to add additional virtual layers.
    • /XSandboxPath=Sandbox Path Specifies the path to be used for the application sandbox.
    • /XShellEx=Command Specifies a shell execute command to be launched from within the virtual application environment.  This option overrides any startup files specified in the virtual application configuration.  Only one /XShellEx argument can be specified.
    • /XShellExVerb=Command Verb Specifies the verb to be used in conjunction with the XShellEx command.  The default verb is OPEN.
Middleware

When dealing with middleware, in Thnapp we could specify an applink and with App-V we can use dynamic suiting to allow for interbubble communications. In Xenocode you don’t make an application for your middleware, but make it a component, which you can import in your applications.

image

image

 
Deploying Virtual Applications

Deployment of the virtual applications is done through a tool called XReg. This allow the administrator to control how the application is published to the user.

image

 

This can be done from a startup/logon script. This area needs some more work in my perspective, there’s not a nice and nifty GUI management interface as with App-V.

Also the possibility to create MSI’s makes deployment a bit easier, just use your favorite deployment method for your virtual applications.

Pricing

Not the most fun part for us techies, but important for the ones who have to make the decisions about investments, and what application virtualization technology will be used.

The Xenocode Virtual Application Studio ISV Edition costs $1599

End-User licenses: $40 per seat.

 

Well that’s about it :) . As a final conclusion i think Xenocode is a real nice application virtualization product, it works easily and out of the box, users don’t have to know a lot about Windows and application when you just give them the right application templates :) . As with VMware Thinapp, the problem is how to distribute the applications to your clients, and how do you make sure that all users have the latest version of the virtualized application… well that’s something the Xenocode team needs to think about I guess.

17Aug/0942

ZeroTouch for MDT 2010 without SCCM!

Don’t you just wish you could set all your clients to boot from network, and let the PXE server evaluate whether or not it should load the WinPE image to redeploy the computer? Well you can with SCCM using mandatory advertisements of course… but I've written a little script that will achieve the same functionality using native MDT, without the use of the SCCM infrastructure :)

Here’s how you do it:

  • Requirements:
    • MDT2010 (beta 2) /WDS installed on Windows Server 2008
    • Powershell enabled on the WDS server
    • MDT deployment share configured to use the database (i’m using an SQLEXPRESS instance configured on the same machine as MDT/WDS in this example)
    • SQL Server Management Studio or equal SQL server management tooling for editing the database.

Ok here we go and setting it up. First some simple stuff :)

  • Set your WDS server to admin approval mode

image

  • On the Directory Services tab, make sure you set the OU location in which the WDS server will create the temporary computer object for approved devices

image

  • Make sure your WDS server account has full control on the OU set in the WDS directory services

image

Ok, that was easy now wasn’t it?

Now let’s edit the MDT database to fit our needs. This assumes your already set up your database using the database wizard in the MDT Workbench.

  • Start the SQL Management Studio application and expand the MDT database (MDT_DB in this example)
  • Browse to Tables –> dbo.Settings –> Columns

image

  • Right click Collumns and select New Column

image

  • Give the new column the name of netBoot and type nvarchar(50)

image

  • Save and close the SQL management studio
  • Verify the database expansion was successful by opening the MDT Workbench and navigating to the database view > Computers > properties

image

  • Select the Details tab and browse all the way to the bottom to verify that the netBoot value is there

image

Ok, that was part 1 of the configuration. Now we have to know what to actually do with this extra field in the database. Well that’s where my script comes in. Here’s how you install it.

  • Run the following command as an administrator on the WDS/MDT server:
    • Server 2008: Powershell.exe –command “ & {Set-ExecutionPolicy Unrestricted } “
    • Server 2008 R2: Powershell.exe –command “ & {Set-ExecutionPolicy Bypass } “
  • Download the MDT-ZTI.ps1 file to your WDS/MDT server (in this example I'm using D:\MDT-ZTI.ps1)
  • Start Task Scheduler and Right click library > Create Task

image

  • Give the task a name of your liking. I’m using MDT-ZTI in this example.

image

  • On the triggers tab select: New

image

  • Begin the task: On an event

image

  • Log: Microsoft-Windows-Deployment-Services-Diagnostics/Operational
  • Source: Deployment-Services-Diagnostics
  • EventID: 4096
  • Click Ok and go to the Actions tab and select New

image

  • Add action

image

  • Start a Program
  • Program/Script: Powershell.exe
  • Add Arguments(optional): –command D:\MDT-ZTI.ps1

Ok the ZeroTouch “service” is almost ready to go. Now there’s another thing that we need to configure… we have expanded the MDT database to contain an extra column…  but how does the service know what database and what database server to use?. Well that is hardcoded in the top of the configuration of the MDT-ZTI.ps1 file. In the future I will be using params() from powershell, but for now just change it in the top of the script.

# //***************************************************************************
# // Configuration:
# // Notes: Set the database name and datasource for your environment here.
# // For SQLEXPRESS on the same server use "\SQLEXPRESS" as datasource  # //***************************************************************************
$Database = "MDT_DB"
$DataSource = ".\SQLEXPRESS"

 

 

Now how does the “service” know what computers are allowed to boot into WinPE and what computers should boot to the next boot device? That’s a simple 3 part answer:

  1. Every computer that is NOT in the MDT database will be rejected (pxeabort.com) by the ZTI.
  2. Every computer that IS IN the MDT database will be polled for the value of netBoot.
  3. If the value of netBoot does not equal FALSE it will approve the device so it will load the boot image, and then set netBoot to FALSE so the device won’t load the boot image on the next reboot :)

So if you have a computer which is not booting into winPE just clear the netBoot field in the database and on the next reboot it will boot into winPE.

IMPORTANT: Please be sure to test this first in a test environment first, it is not recommended to implement this in production directly.

Download:  MDT-ZTI

20May/090

Windows 7 Problem Steps Recorder Script

Yesterday I wrote about the Problem Steps Recorder and how it can help us lazy IT admins who have to screenshot some setups/manual actions for recipe files or documentation in general. When I was messing around with the PSR I found out one really annoying fact: the PSR window is always on top in all the problem report screenshots.. That's not really nice for our documentation now is it? So I wrote this quick Auto-IT script that Starts PSR>start recording>wait until ESC key is pressed>stop recording>ask where to save file

Download the script from here

Here is the code (simple ofcourse ;) )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Problem steps recorder script
;; V1.0 HHO Login Consultants
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#include <Misc.au3>
Run("psr.exe")
WinActivate("Problem Steps Recorder")
WinWaitActive("Problem Steps Recorder")
Send("{ALTDOWN}a{ALTUP}")
WinSetState("Problem Steps Recorder", "", @SW_HIDE)
while 1
	if _IsPressed("1B") then ExitLoop
WEnd
WinSetState("Problem Steps Recorder", "", @SW_SHOW)
WinActivate("Problem Steps Recorder")
WinWaitActive("Problem Steps Recorder")
Send("{ALTDOWN}o{ALTUP}")
19May/091

Windows 7 Problem Steps Recorder

When you have to help out users with their problem, nothing is more frustrating then the users' inability to clearly state what their problem is, and how they got to the point where it went wrong. Fortunatly, Windows 7 packs a really really really awesome tool that will get rid of those problem once and for all: the Problem Steps Recorder.


This nifty little tool records the users' screen and outputs all relevant information in a MHTML document, which will contain all screenshots and steps needed by the helpdesk user. Thanks to Ment van der Plas for pointing this tool out to me :D

You can start Problem Steps Recorder by Start>Run>psr.exe and try it out :)

This tool is also very very very interesting for all us lazy IT guys, who don't want to screenshot their installations for recipe files etc :)

28Apr/094

Pretty Good Frontend Revisited for LTI

The last few days i've been messing around with an MDT 2008 environment in which the customer wanted to have some kind of wizard page when a computer was being deployed that was not already in the database. I remembered the Pretty Good Frontend by Johan Arwidmark which was an awesome discovery back when we were still using BDD2007. My customer however didn't have ZTI but LTI deployment going on, so I had to customize Johan's Pretty Good Frontend to my customer's needs. So why not share it with the community? :)

Many thanks go to Johan Arwidmark for inventing the PGF in the first place, and Michael Niehaus who helped me solve a scripting issue :)

Allright here goes:

Features
- Only appears if computer is not in the MDT Database already
- Allows for entering a computer name
- Allows for Selecting target OU (Selection list is from live Actice Directory data)
- Allows for role selection (Selection list is from live MDT database)
- Configured from rules in bootstrap.ini, no hardcoded values in the Frontend
- Started as a userexit (no scripts on the winpe image)
- Checkboxes to select which data to store in the database

30Dec/080

Installing Hyper-V Part 2

Okay it took a bit longer then desired, however here is the first actual part concerning installation of Hyper-V.

So what is actually the most important component when designing a Hyper-V environment? Just like VMware it is actually the storage. Of course you could start out with local storage but quite frankly; that is not anything near a modern infrastructure anymore. One could argue that for a test/home environment local storage is sufficient but I don't quite agree with that: Most challenges in a server virtualization implementation are actually storage and backup based. Although it pretty much extends the scope of my inital blog series plan I find it important enough to discuss it so here it goes!

Central vs Local storage

Local storage of course limits you in flexibility and expandability. However on my demo laptop I am forced to use local storage while keeping my VM's synchronized between my Laptop and my regular environment. How I will synchronize this I will get back to while blogging about replication and site recovery.
Apart from a portable demo environment there is no justification to implement server virtualization with Hyper-V on local storage.

Central Storage Iscsi or Fiber?

It will be obvious that a fiber based storage solution is a bit above my budget for home usage thus that answers that question quite easily. However what about production environments?

Fiber is the way to go

When taking variables as price, performance and proven technology into account a fiber based SAN is the way to go. Fiber will obviously give you a maximum throughput of 4 Gb/s whilst Iscsi is limited to 1 Gb. Indeed, 10 Gb ethernet is available yet not quite stable in relation with Iscsi yet. The storage market is rapidly moving (like the virtualization market) however and I do expect that 2009 or 2010 will be the definite breakthrough of stable ISCSI based storage networks. If I would be an IT manager and I would have to make the decision now, I would simply play safe and choose fiber.

For test and small production environments ISCSI is however an excellent low cost choice.

Hardware or software based storage solution?

Basically this is a no brainer; production and business environments will use something like HP EVA, DELL Equallogic or Netapp based hardware. In principle all fine solutions that differentiate on matters way beyond the scope of this Blog and storage expertProxy-Connection: keep-alive
Cache-Control: max-age=0

will be way more valuable to consult concerning this. What I want to talk about are the software based solutions on the market available today since that will be the material I'll be working with. There are a couple of options:

Well I was enthusiastically writing this article while encountering this blog on the net that explains it all perfectly. For the lazy readers: freeware iscsi target software does not support Windows 2008 clustering (yet).
So my dilemma was; to pay or not to pay for Iscsi target software? Iscsi cake is still affordably ($199) priced but starport is too much for me. However; affordably is not necessarily reasonably and I decided to drop the wish to develop a windows 2008 cluster. Instead I will use 2 seperate Hyper-V machines that will connect to an openfiler box. Why openfiler? Well the forums are very alive and the last years I've been using that software with success in VMware test environments. So it is pretty familiar software for me.
Right now I'm not in the mood for making a drawing of my proposed infrastructure, but here's in a nutshell how it's going to look like:
- 1 openfiler ISCSI storage server (2TB gross capacity), 2x1GB NIC
- 2 identical Windows 2008 enterprise servers with the Hyper-V role installed. Both 3x1GB NIC
- 1 Hyper-V server 2008 system, 2x1GB NIC
- 1 Laptop with Windows 2008 enterprise with Hyper-V role installed. 1x 100MB NIC
Key software to be used:
- Openfiler 2.3
- Windows 2008 Enterprise Edition
- Hyper-V server 2008
- Data Protection Manager 2007
- SCVMM 2008
Till next time!
Tagged as: , No Comments
29Nov/080

Seqinfo “a lazy admin tool”

At this moment application virtualization is hot; and because of this I am at a customer where I have to sequence no more than 15 applications. Because I want to make neat packages with all the info someone who has to troubleshoot my packages needs I created “SeqInfo”.

 

Seqinfo is a simple tool that will save you a few mouse clicks and minutes every time you create a new package. (I am aware that this is totally useless in my situation because I only have to sequence 15 applications: but I’m just lazyJ)

 

What will it do after I setup you’re tool:

·         it will ask you for some input:                              

o   You have to enter you’re name (just once it will remember)

o   You have to enter the package name

o   You have to enter the 8.3 name (read the app-v manual why!)

·         After this point SeqInfo takes full control

o   Creates a folder on the Q drive (Q:\{8.3 package name})

o   Start the Microsoft Application Virtualization Sequencer

§  Start the sequencing wizard

§  Enter the Package name

§  Enter the comments

§  Click begin monitoring

§  Browse to primary install directory and start the monitor

 

Wow, can we have this tool? Of course just click here and enjoy, please note that comments and suggestions (not about typo’s!) are always welcome please drop them below in the comments box. And make sure you also checkout the Resource kit from Immidio that contains the app-v pingtool and visit Softgridblog.com for some decent independent information about app-v!