Q: Using a service account to do automated check-ins for another user (TFS/Powershell) I'm attempting to do something that might be somewhat unusual using TFS version control and I'm not sure how to go about it.  We're working with a third party tool which is only able to be backed up by generating on-demand XML files which hold its configuration.  We'd like to perform a nightly back-up of these XML files per-machine on TFS.  I've created a folder for each machine in TFS where the files will be checked into once they are exported.
We'd like to set a scheduled task that runs a Powershell script which checks out the existing files in the machine's designated folder, exports the current configuration XML to the machine's TFS mapped folder, then checks the folder back in.  Right now, this entire process is functioning if I set up the task to run using my own credentials on my own machine.  However, this needs to run on many computers, each with its own primary user which owns the TFS workspace.  
This could be accomplished with how the script is currently written by creating the Windows scheduled task on each computer and supplying that user's credentials as the context under which the script should be run.  However, this configuration would break the second each user changes their password.  To try to solve this, I've created a service account to run this under, but when I attempt to run it under that new account, TFS is unsure which workspace it should be using and tells me "Unable to determine the workspace. You may be able to correct this by running 'tf workspaces /collection:TeamProjectCollectionUrl'."  When I use this command to specify the workspace, I'm told that the service account does not have permission to use the workspace.
I feel like there must be an easier/better way to solve this problem.  Can anybody provide some guidance on doing automated check-ins via powershell when running under an account context other than the user who owns the private workspace?

A: Your approach sounds like it is correct.  Your script needs to create a workspace using the tf workspace command before file changes can be detected and checked in to the server.
It sounds like you can't do this because you have a permissions issue. Since your service account will be acting in the same manner as a user from your team, your service account should have the same permissions as a user.
Try the following command:
TFSSecurity /imx Identity [/collection:CollectionURL] [/server:ServerURL]

Use this to verify that the service account's TFS identity is a member of the correct group and has the right permissions. 
To create a workspace, your service account would need to be a member of the Project Collection Valid Users group for the Project Collection housing the associated team project.
