mmm, do you mean for instance

net use \\server\IPC$ /user:domain\$ITStaffName $ITPassword

would I do that in the function just before the GetObject part?