Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Creating Organizational Units

Posted on 2004-09-07
5
Medium Priority
?
483 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
 

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

650 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