MoveFiles
Moves files between directories on SMB share.
Task version: 2.7.0
Required Frends version: 5.7+
Required .NET version: 8.0
Compatible Agents: Crossplatform
Task Parameters
SourcePath : String
Source path relative to the share where files will be moved from.
Can be a directory path or a specific file path.
Default: -
Example: documents/reports
TargetPath : String
Target path relative to the share where files will be moved to.
Must be a directory path.
Default: -
Example: backup/reports
Server : String
SMB server address or hostname.
Default: -
Example: 127.0.0.1
Share : String
SMB share name to connect to.
Default: -
Example: testshare
Username : String
Username for SMB authentication.
This needs to be of format domain\username
Default: -
Example: WORKGROUP\Administrator
🗝Password : String
Password for the SMB credentials.
Default: -
Example: Password123
OperatingSystem : Os
Defines the operating system of the SMB server.
Options used to determine correct path separator to use.
Possible values:
Windows: Defines the operating system of the SMB server.
Options used to determine correct path separator to use.
Linux: Defines the operating system of the SMB server.
Options used to determine correct path separator to use.
Default: Linux
Example: Linux
AuthenticationMode : AuthenticationMode
Authentication mechanism to use when connecting to the SMB server.
Kerberos and KerberosTicketCache require network access to a KDC and a registered
SPN (cifs/servername) for the target server in Active Directory.
Possible values:
Ntlm: NTLM authentication protocol.Kerberos: Kerberos authentication protocol using username and password.
Requires network access to a KDC and a registered SPN (cifs/servername)
for the target server in Active Directory.
KerberosTicketCache: Kerberos authentication protocol using a pre-existing ticket cache (ccache) file.
Requires a valid TGT in the ccache file created externally e.g. via kinit.
Default: Ntlm
Example: Ntlm
KerberosServerName : String
Hostname used to build the Kerberos SPN (cifs/hostname) when AuthenticationMode is Kerberos.
Falls back to Server when not set. Only needed when the address used for the TCP
connection differs from the server's registered Kerberos identity - e.g.
where you connect via a mapped IP/port but the AD-registered name is something else.
Default: -
Example: DC1.test.local
KdcAddress : String
Optional explicit KDC address (host or host:port) for Kerberos authentication.
Use when DNS SRV discovery is unavailable.
If empty, KDC will be discovered via DNS SRV records for the realm.
Default: -
Example: kdc.company.com:88
KerberosCacheFile : String
Path to a Kerberos ticket cache (ccache) file to use for authentication when
AuthenticationMode is KerberosTicketCache. The file must already contain a valid
ticket-granting ticket (e.g. created via kinit).
Default: -
Example: /tmp/krb5cc_testuser
CreateTargetDirectories : Boolean
If true, creates the target directory and any necessary parent directories if they don't exist.
Default: True
Example: true
IfTargetFileExists : FileExistsAction
Specifies the action to take when a file with the same name already exists in the target location.
Possible values:
Throw: Throw an exception if the target file already exists.Overwrite: Overwrite the existing target file with the source file.Rename: Rename the source file to a unique name if the target file exists (e.g., file_1.txt, file_2.txt).
Default: Throw
Example: Throw
PreserveDirectoryStructure : Boolean
If true, recreates the source directory structure in the target location.
If false, all files are moved directly to the target directory without preserving subdirectories.
Default: True
Example: true
Recursive : Boolean
Search for files recursively in subdirectories. Default is true.
Default: True
Example: true
PatternMatchingMode : PatternMatchingMode
Define how pattern matching will work.
Possible values:
Wildcards: Wildcards * and ? are supported.Regex: Standard .NET regular expressions are supported.
Default: Regex
Example: Regex
Pattern : String
Define how pattern matching will work.
Default: -
Example: Regex
ContinueOnFailure : Boolean
When enabled, the task continues moving remaining files even if individual file operations fail.
Successfully moved files are returned in Files with Success = true. Failed files
are reported in Error.FileFailures with the reason for each failure.
Even if some files fail, the task will not throw regardless of the ThrowErrorOnFailure setting.
Default: False
Example: false
ThrowErrorOnFailure : Boolean
Whether to throw an error on failure.
Default: True
Example: true
ErrorMessageOnFailure : String
Overrides the error message on failure.
Default: -
Example: Custom error message
Task Result
Success : Boolean
Indicates if the task completed successfully.
Example: true
Files : List<FileItem>
List of files that were successfully moved, including their source and target paths.
Example: [{SourcePath: "documents\report.txt", TargetPath: "archive\report.txt"}]
Error : Error
Error that occurred during task execution.
Example: object { string Message, Exception AdditionalInfo }
Error.Message : String
Summary of the error.
Example: Unable to move files.
Error.AdditionalInfo : Exception
Additional information about the error.
Example: object { Exception AdditionalInfo }
Error.FileFailures : List<FileFailure>
Per-file failure details, populated when ContinueOnFailure is enabled. Each entry contains the source path of the file that failed and the reason.
Example: [ { "SourcePath": "source/file.txt", "TargetPath": "target/file.txt", "Reason": "File 'target/file.txt' already exists. No files moved.", "AdditionalInfo": { ... } } ]
Task Changelog
Changelog for Task Frends.Smb.MoveFiles.
[2.7.0] - 2026-10-26
Fixed
Kerberos ticket cache authentication no longer requires Username input; realm is read automatically from the ccache file.
Use the configured SeparatorCharacter when resolving SMB paths.
[2.6.0] - 2026-09-30
Fixed
Corrected task copyright metadata.
[2.5.0] - 2026-09-25
Added
Added new
KerberosTicketCacheauthentication mode supporting Kerberos authentication using a pre-existing ticket cache (ccache) file.
Fixed
Kerberos authentication now correctly truncates the session key to 16 bytes as required by the SMB specification.
[2.4.0] - 2026-07-27
Added
Added Kerberos authentication support for SMB connections
New
Connection.AuthenticationModeproperty withNtlm(default) andKerberosoptionsNew
Connection.KerberosServerNameproperty for specifying the Kerberos SPN hostname when it differs from the TCP connection addressNew
Connection.KdcAddressproperty for explicit KDC address when DNS SRV discovery is unavailableKerberosNetAuthenticationClientinternally handles TGT acquisition, service ticket retrieval, and GSS-API token generation using the Kerberos.NET library
[2.3.0] - 2026-07-20
Fixed
Optimized SMB file handling: fixed lingering locks and adjusted access permissions to prevent sharing violations.
[2.2.0] - 2026-05-20
Added
Added ContinueOnFailure as a new option � allows the operation to proceed when individual file copies fail, collecting errors in a failures list instead of throwing immediately
[2.1.0] - 2026-04-23
Fixed
Input parameters treated as normal string instead of PathString type.
[2.0.0] - 2026-04-08
Added
New connection parameters that defined what servers Operating System.
[Breaking Change] Introduce PathString type that will represent paths with OS specific separators.
[1.0.0] - 2025-11-12
Added
Initial implementation
Last updated
Was this helpful?

