none
Permissions to run DNSCMD in scheduled task RRS feed

  • Question

  • Hi,

    I'm trying to backup my DNS zones using a Powershell script similar to 

    "http://c-nergy.be/blog/?p=1837" How to Backup DNS Zones – Improved

    in a scheduled task.

    Basically, it assembles a variable and the invokes it similar to: -

    $cmd = "dnscmd LSAD01 /ZoneExport domain.local backup\domain.local"

    Invoke-Expression $cmd

    Running this manually as a Domain Admin I get: -

    Command failed:  ERROR_ACCESS_DENIED     5    0x5

    But if I 'Run as Administrator' it works OK.

    If I try to run it as a scheduled task it fails with return code 1.

    I would normally run tasks as an ordinary user giving them rights to the relevant files. But this still fails when the job is run as the domain administrator.

    Any advice much appreciated.

    Thanks.

    Wednesday, May 25, 2016 3:21 PM

Answers

  • Hi PopsZ1000A1,

    >>I would normally run tasks as an ordinary user giving them rights to the relevant files. But this still fails when the job is run as the domain administrator.

    Please check the option 'Run with the highest privileges':

    ________________________________________
    Best Regards,
    Cartman
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Thursday, May 26, 2016 5:41 AM

All replies

  • Hi PopsZ1000A1,

    >>I would normally run tasks as an ordinary user giving them rights to the relevant files. But this still fails when the job is run as the domain administrator.

    Please check the option 'Run with the highest privileges':

    ________________________________________
    Best Regards,
    Cartman
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Thursday, May 26, 2016 5:41 AM
  • Hi Cartman,

    That's it. Easily missed.

    Thanks

    Thursday, June 2, 2016 2:05 PM