Showing posts with label Microsoft Windows. Show all posts
Showing posts with label Microsoft Windows. Show all posts

Wednesday, July 10, 2024

IIS using unexpected (incorrect) Integrated Windows Login

This has just recently become a major problem for me because I created an app that uses the Windows login to access my intranet web tool. For some reason, it was accessing an admin account that I also use instead of my logged in user.

I found this really strange because I never put in the password. I tried to clear my cookies and rebooted my machine, yet somehow it retains my admin account.

I spent an hour figuring this out eventually giving up and worked on something else. Then somehow which seems almost randomly, I thought about checking the credential manager.

Solution

I use the credential manager to manage my user and password for different network solutions. At my place, they use a different login to access these resources for security purposes. I find it such a pain because a few applications are not designed for this scenario. I put in the network folder, user, and password so I thought this couldn't be the solution but I had nothing else to try.

I did notice on closer inspection that it changes the network path \\servername to just servername. I just removed the one related to my tool and suddenly my tool was working as expected again.

Wednesday, November 30, 2022

Buggish: Windows Files In Use (Locked) but Still Able to Rename thus Not In Use

There are times that I am unable to overwrite a file in a destination folder. There is nothing that I am aware of that has it open. Whether I use script or using Windows Explorer, it is unable to overwrite the file. But I can rename the file then copy the file.

If I am able to rename the file, this seems to indicate that the file is not in use. Sooooooooooo.... I have no idea what is going on. I have been able to do this for years and does not appear to have ever been resolved. This has also been impossible to search on Google because everyone is searching for resolution for a file that is actually locked or in use (although unknowingly to them).

Friday, July 8, 2022

Buggish: MS Authenticator on Company Secured Phone; Having to sign in 5 times just to use a site.

Company secured phones can be extremely burdensome in that everything requires an authentication. None of the automated notification goes through until it is unlocked. Because of all this, I missed many 2-factor authentication because it turns out to be almost like 5 authentication steps.


If I do not remember to unlock my phone first and I sign into a page that requires authentication, I have to first unlock my phone. This triggers all the notifications which includes all the emails, all the messages, and all the IM/DMs. By the time, I can even get to the button to open authentication, the login has already timed out. So I sign-in again...

By the time, I sign in again... my phone has locked. So I have to unlock again. Then open the authenticator again, agree, put in the unlock code again. Then watch my sign-in hasn't logged in. Check my phone again, and notice another authentication and repeat. Then I watch my sign-in expire and say the sign in failed because it too short for two authentications. Two because the first one was for the first time that I logged in.

So I sign in for a third time. This time I unlock my phone first. Open, unlock code, agree... and finally in. Sometimes it even fails to log in for some reason and I have attempt a fourth time. And then even sometimes this just keeps failing, then I try on another browser. If that fails, I reboot and do it all yet again.


And our lovely company also likes to use the admin account practice. We also have two domains. So the first step was just to switch domain. So now, I have sign in again to get my admin password. This time with an additional step to put in a code, then put in my unlock code. Copy the admin password.

Go to the site I wanted to go to, sign in with admin account. Then put in the admin password again. Finally, usually I get to where I needed to be.


Why do I need to log in so many times? By the second or third or fourth or tenth time, does the system think that the hacker took over my phone or device or my life? The most likely scenario is that I got so frustrated that I threw my phone out the window at which point I guess then all this security does make sense.

Wednesday, July 6, 2022

MIND BLOWN: powershell or cmd from window explorer (Windows 10)

MIND BLOWN: A new category to publish something that has been around forever that I have never known and is a life-changer for me.


HISTORY: For a long, long, long time... I have always dreaded using cmd, CLI, powershell, etc. because I just hated having to navigate to the folder. I have only known to open it from the run command or some shortcut. It is not bad if I can manage my folders because I keep it short and simple. Other people always seem to have deep folder structures, spaces, special characters, etc.


SUMMARY: I can just type powershell or cmd in the address bar (ALT+D), and it'll open to the directory the windows explorer is open to.

I don't know when this started and I don't care because I rarely ever have to go to an older version of Windows and Windows 10 has been around for some time now. But this is so mind-blowing for me. Because I can tell you that every time I had to use powershell, I always, ALWAYS right-click in the window in hopes that an option would appear for me. There is the Run Powershell, but that doesn't accept user prompts (or at least I have never figured out how to get that to work as I don't work with PS on a daily basis or even yearly basis). But now that I have been tasked to build DevOps pipelines, I am finally forced to learn this stuff.


