Howto change the workgroup

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I want to modify the workgroup, which the computer joins when it starts up.
But I don't want to use the GUI for this purpose, instead I want to change
the workgroup programmatically e.g. with a script or a Win-API call or
something like this. Does anybody know how to do this?

Any hints are welcome,
Klaus
 
you can change it when you build xpe image, go to whatever pc component
you use(ie, standard pc, ACPI uniprocessor pc etc, ) click on setting,
then system identification, you can change there.

jet
 
Thank you for your answer. But what I need, is something different:

My image runs from CF-Card with a custom shell and is write protected by
EWF. The user does not have access to the control panel, because I don't want
that he accidentally misconfigures the whole system. The user can only
configure some few things like network settings. So I build my own
configuration dialogs e.g. one for configuring the network settings like
IP-Adress, DNS etc. The IP-settings I set with 'netsh', the computer-name I
set with Win32-API call 'SetComputerName'. But unfortunately there is no API
call like 'SetWorkgroupName'. So I'am looking for a solution to set the
workgroup at runtime from within my own configuration dialog.

Klaus
 
I thought there might be a WMI solution, but
Win32_NetworkAdapterConfiguration doesn't seem to yield a solution. You
might want to try asking the Visual Studio NG.

Regards,

Sean Liming
www.sjjmicro.com / www.seanliming.com
XP Embedded Book Author - XP Embedded Advanced, XP Embedded Supplemental
Toolkit
 
Like Sean said WMI offers a solution. You can create a simple C#
application that use System.Management.dll to access the
Win32_ComputerSystem class in the WMI Service. Workgroup value and some
others can be modified programatically.

Jonathan Proulx
 
Hi Klaus,

I used "NetJoinDomain()" in a C-Program. The return code was OK, but it
took quite some time until the computer was to be seen in the network.

Regards,
Susanne Stöhr
 
Hi Sean, JoP and Susanne,

first I tried WMI. Because I don't have .Net Framework on my image I used
WMIC instead of C# program. I used the alias "ComputerSystem" for
Win32_ComputerSystem class. I could read all attributes like "Domain" which
is the domain- or workgroup-name. But I wasn't able to change any of the
attributes, don't know why.

Then I tried 'NetJoinDomain' from Platform SDK. Return code was
'NERR_Success', which means OK. The function call takes some time (about 5
sec.) but then the workgroup name was changed correctly. Wonderfull - it
works.

Thank you all for your help. This newsgroup is really a great help for me!
Klaus
 
Back
Top