Acess denied to tsenv: when running Powershell script as another user RRS feed

  • Question

  • I am trying to run a PowerShell script as another user in a task sequence step. The problem I am having is that when I try to access tsenv: I get access denied:
    PS C:\Users\Administrator> Import-Module ZTIUtility

    Microsoft Deployment Toolkit version: 6.3.8450.1000
    Import Microsoft.BDD.TaskSequenceModule
    PS C:\Users\Administrator> dir tsenv:
    dir : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
    At line:1 char:1
    + dir tsenv:
    + ~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Get-ChildItem], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetChildItemCommand

    I have tried adding the user to administrators. To user had no access to c:\_SMSTaskSequence either. Giving the user permissions to the folder and contents allowed access to the folder but still no TSEnv:.

    Does anyone have any ideas of how to fix this issue?

    Thank you

    Wednesday, June 20, 2018 4:23 PM