When working with network shares on Windows 7, you might encounter a frustrating scenario where changed credentials keep getting rejected. This typically happens when:
- You previously accessed a share using domain credentials
- Didn't check "Remember my credentials"
- Later changed the domain password
- Now getting "Logon failure: unknown user name or bad password"
Unlike saved credentials in Credential Manager, these temporary cached credentials reside in a different location:
Security Account Manager (SAM) cache LSA (Local Security Authority) subsystem Kerberos ticket cache
Here's the most effective sequence I've found through extensive testing:
1. Clear Existing Connections
net use * /delete /y
2. Purge Credential Cache from Command Line
cmdkey /delete:10.10.10.10 klist purge
3. Reset Server Session from Client
net session \\10.10.10.10 /delete
4. Force Credential Refresh with PowerShell
$cred = Get-Credential New-PSDrive -Name "TempShare" -PSProvider FileSystem -Root "\\10.10.10.10\folder" -Credential $cred -Persist Remove-PSDrive -Name "TempShare"
5. Manual Registry Cleanup (Advanced)
If all else fails, check these registry locations:
HKEY_CURRENT_USER\Network HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2
When IP-based access fails, try these workarounds:
- Use FQDN instead of IP:
\\server.domain.com\share
- Access through WebDAV:
net use * http://server.domain.com/share
- Create new local user matching domain credentials temporarily
To avoid this situation:
# Always disconnect properly net use \\server\share /delete # Use dedicated credential objects $cred = New-Object System.Management.Automation.PSCredential ("DOMAIN\user", (ConvertTo-SecureString "password" -AsPlainText -Force)) New-PSDrive -Name "X" -PSProvider FileSystem -Root "\\server\share" -Credential $cred
These can help diagnose credential issues:
# List current sessions net session # View cached tickets klist tickets # Check authentication attempts Event Viewer -> Windows Logs -> Security
Windows 7 maintains an internal credential cache for network resources even when you don't explicitly choose "Remember password". This becomes problematic when:
- Domain account passwords change
- You need to switch between different sets of credentials
- The cached credentials prevent new authentication attempts
1. Using Command Line Tools
The most effective method is through the Windows command prompt with elevated privileges:
:: First, delete any existing connections net use * /delete /y :: Then clear specific credential cache cmdkey /delete:10.10.10.10
2. Registry-Based Solution
For stubborn cases where credentials persist, modify the registry:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa] "DisableDomainCreds"=dword:00000001
Note: This requires a reboot to take effect.
3. PowerShell Alternative
For modern environments with PowerShell access:
# Clear all credential manager entries Remove-Item -Path "Microsoft.PowerShell.Security\Certificate::CurrentUser\My" -Recurse # Alternative method using WMI Get-WmiObject -Class Win32_NetworkLoginProfile | Where-Object {$_.Name -like "*10.10.10.10*"} | Remove-WmiObject
When the standard methods fail:
- IP vs Hostname: Clear credentials for both forms (10.10.10.10 and server.domain.com)
- Service Dependencies: Restart the Workstation service:
net stop workstation /y && net start workstation
- Explorer Cache: Kill and restart explorer.exe process
For enterprise environments, consider these additional steps:
:: Clear Kerberos tickets klist purge :: Reset security subsystem net stop kdc /y net start kdc
Remember that some operations may require administrative privileges and could affect other network connections.