Can you use %username% variable and others in pdq deploy

Comments

8 comments

  • Pushpak Patil

    Yes, you can use %userprofile% variable for current logged on user.

    Source: https://technet.microsoft.com/en-us/library/cc749104(v=ws.10).aspx

    0
    Comment actions Permalink
  • Pepijn Deneut

    Yes, but when I try to use this in a File Copy Step, I get a warning that the folder can't be found.

    In the CMD it works fine.

    0
    Comment actions Permalink
  • SelfMan

    This kind of task can be used ONLY while a user is logging in (or is already logged in). The %USERPROFILE% variable is set dynamically PER USER. What that means is, that if you do a deployment as domain\joe, the pdqdeployservice runs under this user name and the %userprofile% variable is set to Joes profile - i.e. C:\Users\joe

    0
    Comment actions Permalink
  • Pepijn Deneut

    I know, and that's how we want it to act. But when I use the file copy step with the variable, it gives an error.

    when I use a parameter in a cmd, it works

    0
    Comment actions Permalink
  • SelfMan

    In your screenshot you selected the copy operation of a file, but you did not specify the file name. I think you should pecify it as a folder.

    0
    Comment actions Permalink
  • Pepijn Deneut

    Correct, but it stays the same error ;-) --> Directory not found.

    0
    Comment actions Permalink
  • Brigg Angus

    Hi Pepijn,

    I know this comes late, but if weren't able to resolve this, one thing you might want to try is to run the deployment as local logged on user. Please see the attached screenshot for an example.

    This means that if domain\joe is logged in to the machine, %username% would then resolve to joe and your command is more likely to succeed.

    1
    Comment actions Permalink
  • Pepijn Deneut

    Thanks,

    I was indeed able to do this via logged on user.

     

    0
    Comment actions Permalink

Please sign in to leave a comment.