1

We've run into a little problem with some of our team builds, where a project can have its own active directory. When we deploy a projekt from a team build, we run into user permission problems, since authorization is relative to the AD - e.g. the user group 'Everyone' on a folder, is relative to the AD. I've tried to add the build user directly to the projects AD, but I get an error specifying that no logon server is available. Just added a local user to the server doesn't work either.

I cannot create a trust between the custom AD's and the produktion AD. I've noted the powershell to accomplish this, but am hoping for a more elegant way. I've tried using Michael Roufa's wrapper for Community Tasks, but I cannot make it work, for some reason.

So... my question is whether it is possible to impersonate a user in msbuild in an elegant way, when invoking other tasks?

Software: TFS2010, MSBuild 4.0, Various tasks lib + custom, Windows 2008 R2 servers

jaspernygaard
  • 3,098
  • 5
  • 35
  • 52
  • Does [`runas`](http://technet.microsoft.com/en-us/library/cc771525(WS.10).aspx) work for you? – KMoraz Mar 27 '12 at 12:37
  • It might have worked in a exec target, however the 'runas' can only prompt for a password. So unfortunately it will not work. – jaspernygaard Mar 27 '12 at 14:49
  • How about writing your own [`MSBuild Task`](http://msdn.microsoft.com/en-us/library/t9883dzc.aspx) and execute your actions using [`Process`](http://stackoverflow.com/a/4106668/147211) with admin rights? – KMoraz Mar 27 '12 at 15:12

0 Answers0