Page 2 of 2

Re: Write files to folder with different user rights

Posted: Wed Jul 13, 2022 11:33 am
by sarnusch
I will now solve the problem by running a copy process with the appropriate permissions using a power shell script and the action 'PowerShell Script'.
That works fine after a few tests.

Code: Select all

$Source = "PATHA"
$Dest   = "PATHB"
$Username = "{USR}"
$Password = ConvertTo-SecureString "{PWD}" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential($Username, $Password)
New-PSDrive -Name K -PSProvider FileSystem -Root $Dest -Credential $mycreds -Persist
Copy-Item -Path $Source -Destination $Dest
Remove-PSDrive -Name K