Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4596078
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:03:51+00:00 2026-05-21T23:03:51+00:00

Is anyone successfully using MsDeploy for deploying windows services with a preSync runCommand? I’ve

  • 0

Is anyone successfully using MsDeploy for deploying windows services with a preSync runCommand? I’ve got it working using an Administrator account, but can’t for the life of me get it working on a standard user account. Unfortunately I can’t use integrated authentication (we’re deploying to an external box), and the thought of our Administrator password sitting in plaintext in logs on our build server doesn’t exactly make me feel too comfortable. For that matter, neither does any user credentials – but I can’t see a way around that.

The command I’m using is this:

"tools/deploy/msdeploy.exe" -verb:sync 
-preSync:runCommand="tools\Deploy\PreSyncCommand.cmd",waitInterval=30000 
-source:dirPath="C:\BuiltSourcePath" 
-dest:computerName=https://server:8172/msdeploy.axd?site=dummysitename,userName=service-deploy,password=service-deploy-pass,authType=basic,dirPath="C:\DeployPath\"
-allowUntrusted

with rules set up in IIS for the dummy site to allow the authentication for the service-deploy windows account, with contentPath and runCommand permissions (for the moment set to C:\ as it’s not entirely clear whether this needs to be set to the temporary path that MsDeploy streams to, or the deployment path?). The service-deploy account also has full control of the target directory. I get the following back:

Performing '-preSync'...
Info: Using ID '7a7d34a1-b5d8-49f1-960a-31c9cf825868' for connections to the remote server.
Info: Using ID '4d0b910c-aca4-4640-84bd-3597d22d99d1' for connections to the remote server.
Info: Updating runCommand (C:\TeamCity\buildAgent\work\aec989676b349656\tools\De
ploy\PreSyncCommand.cmd).
Warning: Access is denied.
Warning: The process 'C:\Windows\system32\cmd.exe' (command line '/c "C:\Windows
\ServiceProfiles\LocalService\AppData\Local\Temp\giz2t0kb.0ay.cmd"') exited with
 code '0x1'.

This happens even if the contents of PreSyncCommand.cmd is blank. The same command runs fine if I pass in Administrator credentials. I’ve tried using ProcessMonitor to check if anything’s being denied access but can’t see any – so I’m guessing it’s still a MsDeploy authentication rule. There’s nothing in WmSvc.log (debugging is enabled), nor in the event log.

Any ideas? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T23:03:51+00:00Added an answer on May 21, 2026 at 11:03 pm

    Since you’re using Web Deploy via WmSvc, you need to setup appropriate delegation rules on the destination server:

    Within IIS Manager, open the “Management Service Delegation” feature. Add a new rule which at least specifies the runCommand provider. In the Run As section, choose Specific User and provide credentials for a local administrator account on that machine. This is the identity under which your runCommand scripts will be executed. Finally, the user which you’re specifying for the destination dirPath provider needs to be added to the delegation rule.

    That allows you to invoke a deployment using a non-privileged account, and yet have it executed on the target machine under administrative credentials.

    More information on IIS feature delegation: http://learn.iis.net/page.aspx/516/configure-the-web-deployment-handler/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I could use net use command at windows successfully using both Administrator and other
Has anyone got a RESTful WCF service (in .NET4) successfully using JSON.NET to do
Is anyone successfully using Expression Blend Preview for .NET 4 with the RC of
Has anyone using .net actually worked out how to successfully sign a signature to
Has anyone successfully connected to their MS Access db using Jasper Reports iReport? I
Is anyone successfully using OpenJPA with Glassfish? I'm trying to use OpenJPA 2.1 with
Using rails 3.1 and less-rails (>= 2.1.1): Is anyone out there successfully using @import
Has anyone successfully tried using Microphone.getEnhancedMicrophone() method in Adobe Flash CS5? I tried all
Has anyone successfully set up a standalone environment for using ruby 1.9.2, selenium-client, and
Has anyone successfully implemented the Google Identity Toolkit , an implementation of an Account

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.