MDT 2012 currently logged on user variable
-
13 มีนาคม 2555 6:42
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!
ตอบทั้งหมด
-
13 มีนาคม 2555 8:42
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
-
13 มีนาคม 2555 13:42
For in-place deployment, create a shortcut like this:
\\<server>\Deployment$\scripts\LiteTouch.vbs /UDDIR:%USERNAME%
- แก้ไขโดย JoeZeppy 13 มีนาคม 2555 14:05
- เสนอเป็นคำตอบโดย JoeZeppy 13 มีนาคม 2555 14:06
- ทำเครื่องหมายเป็นคำตอบโดย mhouston100 13 มีนาคม 2555 21:11
-
13 มีนาคม 2555 20:56
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?
-
13 มีนาคม 2555 21:29
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?- แก้ไขโดย mhouston100 13 มีนาคม 2555 21:33
-
13 มีนาคม 2555 21:36
Arguments need to be a colon, not an equals on the command line. Priority should go command line, database, ini files, defaults.- เสนอเป็นคำตอบโดย JoeZeppy 13 มีนาคม 2555 21:37
-
13 มีนาคม 2555 21:51
ha ha too early in the morning, can't believe I missed that ha ha
Thanks for your help Zoe, your a champion!