Questions tagged [ou]

OU stands for Organizational Unit. It's used in directories in general and in LDAP (Lightweight Directory Access Protocol), particularly to point out the main attribute of the organizationalUnit class.

Organizational Unit is described in ITU-T X521 (Telecommunication Standardization sector of International Telecommunication Union) as a class used to define entries representing subdivisions of organizations. As far as LDAP is concerned, organizationalUnit is defined in RFC2256.

Organizational Units are generaly the immediate superior of entries of object class user, inetOrgPerson, group or groupOfNames.

103 questions
3
votes
1 answer

How do I use WMI to get the current OU of a computer and list all other computers in that OU?

I'm using WMI and am trying to find a powershell script that will allow me get the OU of the local computer and then get a full list of computers in that OU.
user2369812
  • 779
  • 2
  • 9
  • 21
2
votes
2 answers

Ask user to choose option from stored list (AD OU Path)

I modified a PowerShell script to create AD and Office 365 accounts automatically, it works fine but helpdesk need to manually type out the OU path. Is there a way to pre-define OU path & assign number to it so if the helpdesk press 1 it chooses the…
2
votes
1 answer

Changing hostname and domain joining fine; but when specifying OU

So when I run the following script it works as expected $newname = Read-Host 'Desired hostname' $user = Read-Host 'Domain admin username' $cpc = hostname.exe Add-Computer -DomainName DOMAIN.CO.UK -ComputerName $cpc -NewName $newname -Credential…
2
votes
1 answer

VBS Scripting to move computers from one OU to the next

I am working on packaging a script for the company that I work for that will allow field service techs to convert computers in a private workstation OU to a team workstation OU and vice versa. That is a small part of this script for now and one that…
2
votes
1 answer

Ldap filter for multiple OU C#

How can we filter LDAP with multiple OUs. For example: URL for single OU: LDAP://xxxx.com/OU=Users,OU=xxx,OU=xxxx,DC=xxxxx,DC=xxxxx But I need result for multiple OU. Solution can be in LDAP URL or it can be in c# code which ever is suitable. I am…
Japneet Singh
  • 155
  • 1
  • 3
  • 13
2
votes
1 answer

VBS Retrieve Computer OU from AD and OU Case Statement to Perform Action

I have this piece of code from the ScriptIT guys. Set objSysInfo = CreateObject("ADSystemInfo") strComputer = objSysInfo.ComputerName Set objComputer = GetObject("LDAP://" & strComputer) arrOUs = Split(objComputer.Parent, ",") arrMainOU =…
2
votes
2 answers

LDAP search base DN not working

I'm trying to perform an LDAP search into many different OUs that are located at the root of the directory. Context initialization: Hashtable env = new Hashtable(); env.put(Context.SECURITY_AUTHENTICATION,…
2
votes
0 answers

Error : Exception calling "MoveTo" with "1" argument(s): "The server is unwilling to process the request. "

I am trying to write a script to move OU of users in AD 2008 $Alias = "hareeshvm" # Finding the location of the user account harveesm: $Root = [ADSI]("LDAP://DC=corp,DC=bharatpetroleum,DC=com") $searcher = new-object…
ashishk
  • 36
  • 2
2
votes
5 answers

check if OU is protected from accidental deletion

I was working with OU's and just trying to find out Is there any way I can check whether OU is protected from accidental deletion or not? I googled it but couldn't found any solution. I am looking for solution in C# not scripting. Thanks in advance
sunder
  • 1,803
  • 4
  • 29
  • 50
1
vote
2 answers

How to query Organizational Units from a given DN in Perl

I need to retrieve all Organizational Units from a given DN stringh, I am using Net::LDAP module and this little script: my $msg = $ldap->search( base=>'DC=sample1,DC=sample2', filter=>'(objectclass=User)', ); foreach $entry ($msg->entries)…
raz3r
  • 3,071
  • 8
  • 44
  • 66
1
vote
0 answers

Why can't I find AD security group using the AD User and Computers tool?

I created a security group in AD. Using the AD Users and Computers tool, I can see it when I browse for it at the OU path, but I cannot see it using the "Find" function. Why is that? Result when I browse for the group. Result when I do a "Find" for…
1
vote
0 answers

Any way to identify the Computer's OU information from local WMI or Registry

I'm looking for a way to obtain the OU information of a computer from its local WMI or Registry. I know there are ways to pull the OU information from a host using PowerShell and AD commandlets... Afraid every time we execute the commands, it will…
Nana
  • 21
  • 4
1
vote
0 answers

php AD ldap search filter specific OUS

Here is my AD structure AD structure , running ldap query with php ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ds, LDAP_OPT_REFERRALS, 0); $term = $_GET["term"]; $rAD = ldap_bind($ds, $admin,…
SSp_8787
  • 11
  • 1
1
vote
2 answers

How do I remove all the groups from disabled Active Directory Users via Powershell?

I'm trying to gather all the disabled users in our Active Directory and trying to remove the disabled users from all their groups. Mostly for cleanup purposes. I'm a bit stuck on my script. I'm not sure what to put after…
1
vote
3 answers

Is it possible to allocate one user (entry) below two different OU (Organizational Unit) in OpenLDAP?

I'm planning the structure of a brand new OpenLDAP server to integrate it with Moodle. I thought about the following structure: O=CompanyName OU=ProjectName uid=UserID001 uid=UserID002 uid=UserID003 OU=ProjectName uid=UserID002 See that the…
lrepolho
  • 951
  • 1
  • 12
  • 23