Solved

Creating Organizational Units

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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

695 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