Skip to main content

Posts

Showing posts with the label Password

System.DirectoryServices.AccountManagement

Ever since .NET 2.0  System.DirectoryServices.Protocols  have been a part of the framework and in .NET 3.5 even more directory related classes were added, namely  System.DirectoryServices.AccountManagement . That is exactly as it sounds a namespace containing methods for account management. This fits perfectly for a little project I have chosen to call AD Cleanup Tool. This tool will go through all accounts in a domain to clean up certain account properties, such as naming, password policy etc. Some older solutions does not work with todays versions of Active Directory, for instance if I want to set the property  User must change password at next logon . This has earlier been done by setting the property  userAccountControl  with the flag  ADS_UF_PASSWD_CANT_CHANGE . It is not possible to set that flag anymore, but S.DS.AM gives us an even easier solution: using(PrincipalContext context = new PrincipalContext(ContextType.Domain, "192.16...

TFS Build and password protected strong name keys

A problem that I and many others  have had occurs whe you use TFS Build to build projects that are signed with a password protected strong name key. When the project is built the first time in Visual Studio a dialog pops up prompting for the password. In an automated build process this dialog cannot be displayed, which results in the following error: C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1805,7): error MSB4018: The "ResolveKeySource" task failed unexpectedly. System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() at Microsoft.Build.Tasks.ResolveKeySource.ResolveAssemblyKey() at Microsoft.Build.Tasks.ResolveKeySource.Execute() at Mic...

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...