473,748 Members | 2,602 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

1 New Member
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=domai n,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 "ntSecurityDesc riptor", Array(secDescri ptor)

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

Thanks and sorry for my bad english,

Marc
May 9 '07 #1
0 1426

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

Similar topics

2
3400
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 server, it's running good the bat file copying files from target computer in the LAN to the local computer, o.k
5
4232
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. The IIS security tab has Anonymous unchecked. The other two boxes are checked. I have tried also with only the clear
10
9785
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 under IIS on a Windows 2003 Server. The server does not have the SMTP service running, but I do have a third party SMTP/POP/IMAP server running. I have copied the CDONTS.DLL file and registered it. In the Web Serice Extensions I have enabled the...
5
8480
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
12681
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 Gatto Dan Guzman Apr 27 2000, 12:00 am show options
7
12154
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 DirectoryInfo(TargetDirectory); target.Delete(true); I don’t have problem manually delete the whole directory. Please advice. Thanks,
16
2121
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 very broad and gives the entire zone high privleges. I tried giving just the assembly full trust (using the full URL for the DLL), but this doesn't seem to work.
606
14709
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 out INSERT statements. Here is the error which I am getting: Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.
6
2836
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 to get my .aspx pages to be shown on IIS. Here is the error. Event Type: Error Event Source: ASP.NET 2.0.50727.0 Event Category: None Event ID: 1089 Date: 18/05/2007
0
8984
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8823
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9312
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9238
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8237
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.