Link to home
Start Free TrialLog in
Avatar of Mike
MikeFlag for United States of America

asked on

Need Help creating a Power-shell Script

Greeting Experts,

Can somebody help me create a PowerShell script to clear cached passwords in a Windows Operating System (7/10)....
Avatar of Michael Pfister
Michael Pfister
Flag of Germany image

Have you seen this? It describes a simple batch file to perform the clear:

https://blogs.technet.microsoft.com/rmilne/2019/01/11/script-to-clear-credman/

Of course this can be converted to a PowerShell if required
Avatar of Mike

ASKER

do you have a sample script ...  like removing all creds from the cache.
ASKER CERTIFIED SOLUTION
Avatar of Michael Pfister
Michael Pfister
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Get-CachedCredential| Where-Object{$_.User -match"admin-"} | %{Remove-CachedCredential $_.Target}

Open in new window



this will clear for admin, use similar
Avatar of Mike

ASKER

I was mainly looking to clear all cached creds... Michael Pfister it works perfectly ... thx..... aravind anche, thank you for the suggestion...