Here's what I'm trying to do and not sure if it's possible.
Disable a smartcard reader.
Launch IE.
When IE process complete re-enable smartcard reader.
Issue:
It requires admin credentials from smartcard to disable/enable device.
IE cannot run under admin credentials so running .ps1 as admin will not work.
Here's what I currently have:
Credentials and IE are commented out for testing.
When testing if .ps1 ran as admin to works.
When trying to run as non-admin prompting for credentials it does not.
I would appreciate any assistance.
Micah
Disable a smartcard reader.
Launch IE.
When IE process complete re-enable smartcard reader.
Issue:
It requires admin credentials from smartcard to disable/enable device.
IE cannot run under admin credentials so running .ps1 as admin will not work.
Here's what I currently have:
Credentials and IE are commented out for testing.
When testing if .ps1 ran as admin to works.
When trying to run as non-admin prompting for credentials it does not.
Code:
##get admin credentials from smartcard
#$creds = Get-Credential
##Broadcom smartcard reader
##capture smartcard reader using hardware ID
$d = Get-PnpDevice | where {$_.HardwareID -like "USB\VID_0A5C&PID_5832&REV_0101&MI_01"}
##disable smartcard reader using admin credentials and suppress confirm prompt
$d | Disable-PnpDevice -Confirm:$false #$creds
##starts IE and holds script until process is completed
#start-process -filepath "C:\Program Files\Internet Explorer\iexplore.exe" -NoNewWindow -Wait [URL unfurl="true"]https://www.google.com[/URL]
## sleep 10 seconds for testing until cert issue resolved
start-sleep -s 10
##enable smartcard reader using admin credentialsand suppress confirm prompt
$d | Enable-PnpDevice -Confirm:$false #$creds
I would appreciate any assistance.
Micah