none
powershell worflow error -A positional paramaeter cannot be found that accepts argument 'onlyBaseResources'. RRS feed

  • Question

  • I am getting an error when the below code is executed in the powershell. The powershell is called by a workflow. When I run the powershell passing the values directly in the powershell, it works fine.

    $exportObject = export-fimconfig -uri $Uri `
                                      –onlyBaseResources `
                                      -customconfig "/Sponsorship[(ObjectID='$oid')]"

    Error: A positional paramaeter cannot be found that accepts argument 'onlyBaseResources'.

    Can someone help me please?

    Monday, October 7, 2013 8:10 PM

Answers

All replies

  • Shot in the dark, but have you tried making it a "one-liner" instead of 3 lines of code?
    Monday, October 7, 2013 8:48 PM
  • it seem to me the "-" on onlybaseresource is different in the code above then that from -uri and -custom, right ?

    Peter Stapf - Doeres AG - My blog: JustIDM.wordpress.com

    Monday, October 7, 2013 9:21 PM
  • I tried both. I got the same error. I ended up writing an update resource activity instead of powershell.

    Thank you both for your help!

    Tuesday, October 8, 2013 2:03 PM
  • That's quite a workaround ;-)

    I agree with Peter on this one, looks like an invalid character, possibly from copy/pasting through Word or Outlook (I've done it before).

    FWIW - I use Export-FimConfig and the -OnlyBaseResources parameter in the vast majority of my workflow scripts so can attest that it works.


    CraigMartin – Edgile, Inc. – http://identitytrench.com

    Tuesday, October 8, 2013 4:06 PM
  • Same on my site, a also have currently around 10 script using Export-FIMConfig that what, works perfect.


    Peter Stapf - Doeres AG - My blog: JustIDM.wordpress.com

    Tuesday, October 8, 2013 5:39 PM
  • This is what I see in the event viewer.

    System.Management.Automation.CmdletInvocationException: The type initializer for 'Microsoft.ResourceManagement.WebServices.Client.ResourceManagementClient' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Microsoft.ResourceManagement.WebServices.Client.ResourceManagementClient' threw an exception. ---> System.InvalidOperationException: This operation is not supported for a relative URI.
       at System.Uri.get_Fragment()
       at System.UriBuilder.Init(Uri uri)
       at Microsoft.ResourceManagement.WebServices.Client.ResourceManagementClient..cctor()
       --- End of inner exception stack trace ---
       at Microsoft.ResourceManagement.WebServices.Client.ResourceManagementClient.SetBaseAddress(Uri baseAddress)
       at Microsoft.ResourceManagement.Automation.ExportConfig.BeginProcessing()
       at System.Management.Automation.Cmdlet.DoBeginProcessing()
       at System.Management.Automation.CommandProcessorBase.DoBegin()
       --- End of inner exception stack trace ---
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
       at System.Management.Automation.PipelineNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
       at System.Management.Automation.ParseTreeNode.Execute(Array input, Pipe outputPipe, ExecutionContext context)
       at System.Management.Automation.AssignmentStatementNode.Execute(Array input, Pipe outputPipe, ExecutionContext context)
       at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)

    Tuesday, October 8, 2013 5:41 PM
  • Sounds like a problem with the $uri variable (relative URI ?).

    Dont use this parameter in my environments, because Portal and Service are most times on the same Server so I can omit the -uri parameter.


    Peter Stapf - Doeres AG - My blog: JustIDM.wordpress.com

    • Marked as answer by fim_sc Tuesday, October 8, 2013 7:16 PM
    Tuesday, October 8, 2013 5:48 PM
  • Ah, that is a known issue.

    https://fimpowershellwf.codeplex.com/workitem/972

    The workaround is to update the FIM Service config file (details in the link above).


    CraigMartin – Edgile, Inc. – http://identitytrench.com

    • Marked as answer by fim_sc Tuesday, October 8, 2013 7:16 PM
    Tuesday, October 8, 2013 7:11 PM
  • Thank you. I created an update resource activity but I am sure I need to fix the config file sometime sooner or later. Also, I am looking forward to your presentation next week.

    Tuesday, October 8, 2013 7:16 PM
  • resourceManagementClient resourceManagementServiceBaseAddress is set to fimportal.domainname.local in the config file. Is there any workaround?

    Wednesday, October 9, 2013 1:43 PM
  • Try to make it a proper URI including the port number, so

    http://fimportal.domainname.local:5725


    CraigMartin – Edgile, Inc. – http://identitytrench.com

    Wednesday, October 9, 2013 4:36 PM