Question about ModelAlias.vbs - not producing what expected on Lenovo machines

So i am trying to use ModelAlias.vbs userexit script to create sensible names for Lenovo machines so i can arrange my MDT driver structure accordingly.
I have found these articles:
Deplyment Guys Blog:
http://blogs.technet.com/b/deploymentguys/archive/2009/09/10/using-and-extending-model-aliases-for-hardware-specific-application-installation.aspx
Mikael Nystroms Blog:
http://deploymentbunny.com/2012/05/01/modelalias-user-exit-for-microsoft-deployment-toolkit-20102012/
Whats not so fun with Lenovo machines (there are other vendors also i guess) that model name for machine could be something like 6138W1K when giving commandprompt command wmic csproduct get name. Actual model name for 6138W1K is ThinkCentre M58p.
Problem:
So i assumed ModelAlias.vbs would return something like ThinkCentre M58 as an result so i could use that for folder structure (or in database) Problem is that ModelAlias.vbs gives that model number 6138W1K as result not
producing that actula model ThinkCentre M58p.
Im testing ModelAlias using this:
del C:\MININT\SMSOSD\OSDLOGS\VARIABLES.DAT /q
cscript ZTIGather.wsf /inifile:..\Control\CustomSettings.ini
“E:\Extra\Trace32.exe” c:\minint\smsosd\osdlogs\bdd.log
(Also from Mikael Nystroms blog:
http://deploymentbunny.com/2011/04/27/quick-and-dirty-testing-customsettings-ini-variables-in-mdt/)
Result from bdd.log
MODELALIAS is set accordig model NOT version info??
My CustomSettings.ini is set like this
[Settings]
Priority=SetModelAlias, Default
Properties=ModelAlias
[SetModelAlias]
UserExit=ModelAliasExit.vbs
ModelAlias=#SetModelAlias()#
Something is not right or is it :)

Looking at the script, the model numbers aren't populated, looks like you have to do that yourself.   The script will find the 4 leftmost characters of the Lenovo model type and return it. If you want to translate that to something else its up to you
to enter it. It really doesn't have to be translated, unless you want it to be. If your driver folder is named 1706 and the ModelAlias returns 1706, you're good to go.
See under "Select Case sModelSubString" where it says Case 1706? The next line 'SetModelAlias = "ThinkPad X60"' will translate 1706 into "ThinkPad X60". but that's the only example given. You would need to add a separate Case for each model you own.
Case Else says if you don't match any of the existing cases, then do this. In this case its "SetModelAlias = sModel", or return whatever sModel contains. I guess that is the entire 7 digit model and subtype?
Change that to SetModelAlias = sModelSubString, and it will return just the 4 digit model, i.e. 1706.
'============
    Case "LENOVO"
            ' Check by first 4 characters of the Model
            If SetModelAlias = "" Then
                sModelSubString = Left(sModel,4)
                Select Case sModelSubString
                    Case "1706"
                        SetModelAlias = "ThinkPad X60"
                    Case Else
                        SetModelAlias = sModel
                        oLogging.CreateEntry "USEREXIT:ModelAliasExit.vbs|SetModelAlias - Alias rule not found.  ModelAlias set to Model
value." , LogTypeInfo
                End Select
            End If
'=============
I'm not going to go into a vbscript tutorial here, there are many sites around the net to learn from. Here is a good tutorial on Select Case:
http://technet.microsoft.com/en-us/library/ee176979.aspx

