powershell error in dfs commandlets while taking ps-session

Welcome Forums General PowerShell Q&A powershell error in dfs commandlets while taking ps-session

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

3 years, 1 month ago.

  • Author
  • #41163

    Topics: 1
    Replies: 1
    Points: 0
    Rank: Member

    New-DfsnFolder : Access to a CIM resource was not available to the client.AtD:\scripts\IAM\sharefoldermanagement\AddingShareToDFS\AddingShareToDFS.ps1:8char:5+ $a=New-DfsnFolder -Path $path -TargetPath $share -EnableTargetFailback $true+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : PermissionDenied: (MSFT_DfsNamespaceFolder:Root\Microsoft\...NamespaceFolder) [New-DfsnFolder], CimException+ FullyQualifiedErrorId : MI RESULT 2,New-DfsnFolder

    I am getting the above error when trying to execute dfsn commandlets in a ps-session of a 2012R2 server.Module dfsn and fsrm roles are enabled.When I am directly executing the script in 2012 without any session.It is working well and fine.

    Remote execution policy and trusted host is enabled.

    Running as administrator.It is same user given to mange the DFS in GUI.

    Any help appreciated.

    Thanks in advance

  • #41280

    Topics: 13
    Replies: 4872
    Points: 1,842
    Helping HandTeam Member
    Rank: Community Hero

    It's probably having to connect to a network resource to do what you're trying, which means you're running into the double-hop authentication problem. Hop one is your PSSession, hop two is from there to the DFS service, and that second hop doesn't have a credential associated. Discussed in "Secrets of PowerShell Remoting," on our eBooks page. If the command you're running supports a -Credential parameter, providing that should solve it.

  • #41344

    Topics: 1
    Replies: 1
    Points: 0
    Rank: Member

    Thanks Don,

    The dfsn command doesn't have a -credential parameter,however it supports -cimsession parameter in which i tried of giving the credentials.

    Then also I am getting the same error.Whenever I am trying to execute the commands remotly I am getting this error.Executing it directly ,it gives the output.

    In both the cases I am executing it as domain admin.

The topic ‘powershell error in dfs commandlets while taking ps-session’ is closed to new replies.