Link to home
Start Free TrialLog in
Avatar of Mauro Cazabonnet
Mauro CazabonnetFlag for United States of America

asked on

Powershell New-WebServiceProxy Credentials Issue

Hello,
I'm trying to connect to a web service with alternate credentials, but it just won't work
What am I doing wrong?

$username = "Domain\Test"
$password = "Test1234
 
$secpassword = ConvertTo-SecureString -String $Password -AsPlainText -Force
 
$creds = New-Object System.Management.Automation.PSCredential $username,$secpassword

$webservice = New-WebServiceProxy -Uri "http://cimsws.nam.nsroot.net/cmGroup/group.asmx" -Credential $creds

Getting unauthorized 401 status
If I manually enter the credentials it works or if I use -DefaultCredentials
ASKER CERTIFIED SOLUTION
Avatar of Mauro Cazabonnet
Mauro Cazabonnet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial