Deployment Solution

 View Only
  • 1.  DS 6.9 tokens and profiles

    Posted Sep 30, 2012 07:16 PM

    Hi, I have a situation wherein I need to copy the information from a logged in user to and end destination where the destination needs to have a directory which is equal to the logged in user id. At this stage I'm using %USERPROFILE% which provides me with the path to the users profile, e.g. c:\documents and settings\testuser\...

    I need either to find a token which can provide me the current logged in user OR a script to take it out of the %USERPROFILE% result and use it elsewhere. Like such:

    xcopy /e/c/d/h/y "%userprofile%\Desktop\*.*" "\\serverpath\%CURRENTLOGGEDONUSER%\Home\Desktop\"

    Any help would be appreciated!



  • 2.  RE: DS 6.9 tokens and profiles
    Best Answer

    Posted Sep 30, 2012 11:22 PM

    Not to worry, have found the issue. It seems that the %username% token being used in conjuction with the aclient while trying to do a run as logged on user action is not possible. It is however possible when using the Dagent.

     

    Cheers

    J



  • 3.  RE: DS 6.9 tokens and profiles

    Posted Oct 03, 2012 04:03 PM

    Not sure if it helps, but there are several variables which are relevant to the 6.9 console:

    https://www-secure.symantec.com/connect/articles/what-are-system-variable-tokens-used-deployment-solution-and-can-be-inserted-sql-scripts

    You can also pull the values directly from the database.  These can be used in your script to accomplish the same thing.  For example, the value for the logged on user is:

    %#!computer@logged_on_user%

    If you are in a domain, this will unfortunately pull the value as "Domain\Username."  However with a little manipulation, you can change the value into something you can use.  For example, our domain is "CORP."  So to extract "jsmith" from "CORP\jsmith" I would start by setting the value to a new value, "user":

    set user=%#!computer@logged_on_user%
     

    Since "CORP\" is five characters, to remove it, I would simply re-set the value.  In this case, I would tell DOS to start at the sixth character (the first character is character "0") and then go on 10 spaces:

    set user=%user:~5,10%

    (Note: You can go as many as you want/need.  DOS should stop when the string ends)

    From there, you can do any function you would normally do...but use the variable "user" instead of "username."  This is also quite handy when you want to do things like apply a license key--but not have it stored in plain text on your job.
     

    There could be a better way, but using the DS variables--and the database variables--has been a lifesaver for us at times!