Solved

Creating Organizational Units

Posted on 2004-09-07
5
461 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
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now