Solved

Powershell New-WebServiceProxy Credentials Issue

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

740 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