Additional Notes: Found the reason, right-click does not work is because the script was throwing an error:

File C:\test.ps1 cannot be loaded. The file C:\test.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.

To resolve this, I had to run:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

After this, I was able to right-click and execute it.


Alternative: I can also just go to file and open with mouse clicks. 

 

Tuesday, April 19, 2022

Upgrading Microsoft C# SMO from 160.2004021.0 to 161.47008.0 "cannot convert from 'system.data.sqlclient.sqlconnection' to 'Microsoft.SqlServer.Management.Common.IRenewableToken'"

 ERROR:

"cannot convert from 'system.data.sqlclient.sqlconnection' to 'Microsoft.SqlServer.Management.Common.IRenewableToken'"


Convert all System.Data.SqlClient to Microsoft.Data.SqlClient


RCA

Updated Microsoft.SqlServer.SqlManagement from 160.2004021.0 to 161.47008.0

Monday, April 18, 2022

Buggish: Canon MX922 printer driver on Windows 10

MP Driver vs XPS Driver (working solution)

Summary: (To print) Download and install MP driver. No problems also installing XPS but it requires MP driver to be installed first.

Detail: They are not the same. XPS does require the MP to be installed first. If XPS is executed first, it will show a message that the MP driver is required. On the same note, I am not sure if security patch is included.

Windows Default Driver (did not work)

I tried the Windows PCL driver and point it directly to the ip address of the printer. This does not work. I can ping the address. I also later installed the MP driver which is also pointed to the same address.

Windows Find Printer (useless and avoid)

It found the printer, but keeps showing missing driver. There is no way to resolve this in Windows only. Click into the option only displays scanner and configuration options, nothing related to printers. It does not show up in the printer options. It is also a little misleading because clicking "Add Printer", you have to wait for Windows to load something. If you close the windows before this happens, the printer does not even show in the list (although still useless after).

Upon initial "setup" it requests to open a printer app (from the Windows app store). Skip this. That app is useless. 

Wednesday, October 6, 2021

Buggish: Sharing folder breaks IIS

I do not understand why sharing an IIS directory breaks IIS. The worst part is that I cannot undo this. I cannot unshare the directory and have IIS work again. And when I compare to other IIS directories, the permissions look exactly the same.

There are several resources on how to resolve this which typically boils down to adding IUSR or IIS_USERS to the directory. But what I am interested in is how do I return back to before? How did IIS work before sharing? I can understand that sharing the folder changes the permissions, but what did it change?

I check to make sure all the users are the same under the security tab under the folder properties. Is there another way to apply permissions to a folder? There must be, right? Otherwise, I should see a difference.

I also checked the web.config file which is the main reason that IIS breaks because it no longer has access to read that file. It makes little sense that this would be it because I can always create a new web.config file which happens often with developers because they want to backup the original then drop in the new file.

I also checked IIS Manager, but nothing seems to make sense there. Authentication is using Anonymous Authentication and Application Pools uses IUSR. Oddly, adding IUSR does not fix my problem. I had to add IIS_USERS to fix the problem. Why? I have no clue.

Monday, October 4, 2021

Buggish: Unable to access MS Network Folder (after deleting with net use)

 This is incomplete blog, but wanted to add note for future reference:

https://stackoverflow.com/questions/24933661/multiple-connections-to-a-server-or-shared-resource-by-the-same-user-using-more



C:\> net stop workstation /y

C:\> net start workstation




Reference

https://douglastclee.blogspot.com/2021/05/buggish-unable-to-access-ms-network.html

Monday, August 9, 2021

Workaround: Infrastructure messed up DNS hostname and I can no longer access a server but server is up

I have a custom tool that uses server name to access server as that is the highly recommended method to access servers. Suddenly I no longer can access a server. I can no longer remote desktop or ping. Ping is not just a timeout but does not even resolve the name. I really, really, really wanted to avoid having to modify my configurations for a temporary change of a hostname to ip address.

One major reason that I want to avoid this is because Windows is extremely finicky about what users is logged into the server. I have to use a special admin account to login not the default one that I use to log into Windows (which also translates to the default IIS user that the web tool uses). Resetting this password to set a new password is still unclear and very messy. The cleanest method that has worked consistent is just to reboot the entire server which runs other web applications.

Anyways, I recall during a cloud custover where we used the host file to resolve names that have not been set up yet. I used to use this for web hostnames. I thought it was worth a shot and found that it also works for network folders.

