none
MDT 2012 currently logged on user variable

    Question

  • Hi guys while doing a specific USMT capture TS that users run themselves via a shortcut (to prestage a new laptop we are building for example), is there a simple way to get the currently logged in user ID into MDT.

    If possible I would like to inject it directly into the customsettings.ini from the batch/script/shortcut being used, in whch case my basic flow will be -

    • If the shortcut is run,  current user injected in as UDDIR=%currentuser% etc then it is a completely automated USMT TS.
    • If it is run from litetouch.vbs, %currentuser% doesn't exist proceed to normal wizard etc.  

    I'm pretty positive I could do it with a script later on in the TS but this seems like the simplest way to do it.

    I basically want to name the scanstate location as the current user (instead of the computer as it currently is).

    Thanks!

    Tuesday, March 13, 2012 6:42 AM

Answers

  • For in-place deployment, create a shortcut like this:

    \\<server>\Deployment$\scripts\LiteTouch.vbs /UDDIR:%USERNAME%

    • Edited by JoeZeppy Tuesday, March 13, 2012 2:05 PM
    • Proposed as answer by JoeZeppy Tuesday, March 13, 2012 2:06 PM
    • Marked as answer by mhouston100 Tuesday, March 13, 2012 9:11 PM
    Tuesday, March 13, 2012 1:42 PM

All replies

  • You cannot use %currentuser% or %username% in Cs.ini

    Have a look at this thread and reply from Michael which would be an easy way.

    http://social.technet.microsoft.com/Forums/en-US/mdt/thread/dada30ad-fb28-4f66-a6bc-b2cc200eaf9b/


    Regards, Vik Singh

    Tuesday, March 13, 2012 8:42 AM
  • For in-place deployment, create a shortcut like this:

    \\<server>\Deployment$\scripts\LiteTouch.vbs /UDDIR:%USERNAME%

    • Edited by JoeZeppy Tuesday, March 13, 2012 2:05 PM
    • Proposed as answer by JoeZeppy Tuesday, March 13, 2012 2:06 PM
    • Marked as answer by mhouston100 Tuesday, March 13, 2012 9:11 PM
    Tuesday, March 13, 2012 1:42 PM
  • Thanks for that Joe,  exactly what I was after!

    I'll be testing that out today but you might be able to save me some time,  I'm guessing that parameters passed via command line take precedence over anything in the CS.ini as it is defined before then?

    Tuesday, March 13, 2012 8:56 PM
  • Actually just testing now and it seems that any parameters I'm passing through the command line are getting picked up, but getting overwritten by the CS.INI.

    For example my command is :

    \\server\Deployment$\scripts\LiteTouch.vbs /UDDIR:%USERNAME% /SkipTaskSequence=YES /TASKSEQUENCEID=BACKUSER /SKIPWEDDERBURN:YES

    And BDD.log is reporting correctly, however as part of the USMT TS all of the settings are being overwritten.  Do I have to add something to the PRIORITY in the CS.INI?

    EDIT : As a workaround I could use a custom CS.INI file which does not include these settings I suppose?
    • Edited by mhouston100 Tuesday, March 13, 2012 9:33 PM
    Tuesday, March 13, 2012 9:29 PM
  • Arguments need to be a colon, not an equals on the command line. Priority should go command line, database, ini files, defaults.
    • Proposed as answer by JoeZeppy Tuesday, March 13, 2012 9:37 PM
    Tuesday, March 13, 2012 9:36 PM
  • ha ha too early in the morning, can't believe I missed that ha ha

    Thanks for your help Zoe, your a champion!

    Tuesday, March 13, 2012 9:51 PM