NetWkstaSetInfo

NetWkstaSetInfo

Post by Christina Sahha » Tue, 23 Feb 1999 04:00:00



I'm having problems getting this function to work under NT 4.0.  It always
returns ERROR_INVALID_LEVEL even if the level is correct.  What gives?   100
and 101 don't work.

Does anyone have any other suggestions for setting the workstation
programatically?

TIA,
Christie

 
 
 

NetWkstaSetInfo

Post by Felix Kasza [MV » Tue, 23 Feb 1999 04:00:00


Christie,

 > [NetWkstaSetInfo()] always returns ERROR_INVALID_LEVEL
 > even if the level is correct.  What gives?   100 and
 > 101 don't work.

lmwksta.h has this to say:

        // NetWkstaGetInfo only.  System information - guest access
        //
        typedef struct _WKSTA_INFO_100 {
        [...]

        // NetWkstaGetInfo only.  System information - user access
        //
        typedef struct _WKSTA_INFO_101 {
        [...]

        // NetWkstaGetInfo only.  System information - admin or operator access
        //
        typedef struct _WKSTA_INFO_102 {
        [...]

Further down, you'll find that levels 302 402 502 are settable, as are a
bunch of single-value settings (> 1000).

--

Cheers,

Felix.

If you post a reply, kindly refrain from emailing it, too.

No anti-spam address here. Just one comment: IN YOUR FACE!

 
 
 

NetWkstaSetInfo

Post by Christina Sahha » Wed, 24 Feb 1999 04:00:00


Felix --

102 doesn't work either.  And, FWIW, I have guest, user and admin rights on
my machine.  Any other ideas?

Christie

 
 
 

NetWkstaSetInfo

Post by Felix Kasza [MV » Wed, 24 Feb 1999 04:00:00


Christie,

 > 102 doesn't work either.  And, FWIW, I have guest, user and admin rights on
 > my machine.  Any other ideas?

Re-read my original reply, the quote from lmwksta.h:

 >   // NetWkstaGetInfo only.  System information - admin or operator access
 >   //
 >   typedef struct _WKSTA_INFO_102 {

The operative phrase is "NetWkstaGetInfo only". No NetWkstaSetInfo()
allowed.

If you'd tell me exactly which field(s) you need to set, I'd be happy to
dig through the header file and see if I can find suitable info levels
for you.

--

Cheers,

Felix.

If you post a reply, kindly refrain from emailing it, too.

No anti-spam address here. Just one comment: IN YOUR FACE!

 
 
 

NetWkstaSetInfo

Post by Christina Sahha » Wed, 24 Feb 1999 04:00:00



>Christie,

> > 102 doesn't work either.  And, FWIW, I have guest, user and admin rights
on
> > my machine.  Any other ideas?

>Re-read my original reply, the quote from lmwksta.h:

> > // NetWkstaGetInfo only.  System information - admin or operator access
> > //
> > typedef struct _WKSTA_INFO_102 {

Ahh!  That explains alot.  I missed that.  Sorry.  The MSDN documentation is
wrong then.

Anyway,  I'm just trying to set the workgroup on an NT machine.

Thanks for your help,
Christie

>The operative phrase is "NetWkstaGetInfo only". No NetWkstaSetInfo()
>allowed.

>If you'd tell me exactly which field(s) you need to set, I'd be happy to
>dig through the header file and see if I can find suitable info levels
>for you.

>--

>Cheers,

>Felix.

>If you post a reply, kindly refrain from emailing it, too.

>No anti-spam address here. Just one comment: IN YOUR FACE!

 
 
 

NetWkstaSetInfo

Post by Felix Kasza [MV » Wed, 24 Feb 1999 04:00:00


Christie,

 > Anyway,  I'm just trying to set the workgroup on an NT machine.

prior to NT5, I am not aware of any documented way to do this. (NT5
offers stuff such as NetGetJoinInformation(), NetJoinDomain(),
NetRenameMachineInDomain() and so on.)

--

Sorry,

Felix.

If you post a reply, kindly refrain from emailing it, too.

No anti-spam address here. Just one comment: IN YOUR FACE!

 
 
 

NetWkstaSetInfo

Post by Christina Sahha » Wed, 24 Feb 1999 04:00:00



>prior to NT5, I am not aware of any documented way to do this. (NT5
>offers stuff such as NetGetJoinInformation(), NetJoinDomain(),
>NetRenameMachineInDomain() and so on.)

>--

>Sorry,

>Felix.

Really?  Not even an undocumented registry hack?  That's a surprise.

Thanks anyway,
Christie

 
 
 

NetWkstaSetInfo

Post by Felix Kasza [MV » Thu, 25 Feb 1999 04:00:00


Christie,

 > Not even an undocumented registry hack?

Moving into or out of a workgroup might be doable that way ... but
joining or leaving a domain takes a bit more effort, including telling
the LSA/Netlogon about it, creating or deleting the computer account in
the domain SAM, and so on.

--

Sorry,

Felix.

If you post a reply, kindly refrain from emailing it, too.

No anti-spam address here. Just one comment: IN YOUR FACE!

 
 
 

1. NetWkstaSetInfo usage

    I am trying to change the workgroup name of the system by using the
NetWkstaSetInfo call. However it fails no matter what I try to do.
Specifically, does anyone know where the parm_num should go. (The help
files don't say.) If anybody has an ideas, please let me know. If you
know of any other way to change the workgroup name (programmatically) on
WINNT 4.0, do let me know.

TIA
-Sridhar

2. New Adventures..Any Coming out??

3. Set workgroup on NT 4 (using NetWkstaSetInfo() ?)

4. slocal? draft?

5. Do you know about NetWkstaSetInfo function??

6. Selftest-Tune MIDI File?

7. o you know about NetWkstaSetInfo function??

8. Documents will not go into frame but opens new window