473,396 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

[VBScript] Error while setting ntfs permission to new created group in the AD

1
Hello,

I'm just writing a script that creates Groups in the AD. This groups are named by a special name convention (for our firm). I also set the "Scope of Group". Everything works very nice.

Now I want to set NTFS permissions on the new build group and I tried using this:

Expand|Select|Wrap|Line Numbers
  1. Const UF_WORKSTATION_TRUST_ACCOUNT = &H1000
  2.  
  3. Const UF_ACCOUNTDISABLE = &H2
  4. Const UF_PASSWD_NOTREQD = &H20
  5. Const ADS_GUID_COMPUTRS_CONTAINER = "aa312825768811d1aded00c04fd8d5cd"
  6. Const ADS_ACETYPE_ACCESS_ALLOWED = 0
  7. Const ADS_ACEFLAG_INHERIT_ACE = 2           
  8.  
  9. sUserOrGroup = "ou2/Groups/User Name"       
  10. Set secDescriptor = createGroup.Get("ntSecurityDescriptor")
  11.  
  12. Set dACL = secDescriptor.DiscretionaryAcl
  13. Set ACE = CreateObject("AccessControlEntry")
  14.  
  15. ACE.AccessMask = -1
  16. ACE.AceType = ADS_ACETYPE_ACCESS_ALLOWED
  17. ACE.AceFlags = ADS_ACEFLAG_INHERIT_ACE
  18.  
  19. ACE.Trustee = sUserOrGroup
  20. dACL.AddAce ACE
  21. secDescriptor.DiscretionaryAcl = dACL
  22.  
  23. createGroup.Put "ntSecurityDescriptor", Array(secDescriptor)
  24. createGroup.SetInfo
  25.  
  26. createGroup.AccountDisabled = False
  27. createGroup.SetInfo
  28.  

My LDAP looks like this: LDAP://10.0.10.10/ou=OU1,dc=domain,dc=test
The User I want to give permission to the group is in
domain.test/OU1/OU2/Groups/ and it's name is User Name (only to see, if perhaps the path to the user is wrong and so it doesn't work.

When I start the script, I logon to the AD, build a new group - this works. Now I want to set the permissions and get the error "The security ID structure is invalid" in this row:

createGroup.Put "ntSecurityDescriptor", Array(secDescriptor)

Hopefully you can help me - I would be very happy!

Thanks and sorry for my bad english,

Marc
May 9 '07 #1
0 1413

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Rocket Hawk | last post by:
Hello All, I am using windows 2000 server IIS 5.0 i was trying to run bat file from asp page and getting: Access Denied but when i run the bat file from the command prompt on the local...
5
by: Fox | last post by:
Hi I do not run a domain or Active Directory. I am on IIS 5.0 on Windows 2000 server. When I secure a folder and its files I am having a problem getting the new user to be able to access it....
10
by: Seeker | last post by:
Hi! I have to do some developing and I'm trying to configure my server to mimic the operation of our production server. The issue I'm having is that I'm trying to use CDONTS to send an email...
5
by: Ben | last post by:
hi when I try to excecute an ASP (either JS or VB) script to say, access a database record, I get an Internal Server Error HTTP 500.100 Why? and HOW CAN I FIX THIS? Thanks
4
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck...
7
by: Charts | last post by:
I login as administrator of the machine. However running the following code get access denied exception for file inside the directory. The source code: DirectoryInfo target = new...
16
by: Marina | last post by:
Hi, I am trying to find the minimum security settings to allow a windows control embedded in IE have full trust. If I give the entire Intranet zone full trust, this works. However, this is...
606
by: Neil Zanella | last post by:
Hello, I am trying to update an MS access database from ASP.NET. I am using IIS on Windows XP Pro. I can issue SELECT statements from ASP.NET using ADO.NET but I cannot seem to be able to carry...
6
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
I have asked previously, how to get the rid of 'Server application unavailable' error. Mr Llibre tried tried diligently to help, but same problem. I would like a bullet proof suggestion as to how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.