Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Ilike to use a pattern for some credentials.
The pattern would be:
??-testsrv?
But once I fetch them from within a command:
$mysrv = "as-testsrv2"
$mycreds = Get-WfaCredentials -Host $mysrv -ErrorAction stop
Invoke-NaSsh -Name $mysrv -Command $(ls -la) -Credential $mycreds
--> I get a permission denied.
--> If I put
as-testsrv2
directly into the credentials list it works fine.
Can anybody help here?
Thanks!
Solved! See The Solution
1 ACCEPTED SOLUTION
THORSTEN_KRAUSE has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey,
my version is 3.0
found the problem, there was another pattern which was conflicting with that pattern.
For me that solves the problem,
but I think a better error message would be feasible
or a check for potential conflicts when a credential entry is added.
Greets Thorsten
7 REPLIES 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have a credential not Exact but Pattern like *testsrv* ?
---------------------------------------------------------------------------------
@THORSTEN_KRAUSE wrote:Hello,
Ilike to use a pattern for some credentials.
The pattern would be:
??-testsrv?
But once I fetch them from within a command:
$mysrv = "as-testsrv2"
$mycreds = Get-WfaCredentials -Host $mysrv -ErrorAction stop
Invoke-NaSsh -Name $mysrv -Command $(ls -la) -Credential $mycreds
--> I get a permission denied.
--> If I put
as-testsrv2
directly into the credentials list it works fine.
Can anybody help here?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using * will work here but star will match other patters as well which you may not want.
Save the pattern as : [a-z]{2}-testsrv[0-9]{1}
You can have a Test Command to check if your Credentials are actually working or not. Below WFA PoSH code can be of great help to see if your pattern can actually get you the desired credemtials.
### Begin ###
param
(
[parameter(Mandatory=$true, HelpMessage="Host Name")]
[string]$Host
)
$cd=Get-WfaCredentials $Host
if(!$cd)
{
get-WfaLogger -info -Message "Not found"
}
else
{
$pass=ConvertFromSecureToPlain -SecurePassword $cd.Password
Get-WfaLogger -info -Message $cd.UserName
Get-WfaLogger -info -Message $pass
}
##End ##
sinhaa
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
thanks for your help.
Seems the pattern function doesn't work at all.
I just tried it:
have a server called "test" --> using "Exact" --> fetching with your script works
changing just from "Exact" to "Pattern" --> error 500
also trying "Pattern" with tes* doesn't work.
Does that work for you?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
They all work well Thorsten., can you try again in a freshly opened browser.
Select: Type: Other
Match: pattern
Server: tes*
Give username and Password
Now in the command testing code try get credentials for "test". Does it not work?
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
unfortunately still not working for me, completely closed all instances of Firefox 34.0 and started new one:
12:40:11.707 INFO [test credential fetching] ### Command 'test credential fetching' ###
12:40:54.312 ERROR [test credential fetching] Could not get credentials for test. Cause: The remote server returned an error: (500) Internal Server Error.. The remote server returned an error: (500) Internal Server Error.
12:40:56.091 ERROR [test credential fetching] Command failed for Workflow 'test_ cred fetch' with error : Could not get credentials for test. Cause: The remote server returned an error: (500) Internal Server Error.. The remote server returned an error: (500) Internal Server Error.
12:40:56.138 INFO [test credential fetching] ***** Workflow Execution Failed *****
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
woaah!!.. Thats very strange. Can you provide the following details?
- What is your WFA version, ports its running on?
- Can you try to get the Credentials using REST api ApiExecution Resource?
- Can you try to restart your WFA server service.
sinhaa
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
THORSTEN_KRAUSE has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey,
my version is 3.0
found the problem, there was another pattern which was conflicting with that pattern.
For me that solves the problem,
but I think a better error message would be feasible
or a check for potential conflicts when a credential entry is added.
Greets Thorsten
