I've worked out a solution. Use 'net use' with xp_cmdshell.
DECLARE @CmdString1 VARCHAR(2000)
DECLARE @CmdString2 VARCHAR(2000)
SET @CmdString1 = 'net use Z: \\10.10.10.5\f$ /persistent:yes /user:domain\userid password'
SET @CmdString2 = 'copy \\10.10.10.5\f$\test.nightly H:\MSSQL\Backup\test.nightly'
EXEC master.dbo.xp_cmdshell @CmdString1
EXEC master.dbo.xp_cmdshell @CmdString2