Start a Conversation

Unsolved

S

1 Message

2026

March 16th, 2022 03:00

Unable to connect to Networker Server using the PowerShell

We are trying to connect to networker server using the PowerShell.

 

curl -X GET -H "Content-Type: application/json" -H "Authorization: Basic administrator:Password**** ,Content-Type: application/json" https://10.12.13.5:9090/nwui -k

in above command encoded the username and Password to Bas 64 

 

curl -X GET -H "Content-Type: application/json" -H "Authorization: Basic YWRtaW5pc3RyYXRvcjpQYXNzd29yZDEyMyE ,Content-Type: application/json" https://10.12.13.5:9090/nwui -k

getting the error as below in the powerShell window

voke-WebRequest : Cannot bind parameter 'Headers'. Cannot convert the "Content-Type: application/json" value of type "System.String" to type "System.Collections.IDictionary"
line:1 char:16
curl -X GET -H "Content-Type: application/json" -H "Authorization: Ba ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

 

 

 

 

 

2.4K Posts

March 16th, 2022 06:00

You better tell us what you want to do/achieve to be able to follow your idea.

If you just want to run a standard NW command from PowerShell, just assign it to a string variable. Then execute it by running "invoke-expression" like

$command = "mminfo -s nw_server -avot > file"

invoke-expression $command

 

4 Operator

 • 

1.3K Posts

March 17th, 2022 07:00

@somwali, This is not a NetWorker issue and more of a powershell issue. I am assuming you are testing the NetWorker REST API. There are a lot fixes recommended on stackoverflow, I would you try there.
If you just trying to get some backup information then you can simple use the NetWorker commands to get the relevant information assuming NetWorker is installed on the system where you are running the commands.

No Events found!

Top