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.

wntAccessAdd and Invalid User/Group

Keywords: 	  542, "542: Invalid user/group
name"

Question:

Windows/xp Sp3. WinBatch 2012B. I have 2 universal groups created the same day both located in the same domain, 1 group works fine, the other fails with 542 Invalid name\group. I've tried as Server name both my local machine ("") and the PDC. both fail. The folder target is my local c: drive ie C:\temp\a. The group name is passed as domain\group
AddExtender('wwwnt34i.dll')
svcacct = "na\rndus_bnp_vx950_users"
svcacct = StrUpper(svcacct)
sa_filesrv = wntGetDc( "", "", 1)
processdir = "c:\temp\a"
rc = wntAccessAdd(sa_filesrv,processdir,svcacct,303,"Dir2K:ReadExecute",0) 

Answer:

You mentioned two universal groups, one that is successful and one that fails. If you simply change the groupname are you able to successfully add permission on this folder?

Also can you confirm that you can manually give this group "na\rndus_bnp_vx950_users" ReadExecute permission on the directory "c:\temp\a"

User Reply:

Mystery solved, the group was created with a trailing blank in the group name.


Question:

I'm having a problem that recently started happening when using the wntAccessAdd function to add a userid. The error says the user doesn't exist. 542, "542: Invalid user/group name", but the user does exist on the domain controller.

I'm going from an NT4 SP4 client to a NT4 PDC.

In my WWWBATCH.INI file, it says:

    1332 (Lookup Account Name)
This script is NOT in a login script.

Does this function check the local machine, or does it do its editing on the domain controller? I.e., where does it do its validation?

The parameters are all substituting correctly, so the values are right... something else is involved. We know from the docs that the second parameter, the resource/share-name (identifies the object to be modified) does not need to be a share or a full path.

	wntAccessAdd("\\%HOMESVR%", "\\%HOMESVR%\%NTID%$", "RATINGS\%NTID%", 300,"DirNT:Change")

Any idea what the problem might be? Other things to test?

Answer:

  1. Hard code everything first, to get it debugged.

  2. The user lookup is performed using the account database on the server specified by the first parameter ("server").

  3. The second parameter needs to be ONLY the Sharename.

  4. The third parameter needs to be "domain\user" (the location on the domain where the user account is), e.g.:
    	wntAccessAdd("\\%HOMESVR%", "%NTID%$", "TECHTESTDOMAIN\NTID", 300,"DirNT:Change")
    

  5. If you've just added a new user to the domain, there is a problem where the other servers don't know about the new user until the domain is synchronized.

    Another user suggested putting:

    	While !wntUserExist
    
    in a loop to give the server a chance to do the user lookup, but this still won't work until the domain is synchronized.

    So how to synchronize the domain? Well there's an article describing a method: W13480

    Or somebody else suggested that if you can run User Manager:

       Run("c:\winnt\system32\usrmgr.exe", "")
    
    and then send a keystrokes to it (one that won't mess anything else up) to select the domain, and see if the new user shows up in the domain, then save and exit, then the belief is that that will result in a refresh of the new user. The thinking here is that if you were to add the user manually through User Manager, then all the servers in the domain immediately know about the new user. So maybe this is a way to trick the system. Good luck.

    Then do the wntAccessAdd.


Article ID:   W13569
Filename:   wntAccessAdd and Invalid User - Group.txt
File Created: 2012:09:25:11:14:02
Last Updated: 2012:09:25:11:14:02