How do you manage your windows users with laptops working from multiple LANs? : FYI

Contribution for the week. A novice view. ( Platform WinXP pro ) Short History : A while back when studying C# for the Mbyte Meter project, I came across Windows Management Instrumentation. WMI is something very new to me and was the best suited API for my project. Understanding it is a bit complex but last evening, after weeks of struggling, I managed a break through. There are many on the net who have not been able to succeed with this below. A potential future project came to my mind about creating an automatic Ip address, Gateway and DNS changer tool. This tool will take in set paramenters and the user just has to select the site, activate profile they are on and work away! The code below is for IP address only, but at a much later stage full development will take place. // WMI has classes that assist you interact with hardware on your laptop/desktop/server. In the case of Network Adapters, WMI provides 3 classes. One that is of importance is Win32_NetworkAdapterConfiguration . It has various methods and properties and of use is the EnableStatic Method. Here's part of the code: // Create access to the class object ManagementObject mO = new ManagementObject ("Win32_NetworkAdapterConfiguration.Index='8'"); // The index is the instances of the network cards. // Get the method in-parameters ManagementBaseObject inParams = mO.GetMethodParameters("EnableStatic"); // where EnableStatic is the method of the class // Add input parameters inParams ["IPAddress"] = new string[] {"192.168.1.1"} // Ip Address is an array inParams ["SubnetMask"] = new string[] {"255.255.255.0"} // SubnetMask is an array // Execute the method and obtain return values ManagementBaseObject outParams = ("EnableStatic", inParams,null); I was able to sucessfully change the ip address and mask using the above. Taste of success is sweet!! :-) Rgds.

Sorry editing the line below. Noviceness.... :-)
// Execute the method and obtain return values ManagementBaseObject outParams = *mO.InvokeMethod*("EnableStatic", inParams,null);

next on the plate ( partly helps on foundation for Byte Meter ). if you know how or can suggest ( c sharp ), pls share else I will continue burning the midnight oil : I'm not too bothered about a UI at this stage but to get the code portion going. - Detect network cards and /or active connections on program launch. This is data from a log file. ( Still have to learn ) - User interface : ( Not difficult ) create New Profile Connection == Enter Profile Name Enter Ip Address Enter Subnet Mask Enter Gateway Enter Metric or Hop count ( if needed ) Enter DNS1 Enter DNS2 Save New Profile to a text file or excel file. ( Still have to learn ) - Also allow program admin to import profile settings so as to avoid repetitive work. ( Still have to learn ) - User Interface : Select Profile from Drop Down list box ( Not difficult ) - User Interface : Run program ( This one is simple ) - User Interface : Stop Program ( This one is simple ) - Program error diagnsotic messages ( This one is simple )

Just a thot, can you share/host your code on github so that interested guys can have a look, fork, modify, contribute back and all that goes with it?. (Or did I miss something that might have been on an earlier thread?) Regards Ukang'a Dickson Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html> - "May you live every day of your life." On Wed, Oct 7, 2009 at 1:39 PM, aki <aki275@googlemail.com> wrote:
next on the plate ( partly helps on foundation for Byte Meter ). if you know how or can suggest ( c sharp ), pls share else I will continue burning the midnight oil :
I'm not too bothered about a UI at this stage but to get the code portion going.
- Detect network cards and /or active connections on program launch. This is data from a log file. ( Still have to learn )
- User interface : ( Not difficult )
create New Profile Connection ==
Enter Profile Name Enter Ip Address Enter Subnet Mask Enter Gateway Enter Metric or Hop count ( if needed ) Enter DNS1 Enter DNS2
Save New Profile to a text file or excel file. ( Still have to learn )
- Also allow program admin to import profile settings so as to avoid repetitive work. ( Still have to learn )
- User Interface : Select Profile from Drop Down list box ( Not difficult )
- User Interface : Run program ( This one is simple )
- User Interface : Stop Program ( This one is simple )
- Program error diagnsotic messages ( This one is simple )
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science: http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi: http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
participants (2)
-
aki
-
Ukang'a Dickson