Solved

Creating Organizational Units

Posted on 2004-09-07
5
467 Views
Last Modified: 2010-04-05
How do you create Organizational Units through Active Directory?  Also how do you assign members to the Organizational Units?  
0
Comment
Question by:edwardsr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 13

Expert Comment

by:BlackTigerX
ID: 11999031
seems you got this in the wrong category... anyway...
read on:
http://support.microsoft.com/default.aspx?scid=kb;en-us;324743
0
 

Expert Comment

by:scholzfree
ID: 12006174
0
 

Author Comment

by:edwardsr
ID: 12010354
I figured out how to create the users and orginanzational units using the "Active DS Type Library."  

How do I assign the users as well as other OU's to an OU?

function GetComputerName: String;   ///   Returns the computer Name   ///
var
  buffer : array[0..MAX_COMPUTERNAME_LENGTH + 1] of Char;
  Size : Cardinal;
begin
  Size := Max_COMPUTERNAME_LENGTH + 1;
  Windows.GetComputerName(@buffer,Size);
  Result := StrPas(buffer);
end;

function GetDomainName : string;    ///   returns the Domain Name   ///
var
  err : Integer;
  buf : pointer;
  fDomainName: string;
  wServerName : WideString;
begin
  wServerName := GetComputerName;
  err := NetServerGetInfo (PWideChar (wServerName), 503, buf);
  if err = 0 then
    try
      fDomainName := PSERVER_INFO_503 (buf)^.sv503_domain;
    finally
      NetAPIBufferFree (buf)
  end;
      result := fDomainName;
end;


procedure TfrmNTRS.btnCreateAccountClick(Sender: TObject);
  ///   Creates the Organiztional units   ///
var
  Comp : IADsContainer;
  OrgUnit : IADsOU;
begin
  GetDomainName;
  try
    comp := GetObject('LDAP://' + GetDomainName) As IADsContainer;
    OrgUnit := comp.Create('OrganizationalUnit', 'OU=' + leClassName.Text) As IADsOu;
    OrgUnit.SetInfo;
  Except On E: EOleException Do
    Begin
      ShowMessage(E.Message);
    End;
  End;
0
 
LVL 2

Accepted Solution

by:
Lunchy earned 0 total points
ID: 12271158
Closed, 125 points refunded.
Lunchy
Friendly Neighbourhood Community Support Admin
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question