BackOffice Products
1754852 Members
5502 Online
108827 Solutions
New Discussion юеВ

scripting adssecurity

 
Andre_19
Occasional Advisor

scripting adssecurity

Hello

I'm trying to script adssecurity (tool from adsi sdk) in order to set permissions on a folder-structure. When I define a trustee from the activedirectory by name "MillerJ". The user is found and used. But if I want to set permissions for a server local group "SomeUsers", a group by the same name from somewhere in the activedirectory is used instead of the local group from the server. If I use the syntax "server1\SomeUsers" I get the funny error message "The security ID structure is invalid".
Now I'm looking for a way to address the local server group and get the correct user/group instead of just provide a name and get some user, that is found by coincidence somewhere in the ad.
Does anybody know how to do this? Do I have to retrieve the SID first and use it somehow, or is there a specific syntax I need to use?

(N.B. I'm not using xcacls because it doesnt seem to be able to assign very specific permissions, but only predefined sets of permissions. But maybe I'm wrong in this)
So long and thanks for all the fish
2 REPLIES 2
Jon Finley
Honored Contributor

Re: scripting adssecurity

Try SomeUsers@server1


Jon
"Do or do not. There is no try!" - Yoda
Andre_19
Occasional Advisor

Re: scripting adssecurity

Hi Jon

Thanks for your help, but I still get the same error-message, stating that the security ID structure is invalid.
The code I use is:

set objace = createobject("accessControlEntry")
objace.trustee = mylocalgroup@myserver1
objACE.Aceflags = OBJECT_INHERIT_ACE + CONTAINER_INHERIT_ACE
objAce.Acetype = ACCESS_ALLOWED_ACETYPE
objAce.Accessmask = FILE_LIST_DIRECTORY

set objadssec = createobject("ADssecurity")
set objsecdesk = objadssec.getsecuritydescription("FILE://\\myserver1\myfolder")
set objDacl = objsecdesc.discretionaryACL
objsecdesc.discretionaryacl = objdacl
call objadssec.SetSecurityDescription(objSecdesc)

the error occurs in the last statement. I'm really not sure, if the problem might occur, because I use local groups instead of users.

Thanx
Andre
So long and thanks for all the fish