Solved

Powershell New-WebServiceProxy Credentials Issue

Posted on 2013-06-17
1
1,812 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
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Microsoft Windows Server Update Service (WSUS) is free for everyone, but it lacks of some desirable features like send an e-mail to the administrator with the status of all computers on the WSUS server. This article is based on my PowerShell script …
How to sign a powershell script so you can prevent tampering, and only allow users to run authorised Powershell scripts
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

810 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