To make this work with SQL2005 I had to store a Maximum Password Age and the Number of Days before expiration to begin notifying users that their passwords would expire. I'm sure you could integrate with windows security policy or active directory to get these values directly but I didn't do that here. With SQL2008 you would only need to store the Number of Days before expiration to start notifying because you can query the DaysUntilExpiration LoginProperty in SQL2008. I wrote this work both ways depending on which version of SQL was running.
To capture the fields I needed I created a new Dynamics GP form in Visual Studio Tools that could be accessed from the Additionals Menu in Company Setup. I chose to store this data in the DUOS so that I didn't have to deal with creating any new tables. Therefore, you can setup each company to behave differently which could be a blessing or a curse. Of course, you could change this to store the data in a custom table but it would also be nice if GP had a installation specific DUOS in the DYNAMICS database for this purpose. Hint, hint.
Next, I added a NewHandler in VST on the SwitchCompanyCloseAfterOriginal event to compare the age of the users password to the maximum password age and days before notification captured in the PWExpirationNotice VST Form. If the user is due to be notified that their password would expire soon I present them with a message box...
... and then the User Password Setup window in which they could change their password on their way into the GP Company.
The prompt and User Password Setup window are only presented on the first login for a session. So, the users won't be nagged every time they change companies without shutting down GP first. They also aren't forced to change their password but rather given the option to do so easily at a convenient time so that they don't get locked out later.
I chose VST over Modifier/VBA to ease deployment as much as anything. You can download the .dll for this mod if you want to try it out here. Just drop it in your Addins directory and it will work in Fabrikam.