If the data folder is shared then you specify it like this:
\\server2\data
In your net use command you will usually have to pick a drive letter that is not in use, as C: is commonly already the system drive.
So something like this may work - if the other switches in the net use command are correct.
net use z: \\server2\data server2password /user:server2domain\server2username /savecred /p:yes
xcopy "C:\Users\output.txt" z:\