473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Get local computers Workgroup name

zav
Hi all.

Getting stright to the point Im trying to get and set my computers workgroup
name but im having litle luck, i've tryed:

Environment.UserDomainName
Environment.MachineName

but they only retreive the local machine name.

Can anyone point me in the right direction.
Thanks.

P.s reason being, im writing a small app for changing NIC settings on the fly.
Nov 17 '05 #1
3 8908
To retrieve the workgroup, try
System.Environment.GetEnvironmentVariable("USERDOM AIN"). This may not always
work depending on who is logged in. For example, if you use this command
from an ASP.NET page, you will get a workgroup of "NT Authority" because of
the settings of the default user.

Hope this helps.

--
Bruce Johnson [C# MVP]
http://www.objectsharp.com/blogs/bruce
"zav" wrote:
Hi all.

Getting stright to the point Im trying to get and set my computers workgroup
name but im having litle luck, i've tryed:

Environment.UserDomainName
Environment.MachineName

but they only retreive the local machine name.

Can anyone point me in the right direction.
Thanks.

P.s reason being, im writing a small app for changing NIC settings on the fly.

Nov 17 '05 #2

"zav" <za*@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.com...
Hi all.

Getting stright to the point Im trying to get and set my computers
workgroup
name but im having litle luck, i've tryed:

Environment.UserDomainName
Environment.MachineName

but they only retreive the local machine name.

Can anyone point me in the right direction.
Thanks.

P.s reason being, im writing a small app for changing NIC settings on the
fly.


What exactly are you trying to achieve?
NIC settings have nothing to do with "Computers workgroup" names.

Willy.
Nov 17 '05 #3
zav
Thats correct they dont, however im providing myself with multiple network
profiles. With the information i have im able to load a different profile
<NIC settings> and im able to use the net at work, and with a simple button
click im able to change my profile back to home <no playing about adding and
removing the tcp/ip settings for different location>.

The workgroup name problem was really only something i was curious about,
given i could get all other information i thought it would be an idea to
enable profiles to get / set workgroup information for different locations,
enabling access to network resources in different locations <e.g home =
MSHOME, work = MSWORK>.

I hope this shows my intentions.

Zav.
"Willy Denoyette [MVP]" wrote:

"zav" <za*@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.com...
Hi all.

Getting stright to the point Im trying to get and set my computers
workgroup
name but im having litle luck, i've tryed:

Environment.UserDomainName
Environment.MachineName

but they only retreive the local machine name.

Can anyone point me in the right direction.
Thanks.

P.s reason being, im writing a small app for changing NIC settings on the
fly.


What exactly are you trying to achieve?
NIC settings have nothing to do with "Computers workgroup" names.

Willy.

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: MHenry | last post by:
Hi, We were going merrily along for 6 years using this database to record all client checks that came into our office, including information about what the checks were for. Suddenly, network...
3
by: Steve | last post by:
Hi all How would i get a list of all Active Computers on a network? All I need are the computer names. Kind Regards, Steve.
1
by: Bilge TUTAK | last post by:
Hi, I want to find the list of the computer names in a workgroup or in a domain. Is there a way to do this in VB.NET? Thanx
1
by: haren | last post by:
i am working with a LAN of 20 computers with win -98 and win-xp,my problem is that when i try to see workgroup computers from my pc with win xp,sometimes it shows the all compute in the same...
4
by: lage | last post by:
Hi, I am working with a web site that uses CDONTS from a function in a Com+ component to send mail to clients after sign up etc, as well as sending clients mail to support from a web form. A...
6
by: kimiraikkonen | last post by:
Hello, I've been working on a project and i wonder how to get list of the LAN computer names in a tree list which are involved under the same workgroup name? What can be the code be? Very...
2
by: Bruce | last post by:
Hello all, I have an annoyance that is common to all of the Access 2003 applications I manage. All of the applications are split front end/ back end with a front end copy on each client...
6
by: belias | last post by:
So...here we go. I'm having an issue with one computer on a network not being able to ping other computers by name. I've spent the last day searching similar issues and I've tried all the steps...
0
xxoulmate
by: xxoulmate | last post by:
how to get workgroup name of a local computer of OS 98 and xp?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.