RunAsCurrentUser copy file issue

(imported topic written by JamesN91)

if {exists current user}

waithidden C:\Program Files\BigFix Enterprise\BES Client\RunAsCurrentUser-2.0.exe --w cmd.exe /C Copy “{pathname of file “test3.txt” of parent folder of regapp “besclient.exe”}” “\XXXXXXXXXX”

Debugger says the Eval completed successfully. If I remvoed the RunAsCurrentUser section and run then the file copies successfully.

What am I doing wrong with my syntax for RunAsCurrentUser?

(imported comment written by BenKus)

I think the syntax is OK as far as I can see… Can you verify that your user has read permission on the BigFix folder?

Ben

(imported comment written by JamesN91)

I have verified I have list and write permissions with my account to share \XXXXXXXX. I assume RunAsCurrentUser will be using my account since I am the one logged in?

I can manually copy to the share without issues.

I can copy to the share with debugger using this relevance… (no RunAsCurrentUser)

waithidden cmd.exe /C Copy “{pathname of file “test3.txt” of parent folder of regapp “besclient.exe”}” “\XXXXXXXXXX”

(imported comment written by JamesN91)

I did a pcap of my workstation running the action debugger with and without RunAsCurrentUser.

Without RACU I see the SMB and the transfer of the test.txt.

With RACU I see no network traffic.

Does RACU require a system account to initiate? Does it not work when ran as a domain user through the action debugger?

(imported comment written by SystemAdmin)

In situations like that, I’ve had better luck building a batch script that maps the UNC path as a drive, then doing the copy to the mapped drive.

This is a sanitized example of a script we use:

delete __appendfile

appendfile @echo off

appendfile NET USE F: /DELETE

appendfile NET USE F: \server\share

appendfile xcopy /C /Q /Y “f:\install\ABC.exe” “c:\temp”

copy __appendfile __download\map.bat

wait c:\temp\RunAsCurrentUser.exe --w cmd /C __download\map.bat

Also, do you want add “/y” after copy to suppress any prompting?

(imported comment written by jessewk)

James,

You action looks pretty good to me. I think it is probably a problem with the Fixlet Debugger. Can you try running your action through the console?

Jesse

(imported comment written by JamesN91)

jessewk

James,

You action looks pretty good to me. I think it is probably a problem with the Fixlet Debugger. Can you try running your action through the console?

Jesse

I’ve attempted to run from Console.

The Action runs is scoped to only 1 workstation. From console view I see it runs successfully, however, the file did not copy to the share. I am using the same relevance from above that uses RACU.

Is there a debugger or log I can look at for this action? There was nothing in my Event Viewer showing failure.

(imported comment written by jessewk)

You can look at the client log and it might tell you an exit code, but I’m not sure. You can also try to see if cmd.exe gets launched under the right user context by watching it in task manager when the task runs. I’m pretty sure the problem is the user not having permission to connect and write to that share.

I don’t know what you’re actually trying to do, but have you considered other options like uploading the files to the BigFix server? Also, I’d give JonL’s idea to map a drive a try.

(imported comment written by JamesN91)

I ran RACU from the console focused on my test group and attached a mesage to display while running the Action. while RACU Action attempted to run, I had a PCAP and Process monitor running.

I never saw RunAsCurrentUser on process manager or attempt to make a smb connection. When run RACU.exe -? from the command line I get a popup for usage and I see the program in the Process Manager.

Further simplifed testing…

I ran this

waithidden C:\Program Files\BigFix Enterprise\BES Client\RunAsCurrentUser-2.0.exe --w cmd.exe /C ping 127.0.0.1 > c:\temp\ping.txt

I get my message popup stating it runs. No process for RACU and no ping.txt file created.

(imported comment written by BenKus)

Is this the exact command you used? IF so, try again with quotes around the path:

waithidden “C:\Program Files\BigFix Enterprise\BES Client\RunAsCurrentUser-2.0.exe” --w cmd.exe /C ping 127.0.0.1 > c:\temp\ping.txt

Ben