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

Hello,

 

I wanted to create a file copy program to a server \\server\share\loggedonusername

I can use these variables in a cmd script, but not in the file copy step.

Is this possible, or is it possible to create a PDQ deploy Variable for this?

 

Thanks

0

Comments

8 comments
Date Votes
  • 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
  • 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
  • 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
  • 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
  • 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
  • Correct, but it stays the same error ;-) --> Directory not found.

    0
  • 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
  • Thanks,

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

     

    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post