The file for Windows 10 is located at (default) C:\Windows\System32\drivers\etc\hosts. You may need to run the text editor as administrator for this to save. Anyways, this saved me a lot of time and the hassle to revert it back once infrastructure team fixes the issue.

There should be a cleanup to remove the entry in the host file. I am likely to forget this as I probably will soon to forget to follow up with infrastructure team on my ticket.

Friday, August 6, 2021

Buggish: Windows calculating time stuck at zero to copy/unzip with windows explorer

Today I've had it. I tried to unzip a file from my local drive to a sub-folder in the same folder and the Windows download window pops up with its calculating. The zip file has around 20 files with each no more than a few kilobytes.

The popup just stayed at 0% for at least 15 minutes with the animation still running like it is thinking. I read a post that it should still be doing the activity while it is calculating but this is definitely not happening on a Windows 10 as I only see a single file in the sub-folder. After I cancel, all I see is that one file.

I do not know why this happens. This is not the first time. I have this issue with copying files from folder to folder. It is also kind of random with a small number of files, maybe under 10 files. Usually it will eventually copy/unzip/move. But the calculate time takes way, way, way longer than the actual action so what is the point of calculating the time?

I downloaded 7-zip and unzipped the files then canceled the windows unzip which was still calculating. So I waited 15 minutes, download another app, did the same activity that I originally requested, and checked the files before the calculate even reached 1%.

If it is something holding it up, it should either fail quickly or at least explain why it is taking forever.

Sunday, June 6, 2021

Info: Command to get OS version from remote server

WMIC /user:domain\userId /password:userPassword /node:remoteServerName os get buildnumber,caption,CSDVersion /format:csv

Monday, May 10, 2021

Buggish: Unable to access MS Network Folder (IP versus HostName)

Problem (rare)

I am able to some times get to the machine's base share folders but unable to access sub-folders. I have share permissions and local machine permissions on the network machine. This seemed random because I was able to connect to other shares with IP address and hostnames. I have a different login to access the network folders than the system that I am working from.

Solution (workaround)

Be consistent with the address to the network folder. If logged in with IP address (\\10.10.10.10), continue to use IP address. If logged in with hostname (\\hostname), continue to use hostname. If you logged in with IP, then you may get access issue when using hostname. Also the same vice-versa. I was able to replicate this every time.

(Edit: 6/12/2021) Consistency is key. Using simple hostname or the fully qualified hostname (e.g. \\hostname vs \\hostname.domain.local) will also have the same issue. The trickier part to this is that net use will see these are the same and will not allow the user to provide login for both \\hostname and \\hostname.domain.local. This makes it very hard to switch. I had an post on how to remote net use but it does not work. My only solution is to reboot the system each time this needs to be corrected.

Background

We moved from one cloud platform to another. Before the group used IP addresses to connect to network folders. After the migration, we started to use hostnames. The infrastructure team also created a tunnel between the two cloud platforms. The tunnel was only accessible with IP.

When on the new system, I was still switching between IP and hostname depending on where I was copying the server address from. So I will oftentimes switch between the two depending which was readily available for me.

I do not think many people will face this problem as most people will be consistent with the address. The last oddity was that I can ping the hostname and resolves to the same IP but for some reason the destination folder does not recognize that as the same login. (I mean, I can probably guess why this is happening from the problem but not sure why it was designed this way.)


Reference

https://douglastclee.blogspot.com/2021/10/buggish-unable-to-access-ms-network.html (added 2021-10-06)

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

Close all Windows Explorer windows.
  • 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

Sometimes "net use" does not allow me to add another network share with different credentials saying that it cannot manage multiple shares. I'll use "net use /delete" to remove the connection. Then when I try to add it again, it still gives me the same error. Even after I "net use" again to check, the connection is no longer there. When I try to delete it again, it says it does not exist.

I believe this may be held up by the windows explorer that I keep open.



Reference

https://stackoverflow.com/questions/24933661/multiple-connections-to-a-server-or-shared-resource-by-the-same-user-using-more

Sunday, September 6, 2020

Buggish: Headset microphone not working (used to work) Windows 10, Realtek, audio connection (not USB)

I am not even sure when this happened, but suddenly the built-in mic was being used as the microphone even though it was using the headset microphone for a good period of time. I suspected something was wrong when the mute button no longer worked. I definitely found out when I was talking for a whole call then later realized my mic was up the entire time.

