1

In our AD infrastructure the SYSVOL is replicated by DFSR. I want to force replication using WMI (ForceReplication method) via WMIC:

wmic /namespace:\\root\microsoftdfs path DfsrConnectionInfo call ForceReplication(15,10,2)

But this fails with:

Executing (DfsrConnectionInfo)->ForceReplication()
ERROR:
Description = Invalid method Parameter(s)

I double checked the argument order/type:

wmic /namespace:\\root\microsoftdfs path DfsrConnectionInfo call ForceReplication /?
Call                    [ In/Out ]Params&type                   Status
====                    =====================                   ======
ForceReplication        [IN ]Bandwidth(uint32)                  Implemented

                        [IN ]DurationInMin(uint32)

                        [IN ]Mode(uint32)

                        [OUT]ReturnValue(uint32)

The same call in Powershell works:

(gwmi -Namespace root\microsoftdfs -Class DfsrConnectionInfo).ForceReplication(2, 10, 15)

Where am I wrong with WMIC and arguments?

0

The first argument. 15 isn't valid. The one that works doesn't surprise me. The reason is that the first parameter is between 1 and 4 (inclusive). This is different from the first wmic code you show:

wmic /namespace:\\root\microsoftdfs path DfsrConnectionInfo call ForceReplication(15,10,2)

The first value in the parentheses 15 isn't a valid value. It must be 1, 2, 3, or 4. For detailed information about this, you can review this Microsoft article.

  • In the output of "ForceReplication /?" you can see that the order of the arguments is not the same as in the article you suggest. Your sample does not for me in Windows Server 2012 R2. The error is "Invalid Method Parameters". Have you tested it? – iPath Jun 8 '15 at 8:46
0

I wonder if this is a bug because it didn't work even when I used named parameter to call the method:

path DfsrConnectionInfo call ForceReplication Bandwidth=10 DurationInMin=20 Mode=2

The above command returns:

Invalid named parameter list.
Hint: ::= | where ::= =
wmic:root\microsoftdfs>path DfsrConnectionInfo call ForceReplication Bandwidth=10 DurationInMin=20 Mode=2
Execute (DfsrConnectionInfo)->ForceReplication() (Y/N)?y
ERROR:
Description = Invalid method Parameter(s)

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.