Script Resource map drive

Welcome Forums DSC (Desired State Configuration) Script Resource map drive

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
3 months, 2 weeks ago.

  • Author
    Posts
  • #110465

    Participant
    Points: 5
    Rank: Member

    Hi,

    I'm trying to execute a DSC configuration which contains a script resource to map a network drive – this drive is a storage account in Azure.  If i execute the script block outside of DSC it maps the drive as expected,  but with the DSC execution the drive doesn't get mapped. It executes the script block, but i assume because DSC executes under a system account the drive isn;t visible.

    Is there anyway i can execute the script block within DSC under the context of a local user account, or any other way i can get this drive to be persistent across accounts?

    The reason i need this drive mapped, is because once the drive is mapped the dsc script then pulls a load of file/folders from this location, so maybe there is a better way to do this?

    Any help would be really appreciated

    Cheers

    Tommy

     

  • #110506

    Participant
    Points: 894
    Helping Hand
    Rank: Major Contributor

    Yes you can run DSC configuration with different user context. Please go through below documentation.

    https://docs.microsoft.com/en-us/powershell/dsc/runasuser

The topic ‘Script Resource map drive’ is closed to new replies.