Is there a way of using Powershell to get smartcard credentials?
Use Case.
I need to remote to a bunch of servers and disable specific task. The servers need my smartcard credentials.
thanks
Is there a way of using Powershell to get smartcard credentials?
Use Case.
I need to remote to a bunch of servers and disable specific task. The servers need my smartcard credentials.
thanks
Creds are creds, there’s no difference except when the UAC prompts you type a pin instead of user/pw. By default, any command you run inside a PoSH will use the credentials you used to launch the shell. Some cmdlets like “Invoke-Command” have a -Credential parameter that allow you to provide different credentials.
So now I say DOH!! Thanks for the quick response… Don’t know why I did not just do it!
How i can pass smart-card credential to invoke-command ?
what he said.
Invoke-Command -ComputerName servername.fqdn -ScriptBlock{get-process} -Credential domain\username
in this if i pass my credential password it works if i pass smart card pin its not working.
works for me.
$cred = get-credential #select smartcard enter pin
Invoke-Command -ScriptBlock{get-process} -ComputerName myserver -Credential $cred