Thursday, May 20, 2021
Buggish: C# Replacing \n with
versus \r\n versus \n\n
Friday, May 14, 2021
Anecdote: Replacing plaintext user id and password with password vault
Monday, May 10, 2021
Buggish: Unable to access MS Network Folder (IP versus HostName)
Problem (rare)
Solution (workaround)
Background
Reference
Thursday, May 6, 2021
Buggish: MS Error Copying Files to Network Share after granting permissions without reboot
I hate rebooting, so I try my best to look for solutions even if it costs me more time. In this case, I am trying to copy a file to another new network share. I get an error that I do not have permissions to do so. Then I tried to use "net use" to disconnect and reconnect with the same error.
Solution
- Closing one did not resolve my issue
- Restarting the Windows Explorer may also resolve this issue. This will likely close all Window Explorer windows anyways.
- net use /delete does not work
- The network share wasn't even on my net use list
Potentially Solves Another Issue
Reference
Wednesday, May 5, 2021
Info: Find my system's network folder access' user (wmic, gwmi)
I am wrote a tool to move objects from one server to another. To do this, I use network folders. This is a web tool so I created a local user on each machine that I need access to then created a share folder giving access to my local user.
Problem
While troubleshooting on my development system, my current login user sometimes is used to access the network folder instead of the userid that I wish to use. This occurs sometimes if I use Windows Explorer to check for files before I launch my tool. If my domain account has access to the network folder, this sets my current user account to the network folder. If it does not, then none is set. This was confusing because I was able to access certain folders but not others.
My Solution
I needed a way to see what user account is used to access the network folders. The following are a couple commands that I found that were useful to me.
1. wmic netuse get remotename,username
2. gwmi -Query 'Select LocalName, RemoteName, UserName from Win32_NetworkConnection'
#2 requires powershell to execute
Additional Info
Here are a couple other commands from the page that I didn't need but may be useful to others or my future self.
1. wmic netuse where LocalName="Z:" get UserName /value
2. gwmi -Query 'Select * from Win32_NetworkConnection' | Select-Object LocalName, RemoteName, UserName, ConnectionState | Sort-Object LocalName | ft -auto
3. rundll32.exe keymgr.dll, KRShowKeyMgr