Similar Messages

  • HT5463 Questions about the "Do Not Disturb" feature not addressed in documentation

    Hello,
    I have some questions about the "Do Not Disturb" feature which are not quite addressed by the documentation.
    When DND is enabled, will badge app icons still be displayed?
    When DND is turned off, either manually or automatically, will Notification Center banners be available for alerts which occurred while DND was on, or are they lost forever? 
    I guess the main questions is, is DND like an answering machine, which stores up your notifications until you are ready to deal with them?  Or is it a return of the "turn off all notifications" feature that existed in iOS 4, albeit in a more evolved form?
    Thanks,
    - Steve

    If you have a schedule set, but activate it manually, it will de-activate at the scheduled time anyway. It behaves perfectly on my 4S, my wife's 4, and both of our iPads.
    If you have an iPhone 5, it could be tied to the known issue with automatic time set going Wonky on LTE networks. If that's the case, try disabling the automatic time set and see if it behaves itself.

  • Yes i send in a question about my ipad not coming on got anwear back but still isnt work,has been plug in but well not come on at all nothing .tryed to reset that dosent work,what else can i do ,help needed thank you

    i sent in a question yesterday about my ipad not coming on ,got a anwear back to try and it still dosent come on it had been plug in ,also tryed diff plug still nothing only had it 6 months
                                                                            thank you hope you can help

    I was in the exact same situation. I completed the order online, waited five days, and eventually called them back to be told that my order was still processing. I told them to cancel it, and I would retry. I ordered it again the next week, and it all happened again. They offered to escalate it and have it processed manually, but it could take another 48 hours. I told them to forget it.
    The next week, I activated a single line on my own account. It worked flawlessly. I ordered around 4:00 PM, and it showed up around 4:00 PM the next day. The difference was that I activated a single line on a new account, as opposed to activating another line on another account.
    It was a headache, and believe me, I know how you feel. Verizon representatives are more of a headache than they are actual help. Their hands are always tied, and everything has to be escalated.

  • Questions about Micro-Firmware (Not 2.x.x

    Hi Guys,
    i got some questions about the .0.03 firmware.
    ) What's the difference between the :
    ZenMicro_PCFW_LB__0_03_PDE.exe ,57 MB 8 Feb 05.
    and the
    ZenMicro_PCFW_US__0_03_PDE.exe ,8 MB 08 Dec 04 ?
    Does "US" means that this is the north american version ?
    So what is LB ?
    2) I've got the "ZenMicro_PCFW_US__0_03_PDE.exe ,8 MB 08 Dec 04". Is there any use of upgrading to the one from 8 Feb 05 ?
    3) ZenMicro_PCFW_US__0_03_PDE.exe
    Does the "E" at the end means "european", so the loudness is reduced ? Must be something different because it's also included in the firmware from the american site.Message Edited by Baron on 02-20-2005 09:0 AM

    From what I've picked up elsewhere in the forum, the LB version of the .0.03 firmware just includes MORE LANGUAGES (for the user interface, i.e. menus) than the US version of that same firmware. see : http://forums.creative.com/creativel...essage.id=2374 ... which, really, you should have found using the search function, before posting. --Fred.
    /edit: linkified.
    Message Edited by fred_be9300 on 02-20-2005 06:48 PM

  • Question about mirroring art not once but twice.

    So I am a Production Artist for a bigger company that mainly makes shoes, but also makes Jerseys and T-Shirts. I build around 15 shirts a day. What we do is build "Full Size Art" off the artboard of an illustrator file, the size it would be on a shirt. Then on the art board itself is a visual. One Box to show a clear view of the art then below two garments; a front view of a t-shirt and a back view. I figured out how to mirror the art from the Full Size to go in the first box using the effect>transform>ReflectX&Y and put in the correct measurements. But That only takes care of it once. When I try to do the same thing again it will not only mirror the original art it will mirror the mirror and then I have too many copies. Is there anyway to accomplish what i'm trying to do? All help is appreciated!

    In this case I would consider using symbols.
    With 1 color artworks you could apply effects, but with your artwork symbols are simpler. Since the registration point is fixed in CS5, you won't have too much trouble with instances repositioning when editing the symbol artwork
    This is for 1-color-artwork:

  • Question About Runtime Class Not Found Exception

    Good Morning!
    I have a very simple test class that I am using to debug a class loader issue with log4j. I can compile my class. I put the class in a jar file with a manifest that points to the class with the main method. The log4j .jar file is in the .\lib directory, below the test1.jar file. I have fussed around with different variations of -cp & -classpath, without success. I can not figure out why the runtime environment can not load the org.apache.log4j.Logger class.
    What is wrong with the way that I am setting up the runtime environment?
    Thank you!
    ==========================
    source:
    import org.apache.log4j.Logger;
    public class Test1 {
        static Logger logger = Logger.getLogger(Test1.class);
        public static void main(String[] args) {
            System.out.println("Hello World");
    }===========================
    compilation:
    X:\test>javac -classpath .\;.\lib\log4j-1.2.14.jar Test1.java
    jar:
    X:\test>jar -cvmf .\META-INF\MANIFEST.MF test1.jar .\*.class
    added manifest
    adding: Test1.class(in = 627) (out= 380)(deflated 39%)
    MANIFEST.MF:
    Manifest-Version: 1.0
    Created-By: 1.5.0_11 (Sun Microsystems Inc.)
    Main-Class: Test1
    ==========================
    .\lib:
    X:\test>dir .\lib
    Volume in drive X is Storage
    Volume Serial Number is 5871-E6FF
    Directory of X:\test\lib
    11/25/2009 10:19 PM <DIR> .
    11/25/2009 10:19 PM <DIR> ..
    11/25/2009 10:05 AM 367,444 log4j-1.2.14.jar
    1 File(s) 367,444 bytes
    2 Dir(s) 27,042,570,240 bytes free
    X:\test>
    run:
    X:\test>java -client -classpath .\;.\lib\log4j-1.2.14.jar -jar test1.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
    at Test1.<clinit>(Test1.java:6)
    Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    ... 1 more
    Could not find the main class: Test1. Program will exit.
    X:\test>

    Fussing around with the -classpath parameters won't do anything, because they are ignored when the -jar parameter is present. Running an executable jar means that you specified the classpath in the jar's manifest. Which you didn't do. You need a Class-Path entry in the manifest which provides the path to the log4j.jar file relative to your executable jar.

  • As a follow up to my previous question about the mail not loading, when I went to see my account to confirm my e-mail, the message was not there, I had to go to my SO S L O W acoount to answer your request

    I just confirmed my e-mail account, but I had to go to my very slow AOL connection since the message you guys sent me was not visible in the body of the page, just the header

    Just to say there ARE lots of Apps on BlackBerry World, so potential BB purchasers should not let that stop them, and some very good free ones, excellent -- BlackBerry Travel is really good, and OsmAnd maps are fabulous, big to download, but when you get it you'll be amazed. Just download a provincial or smaller map to start, because they are huge files and very detailed, but lots of trails and paths are on them... good for park trails and such.

  • I have a question about flash player not working.

    I have downloaded and installed both the adobe flash and shochwave players on both my computer. When on a page that requires a flash player I get the message to install adobe flash player. Under computer; program files neither show as being installed just adobe reader and adobe help show. Now under the control panel under Programs and Features the shockwave does show but not the flash player 10. I have a desk top running XP Pro 32 bit. and a laptop running vista 32 bit. I have tried differnt things from the support page nothing there seems to work. I have uninstalled and reinstalled the programs seveal times.  I did have adobe 8 before which worked fine on my desktop but have been unable to find it to download. Could someone help me to get them to work. Any help would be wonderful, thank you. Patches_11

    I am using IE 8 for a broswer.
    No I can see no animation on the site you sent.
    under the folder C:\Windows\system32\Macromed\Flash is the following 2 files
    1. flashInstall 9/22/2010 12:51 a.m. text document 4kb
    2. install  8/2/2010 12:23 a.m. text douctment 21 kb
    that is all that is there.

  • Question about Photoshop Elements, not sure where else to post at.

    I am looking to be able to add layers and do some fun type editing for photos to use as backgrounds and media shows. I'm new to this. I am planning to add Photoshop Elements and was just curious if it does enough different stuff from iPhoto 11 to make it worth it as well as enough to avoid purchasing the bigger more expensive Photoshop programs. I am also wondering where to get good tutorials on learning to use it, if so. Any help? Thanks.

    PhotoShop Elements will do what you want, and is a good complement to iPhoto. For learning it, I suggest Barbara Brundage's excellent Missing Manual for PhotoShop Elements (Macintosh).
    http://oreilly.com/catalog/9780596804961
    Adobe also has lots of tutorials on their website.

  • Question about the new notes application?

    the new notes application is great but is there anyway to transfer the files off the ipod and view them in word or notepad on your computer as that would be a really useful feature.
    cheers.

    At this time the only option is to press the email button and send the Note to your email address. 
    Hopefully Note syncing will be included in a future update:
    http://www.apple.com/feedback/ipodtouch.html
    I and many others have already requested this update at the link above.
    cheers
    mrtotes

  • BT Inifinity...Not getting what expected.

    [URL=http://www.speedtest.net][IMG]http://www.speedtest.net/result/1510862342.png[/IMG][/URL]
    Infinity was installed on thursday and this is all im gettin surely cant be right??? Its really disappointing...

    Adamzs25 wrote:
    [URL=http://www.speedtest.net][IMG]http://www.speedtest.net/result/1510862342.png[/IMG][/URL]
    Infinity was installed on thursday and this is all im gettin surely cant be right??? Its really disappointing...
    Are you using wireless? and if so you need wireless n to get the best speed from Infinity.
    More info in message #5 on this thread.- http://forums.digitalspy.co.uk/showthread.php?t=1543967
    Adams speed http://www.speedtest.net/result/1510862342.png
    Please Click On any Text in Blue as that automatically links to information.
    PC (NDEGR)

  • Hi, Question about secure empty trash. I moved some Time Machine backup files to the trash from an external hard drive. Now I can't secure empty trash. It starts, finds 74,003 files, and does nothing. The external hard drive shows it's empty, but it isn't

    I moved some time machine backup files from an external USB hard drive to the trash. Tried secure empty trash. It counts 74,003 items, then just sits there. The external hard drive window shows it's empty, but the info pane says it only has 50G of memory left. I left the secure empty trash on over night. It did nothing. Ideas?
    Thanks,
    Ron

    Relaunch the Finder, then from the Finder menu bar, select
    Finder ▹ Preferences ▹ Advanced
    and uncheck the box marked Empty Trash securely. Try again to empty the Trash.

  • Question about Java Errors

    I have some questions about some java errors
    1. what kind of errors are contained in Error class?
    2.does this class contain only runtime errors?
    3. if the question number 2 is positive, what about InstantiationError which is a compile error and is a subclass of Error.
    4.When our program is out of memory, which processes are done for an error to be produced. is the error actually from OS or VM?

    I have some questions about some java errors
    1. what kind of errors are contained in Error class?An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch.
    2.does this class contain only runtime errors?No
    3. if the question number 2 is positive, what about
    InstantiationError which is a compile error and is a
    subclass of Error.
    4.When our program is out of memory, which processes
    are done for an error to be produced. is the error
    actually from OS or VM?Various - both, depending on where the error occurred.

  • Some Questions about NI-6602

    Hello!!
    I have some question about NI-6602.
    1.What is the difference between Port and Line ?
    What's the difference of Line nad Portin these functionIG_In_Line,DIG_Out_Prt,DIG_Line_Config,DIG_In_Prt,DIG_Out_Prt,DIG_Prt_Config
    2.If I would like to apply gate to my counter application, is it possible that we give the gate signal via software?
    Or I need to connect signal from hardware? If hardware is needed, is it possible to apply another counter's output as my counter's gate input?
    3.Can we apply gate to this fuction ND_PULSE_TRAIN_GNR?
    4.Can we detect the counter's source is High or Low ?Is there any fuction to read out the source status?

    Hello,
    Thank you for contacting National Instruments.
    "1.What is the difference between Port and Line?"
    A Port is a collection of lines. Usually 8 lines to a port.
    "What's the difference of Line nad Portin these function DIG_In_Line, DIG_Out_Prt, DIG_Line_Config, DIG_In_Prt, DIG_Out_Prt, DIG_Prt_Config"
    These functions either perform an output or input, or configure your digital ports and lines. Please see the Traditional NI-DAQ Function Reference Help found under Start >> All Programs >> National Instruments >> NI-DAQ >> Traditional NI-DAQ Function Reference Help for more information on these functions.
    "2.If I would like to apply gate to my counter application, is it possible that we give the gate signal via software? Or I need to connect signal from hardware? If hardware is needed, is it possible to apply another counter's output as my counter's gate input?"
    You can apply a gate signal from software. For example you can use the 6602's Timebase to gate your counter during pulse measurement applications. You can also route a counter's output to the gate of another counter internally. Look up Select_Signal in the Function Reference Help for more details.
    "3.Can we apply gate to this function ND_PULSE_TRAIN_GNR?"
    I am not sure what you are asking here. ND_PULSE_TRAIN_GNR is a parameter used in the GPCTR_Set_Application function to set up a counter for pulse generation. Please see the page titled "application = ND_PULSE_TRAIN_GNR: GPCTR_Set_Application" in the Function Reference Help more more information about this parameter.
    "4.Can we detect the counter's source is High or Low ?Is there any fuction to read out the source status?"
    There is no function to read the state of the source pin. You will need to route the source pin to a PFI line and perform a digital read on that line.
    I hope this answers your questions. Please feel free to reply if you have any further questions.

  • Questions about "native"

    public class Hello
         public static void main(String[] args)
         public static native void amethod();
    i have some questions about the above snippet:
    1) what does "native" mean?
    2) why the above program compiles but you would get a
    runtime error if you have a call to that amethod?
    3) why the amethod cannot have a body?
    Thanks a lot,
    eileen2

    Thanks for your help, but can you answer my second
    question as well?
    eileen2It compiles because the native method is correctly declared. It cannot run correctly because no native library (a .dll in Windows, a .so in Unix) that implements that method has been loaded - see java.lang.System.loadLibrary().
    It cannot have a body because native methods must only be implemented in native (read non-Java) code.

Maybe you are looking for