WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

wNT
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

wntMemberGrps and wntMemberSet - Error:562 Invalid user

Keywords: 562 user name invalid wNTMemberGrps   

Question:

I am trying to get information about the local user, to see if it is associated with the administrator group. I am using wntGetUser to obtain the username, and plugging that into wntMemberGrps, yet I am still getting error 562 error: Invalid user.

   AddExtender("WWWNT34I.DLL")
   username=wNTGetUser(@default)  ;gets username with wntGetUser
   Message("Current User is",username)
   groups=wNTMemberGrps("",username,@LOCALGROUP,1);error occurs here 562 invalid user name
   AskItemList("%username% is associated with",groups,@tab,@sorted,@single)

Answer:


If you do not give the server-name parameter and the username cannot be resolved by the domain controller you may need to specify "Server\username" for the "username" parameter. Trying looking up in the user administrator on NT to see how the user name is defined. It may be defined as server\username.
Here is the correct info:
   AddExtender("WWWNT34I.DLL")
   server="servername"
   username=wNTGetUser(@default)  ;gets username with wntGetUser
   Message("Current User is",username)
   groups=wNTMemberGrps("","%server%\%username%",@LOCALGROUP,1)
   AskItemList("%server%%username% is associated with",groups,@tab,@sorted,@single)
OR
   AddExtender("WWWNT34I.DLL")
   server="\\servername\"
   username=wNTGetUser(@default)  ;gets username with wntGetUser
   Message("Current User is",username)
   groups=wNTMemberGrps(server,username,@LOCALGROUP,1)
   AskItemList("%username% is associated with",groups,@tab,@sorted,@single)

wntMemberSet and 562 Invalid User Error

Question:

I'm getting the Error 562: Invalid user name, even after adding a 5 minute delay after login, as you suggested.

Answer:

Since a reboot makes it work, it sounds like a domain database synchronization problem of some sort. If so, waiting 5 minutes may not be enough. It might take an hour or so, depending on how often the domain databases synchronize, and the network topology. Maybe try using the NLTEST utility from the NT Server Resource Kit to force a manual update.

Also, my experience is that making a change to the network information on a workstation (like changing the domain) through Control Panel always makes Windows want to reboot for the changes to take effect, and there is probably a reason for this.


Article ID:   W13575
Filename:   wntMemberGrps wntMemberSet - 562 invalid user name.txt
File Created: 2001:03:01:14:19:50
Last Updated: 2001:03:01:14:19:50