3

This seems like a simple problem but I am unable to fix it

Running dfsutil command in shell returns result

C:\Windows\system32>dfsutil link "\server.domain.com\DFSRootname\Sharename"

Link Name="Sharename" State="OK" Timeout="1800" Target="\server1\sharename" State="ONLINE" [Site: site1] Target="\server2\sharename" State="OFFLINE" [Site: site2]

Done processing this command.

Trying to do the same in powershell


PS>
$path = "\\server.domain.com\DFSRootname\Sharename"
$dfsutil = "dfsutil"
$option = "link"

PS C:\Windows\system32> dfsutil link $path

DFS Utility Version 5.2 (built on 5.2.3790.3959)
Copyright (c) Microsoft Corporation.  All rights reserved.

Unrecognized option "ink"

Same with using Invoke-Expression

PS C:\Windows\system32> Invoke-Expression "$dfsutil $option $path"

DFS Utility Version 5.2 (built on 5.2.3790.3959)
Copyright (c) Microsoft Corporation. All rights reserved.

Unrecognized option "ink"


2 Answers 2

3

The following syntax works for me on PS v2/v3. I'm preceding the command with a & the Call Operator:

$path = "\\ad.example.org\root\share"
$dfsutil = "dfsutil"
$option = "link"

& $dfsutil $option $path

Link Name="share" State="OK" Timeout="1800"
Target="\\fs1.example.org\share" State="ONLINE"  [Site: default-site]

Done processing this command.
1
  • Thank you Scott. This is what I expected to happen. Seems like problem only happens on my Windows 7 PS3 install. Command works fine on Windows 2008 R2 host wint PS2 it works fine
    – Sergei
    Jun 13, 2013 at 13:09
0

Seems like installation problem with my Windows 7 PS3 install. Command works fine on Windows 2008 R2 host with PS2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.