Skip to main content

Posts

Showing posts with the label Windows

LEAP Sweden - Windows 8 and Windows Server 2012

I am back home in the couch filled with enthusiasm from the last gathering of LEAP Sweden before the trip to Redmond in the end of May. Todays topic was the new versions of Windows (server and client) as well as the Business Intelligence product suite from Microsoft. The Business Intelligence suite basically is a really nice integration between products that already exist. With SQL Server 2012 , SharePoint 2010 and Excel 2010 tightly integrated Microsoft offers a really attractive package. Mikael Nyström showed off some of the new features in Windows Server 2012 . To say the least this is an impressive release. There is a heavy focus on virtualization, storage and terminal services which makes Microsoft a strong competitor against both VMWare and Citrix in the small to medium sized business segment. One of the coolest features has to be conditional permissions. Johan Lindfors gave a demo on Windows 8 development . He showed some samples of how easy it is to develop Met...

User.Identity returns old login name after name change

When a person gets married or makes a name change for some other reason this usually means that the login name for the Active Directory-account changes as well. This is rarely a problem, but it turned out to cause some issues on our web server, where the  User.Identity  property was still returning the old login name. The user logged on with the new login name, but was identified by the web application as the old login name. The reason this occurs is because the  User.Identity  property relies on the  LsaLookupSids  method to convert the user SID to a login name. The method first calls the local  LSA-cache , which is not synchronized with the Active Directory. For this purpose a simple reboot of the web server to clear the  LSA-cache  propably would have sufficed. But since we didn't want to take the application offline rebooting was not an option. Instead, it is possible to set the registry value  LsaLookupCacheMaxSize in HKLM...

Get DNS-information using WMI

With the purpose of automation DNS documentation I needed to get information programatically from the DNS servers. The answer to this, and many other similar tasks is spelled  WMI . That is short for  Windows Management Instrumentation , which is an infrastructure for getting information from Windows using a specific query language. Here is a method to get the host names and IP addresses for each A-record on the specified domain. public string Server = "192.168.0.1"; public string Domain = "domain.local"; public string Username = "DOMAIN\User"; public string Password = "Pa$$w0rd"; public Dictionary<string, string> GetHosts() { Dictionary<string, string> hosts = new Dictionary<string, string>(); ManagementScope scope = new ManagementScope(String.Format(@"\\{0}\Root\MicrosoftDNS", Server)); scope.Options.Impersonation = ImpersonationLevel.Impersonate; scope.Options.Username = Username; scope.Opti...

MCTS: .NET Framework 3.5, Windows Forms Application Development

I finally took the time to go through with a certification that I have been wanting to do for a while, MCTS: .NET Framework 3.5, Windows Forms Application Development . During my years as a .NET developer I have been working a lot with Windows Forms, so this was not a painful experience. The next step will propably be to aim for MCPD in the same area before it is time to move on to the new Visual Studio 2010 and .NET 4.0 certifications.

Nostalgia in Win32 API

I started my programming career by modifying a guestbook written i Perl for one of my first web sites. When I took the step into the Windows platform the natural choice was the Win32 API and C. In my early teens I managed to create a couple of really interesting applications. When Google recently found a  web site  from 1999 for one of these applications I had to take a trip down the memory lane. I have now found two amazing application, written by me in my teens, which even seem to work pretty good on todays operating systems, including a 64-bit Windows 7. The applications are developed and tested for Windows 95/98 so there are no guarantee for the function on other platforms. What I can guarantee is that the applications are 100% free from any malware or other bad stuff. Text  is a revolutionary text editor focused on fancy word proceccing functions instead of unnecessary eye candy. The Cornball  is a solitaire game where the goal is to put the cards in order ...

Elevated Privileges Application Launcher

At a number of times we have had requests to be able to run applications as a normal user even though the application is designed to run as an administrator. This could be handled manually by setting the privileges on each computer for certain paths and registry keys and any other resources the application requires. This easily gets out of hand and there is a much better solution, spelled  EPAL . Sure, it requires some configuration and tweaking, but when set up it works like a charm and is a great tool to compensate for poorly written Windows applications requiring administrative privileges.

Problems and solutions

This week has been lined with clumsiness, weird problems and some pride. The latter because I actually managed to conquer the problems. The clumsiness was just me managing to shut myself out from my computer. All accounts except the domain accounts were disabled, the domain cache was disabled and network settings not allowing contact with the domain. That is not a good combination. Thanks to  Offline NT Password & Registry Editor  I got in again just fine. The reason this all happened was mainly a security aspect, but combined with the poor network settings it turned out to be way too secure. The weird problems had to with our Windows CE application. As usual the information supplied from the users is very limited, like  "it doesn't work" . But when I finally got my hands on the log files I got even more confused. Weird problems in the shape of  SqlCeExceptions , no GPRS connection, sudden torn-offs... It turned out to be a memory card that was loose. The dat...