I tried so many different things with the sound and microphone settings in Windows 10. I tried uninstalling the audio driver in device management. I tried unplugging and re-plugging. Nothing worked for me, and none of them made a lot of sense to me because my headset is through the audio jack so it should accept the input as part of the system.

I suspected that the setting must have been set to headphones instead of headset. Then I remembered that I haven't seen the options to choose when I plug in the audio jack. I tried a lot of options to find it. Tried to run the RtkNGUI64.exe file which did not do anything.

I finally got fed with it and just went to look for the RealTek latest drivers. I should have known the auto-check wouldn't do its job. This is the full reinstall which will uninstall and re-install. I had to re-plug the headset to get the options.

I found the download on RealTek but the download took forever. Found the same driver on CNET download: https://download.cnet.com/Realtek-High-Definition-Audio-Codec-Windows-7-8-8-1-10-64-bit/3000-2120_4-77507761.html.

This probably took me a good half day to figure out, and several days of using the built-in mic because I didn't have the time to troubleshoot this. I also realized how little I know about Windows now compared to 10+ years ago. Age...

Tuesday, August 25, 2020

Code: Display Net Use default results with C#

 Win32_NetworkConnection


Summary

This was the WMI OS CIM class needed to get the results from a simple Windows command prompt "net use" command. 



Thoughts

This was somehow amazingly hard to find on google. For whatever reason, the only command I can find were for Win32_OperatingSystem or Win32_Share.

There is plenty of information on all the elements but just could not find a connection between net use and Win32_NetworkConnection. 


My Sample Code

                string serverName = @"\\serverName";
                string WMIClassName = "Win32_NetworkConnection";

                List<string> shares = new List<string>();

                ConnectionOptions connectionOptions = new ConnectionOptions();

                ManagementScope scope = new ManagementScope(serverName,
                                                            connectionOptions);
                scope.Connect();

                ManagementObjectSearcher worker = new ManagementObjectSearcher(scope,
                                   new ObjectQuery($"select Name from {WMIClassName}"));

                foreach (ManagementObject share in worker.Get())
                {
                    shares.Add(share["Name"].ToString());
                }


References

Wednesday, January 29, 2020

My Thoughts: Learning Linux is hard (from Microsoft products) but worth the price?

The amount of information that is purely leaking out of my head as I write this article is just ridiculous. I just finished configuring Django/Python, Debian, Apache, MariaDb (after PostgreSQL), Google Cloud, PuTTY, DBeaver, Eclipse, and Git from scratch (no knowledge). That experience was so very tedious.

If I were to do this again, I would have learned Java and MySql first. The rest are fine. The biggest hurdles was reading documentations for MariaDb which some doubles from MySql. This worked for the most part, but in some rarer instances, MariaDb has kind of split from MySql. So, I spent a lot of time following directions that didn't work. Django was an added layer too because I was not sure if it was Django configuration or an Apache configuration. I think by going with Java and MySql, I would have one less layer of technology to figure out where my problem was.

Another hurdle was that I was working of a Windows system while configuring these technologies on Google Cloud. Of course, I also went with Debian without the GUI so I had to learn all the terminal commands. I did not setup a comparable environment on my machine so I had to upload to Google Cloud to test things. This of course meant that I had to figure out how to connect PuTTY and DBeaver to Google Cloud.

Visual Studio may be a good alternative to Eclipse and DBeaver. That I am not sure would have been easier or not. From my experience most people in this tech stack typically use Eclipse. I am not so sure about DB IDE.

Compared to my experience with Microsoft products, this was much much harder than learning MS products. Wizards, tutorials, how-to instructions, etc. were all levels easier to focus on the configurations that needed to be changed. MS definitely got my up, running, and programming within the same day. This took me about 3 weeks only weekends and some nights, so maybe equivalent to 10 days of actual work. Either case, way longer than it took for MS. Maybe this is a sign of my age...

As for pure learning curve goes, MS is way easier and faster.

As for performance, empty shells of a project is already way faster than empty MS projects.

As for price, MS is way too expensive.

In conclusion, there are pros and cons to both. As a person that wants to make decent wage to effort, learning non-MS product is worth the price as they are paid more in general for similar jobs. Good MS developers can still be paid well in higher tiers but there are fewer available openings and more lower quality developers vying for the same role plus managers who cannot recognize good talent.

Monday, July 22, 2019

Buggish: Windows 10 Context Menu Does Not Disappear (right click)

