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

ADSI
plus

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

Adding NT4 Global Group to a Windows 2000 Domain Local Group


Question:

Does anyone have an example of adding nt4 global group to a windows 2000 Domain local group using "dsAddToGrp"?

Answer:

You are working with a "downlevel trust" so, if memory serves me, you need to use the "WinNT:" provider instead of the "LDAP:" provider in your group paths.

If you don't understand ADSI object paths (a.k.a. monikers), look in the extender help file for examples. You can also go MSFT's MSDN Web site for more info on AD and ADSI. If you find a VB example that does what you want, you can easily translate it to WB 2004C. WB's new COM implementation makes translation very simple.

After doing some digging found the following script snippet that will add an NT4 group to an AD group.

AddExtender("WWADS34I.DLL")
sSid = dsGetProperty("WinNT://gen/UNIV-373SHARED-R", "objectSid")
shexSid = dsSidToHexStr(sSid)

; You need to create an LDAP style path
; for your foreign security object.
; (This is called "SID Binding".
sSidObjectPath = "LDAP://"

; This is the path of the Win2k group
; you are adding your NT4 group to.
sAdGroup="LDAP://corp.opg.com/CN=DLG_AP Procedure_CHANGE,CN=users,DC=CORP,DC=OPG,DC=com"

; The first parameter is the Win2k group.
; The second parameter is the Nt4 group.
dsAddToGrp(sAdGroup, sSidObjectPath) 

Article ID:   W16303
File Created: 2005:02:18:12:19:44
Last Updated: 2005:02:18:12:19:44