Using VB.NET 2010:
I'm making a simple "launcher" application for our work applications. I have already created the ToolStripMenu that contains the menus I want. They will be arranged like so:
File | Dept 1 | Dept 2 | Dept 3 | Admin | Help
What I need to do, is restrict access to the Admin menu, based on the Environment.UserName variable. Ideally, I would like to have it not even render - but if the only option is to have it greyed out, I am okay with that as well.
There are a rather large number of ways that a LAN admin can move that cheese. You can tell from the very awkward code I posted. Querying the domain controller with the classes in the System.DirectoryServices is often necessary.