Problem: Right click on any windows entity that creates a context menu (the menu that appears after right clicking), then click on any of the options. Once clicked, that option "never" disappears.

Trigger: I have not determined what triggers this problem. It is repeatable once it is triggered though.

Workaround: Lock screen and log back in. I think anything that will refresh the whole screen.

Fix:
1. In the Windows search, type in Performance and look for Adjust the appears and performance of Windows
2. Look for the option for Fade out menu items after clicking
2.a. For me, the Performance Options window was already open to the list of options under custom. By default it is under Performance Options > Visual Effects > Custom > Fade out menu items after clicking.
3. You may need to use the workaround one more time.

Once I logged back in, the error no longer occurred. I just fixed the issue and have not rebooted. Hoping this is a permanent fix.

Friday, June 21, 2019

Buggish / Paradox: Windows 10 shutdown failed

This morning while shutting down my work laptop, windows failed to shutdown and gave the following error message:

:(
Your PC ran into a problem and needs to restart. We're just collecting some error info, and then we'll restart for you.
XX%
For more information about this issue and possible fixes, visit http://windows.com/stopcode
If you call a support person, give them this info: Stop Code: SYSTEM SERVICE EXCEPTION

The most amusing aspect of this experience was that the resolution to the failed shutdown was to reboot which went without any problems. So, basically windows can't safely shutdown only?

I know the system probably just killed the process to restart, but still a little amusing.
 
 
 
 

Sunday, September 7, 2014

Buggish: User Profile Service service failed the logon. User profile cannot be loaded. (Microsoft Vista)

I was called to assist a family friend's mother who ran into an error with her laptop. Here the problem would have been a little more useful if they had told me what the problem was before I arrived there. The problem is that the user received an error the the profile cannot be loaded once they enter their password.

This made it rather difficult to troubleshoot because I cannot log in to figure what information is missing. Unfortunately, this was also the only user created on this machine. So to get into the machine, I had to reboot the system into safe mode. For Vista, this is F8 during the OS load screen.

Once in the OS, I looked up the error which I came across reference-1. I picked the registry fix:
1. F8 in Windows load screen
2. Safe Mode
3. Open to registry location: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\
4. Look for profile that matches the login in question and there should also be a bak version of the key
5. Rename the main key to another name (I added .bad)
6. Rename the backup key without the extension (remove .bak)
7. Reboot, and this fixed my problem

I then created a backup of the registry file (saved in a folder in the documents folder) so that it could be easier for the user to fix this problem in the future:
1. F8 in Windows load screen
2. Safe Mode with Networking
3. Open My Documents
4. Open old computer backup
5. Double click FixUserProfile.reg (although .reg may not show but should be the only file in the folder)
6. Reboot, and this should fix the problem

Worst case if you dont have a problem to work with, below is the keys needed within the registry profile (modified some values to remove identification):
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXX-XXXX]
"ProfileImagePath"=hex(2):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
"Flags"=dword:00000000
"State"=dword:00000000
"Sid"=hex:00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00
"ProfileLoadTimeLow"=dword:00000000
"ProfileLoadTimeHigh"=dword:00000000
"RefCount"=dword:00000002

"RunLogonScriptSync"=dword:00000000

Reference

1 - http://answers.microsoft.com/en-us/windows/forum/windows_vista-security/user-profile-service-service-failed-the-logon-user/4ed66b21-c23e-42f1-98b2-706dcf931fae

Thursday, June 19, 2014

Work Life: Windows detected a hard disk problem

Windows detected a hard disk problem - Back up your files immediately to prevent information loss, and then contact the computer manufacturer to determine if you need to repair or replace the disk. Start the backup process. Ask me again later. If the disk fails before the next warning, you could lose all of the programs and documents on the disk.

I was getting the somewhat frequently last year over a span of 2-3 months. Some days it would just come up every 15-30 minutes. After a while, the problem just went away.

A few months back, the problem started back up again. This time around, I had more downtime to report the issue to support. They were going to "re-image" to a new disk.

Typically a reimage would provide me the same configurations and such, but it was not so. I also received a larger disk. Even though the support tech said re-image, the programs were reinstalled and not re-imaged. This forced me to reinstall quite a few other applications that are not part of the standard install.

The process also took 2 days to complete. At first this was odd because a re-image should not take so long. But in hindsight, reinstalling Windows then all the applications will take quite a bit of time.

Unfortunately with a larger hard drive, my computer seems to run slower even though everything else seems to be exactly the same.