Solved

Powershell New-WebServiceProxy Credentials Issue

Posted on 2013-06-17
1
2,019 Views
Last Modified: 2013-06-17
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
0
Comment
Question by:Mauro Cazabonnet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
Mauro Cazabonnet earned 0 total points
ID: 39254482
The password contained special characters, solution was to place the password in single quotes
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question