Questions tagged [adsi]

Active Directory Services Interfaces

Microsoft's implementation of LDAP, ADSI is the protocol Windows computers use to maintain a domain relationship, including groups, Organizational Units (OU's), domain controllers, etc.

268 questions
2
votes
1 answer

LDAP Search Filter Syntax (ONLY) to Identify Objects in a Specific OU (AD)

Many of the non-LDAP-specific applications that interface with AD (e.g. apps that read in objects or use AD for auth) allow only for specifying an LDAP search filter. The problem with this though is that I can't limit the query anything below the…
thepip3r
  • 2,855
  • 6
  • 32
  • 38
2
votes
1 answer

Can't query for description from SQL using ADSI

I have a linked server using ADSI. I can successfully query for most attributes except description. My query: SELECT * FROM OpenQuery (ADSI, 'SELECT description,sn,givenName FROM ''LDAP://mydomain.com/OU=users,DC=com,DC=mydomain'' …
dunck
  • 398
  • 1
  • 5
  • 18
2
votes
0 answers

List LDAP trusted domains with Java

We're migrating from C to Java, and we need to query Active-Dirctory Domain to get the list of trusted domains. Until now, we've done it with ADSI. And a second question. Is the concept of "trusted domains" only related to Active-Directory Domain,…
manolowar
  • 6,772
  • 5
  • 23
  • 18
2
votes
1 answer

How can I use Perl to test for Win32 group membership when group contains nested groups?

I'm trying to use Perl to determine if a Windows users is a member of a Windows group, if the the group contains nested groups. I've tried using Win32::NetAdmin::GroupIsMember(), but it only works if the user a direct member of the group. I'm not a…
2
votes
2 answers

Should I use the Active Directory module cmdlets or DirectoryServices .NET class

I have a really simple question. What is better to use? AD Module (ie. Get-ADComputer) or DirectoryServices .NET Class when trying to connect to AD and pull all computers, users, and groups from a Domain. Or does it not matter at all? The key…
Murf
  • 487
  • 5
  • 9
2
votes
1 answer

Can ADSI be used to set password for windows account requiring change at first logon

I have a modified version of this PowerShell script: https://social.technet.microsoft.com/Forums/scriptcenter/en-US/355d9293-e324-4f60-8eed-18bcc6d67fc0/adsiwinntcomputeradministratoruser-with-alternate-credentials?forum=ITCG It fails when trying to…
user5505180
  • 23
  • 1
  • 4
2
votes
2 answers

Get the domain name of the user of ADSI object?

In the following script, it will print all the users of the groups. However, the domain name is missing (Some users are in different Windows domain)? $computer = [ADSI]"WinNT://$server,computer" $computer.psbase.children | ? { …
ca9163d9
  • 27,283
  • 64
  • 210
  • 413
2
votes
1 answer

Access denied adding domain user to local administrators group

When adding a domain user to the local administrators group I receive an access denied, this worked before and now sadly and strangely it no longer does. $user = "mydomain/user" $group =…
beehaus
  • 415
  • 1
  • 4
  • 13
2
votes
2 answers

Extract AD User information via ADSI

How can I get these properties for a user via ADSI LDAP, these are the properties from Get-ADUser, I need the equivalent for ADSI. Enabled PasswordNeverExpires PasswordExpired Name SamAccountName Mail PasswordLastSet My objective is to query the…
PowerShell
  • 1,991
  • 8
  • 35
  • 57
2
votes
2 answers

Selecting certain properties from an object in PowerShell

The ADSI query works fine, it returns multiple users. I want to select the 'name' and 'email' from each object that is returned. $objSearcher = [adsisearcher] "()" $objSearcher.searchRoot =…
beehaus
  • 415
  • 1
  • 4
  • 13
2
votes
1 answer

How can I obtain the OU of the logged in user in C#?

I'm looking for a method to obtain the current logged in user's full Active Direcory LDAP path. e.g. LDAP://CN=john.smith,OU=UK,OU=Sales,DC=Company,DC=local
Ollie
  • 885
  • 1
  • 7
  • 14
2
votes
0 answers

Is using DirectoryServices.NativeObject slow/bad?

In an ASP.NET 4 application, I have existing code to access a user's Active Directory information (potentially under Windows Authentication or FBA) like this: // authType taken from run-time config file, default below AuthenticationTypes authType =…
JonBrave
  • 4,045
  • 3
  • 38
  • 115
2
votes
2 answers

Edit gPCMachineExtensionNames Attribute via Powershell

I have to modifiy the gPCMachineExtensionNames Attribute string from a group policy in active directory with powershell. For this, I first want to read the existing string, modify this and replace the old with the modified. The attribute is defined…
m.hegnauer
  • 23
  • 3
2
votes
1 answer

The remote procedure call failed and did not execute. (Exception from HRESULT: 0x800706BF)

I did ask this question at Microsoft forums but did not get any reply. I am asking here hoping to get an answer. My query is detailed below. I have a C# application which manages user's on AD using ADSI APIs. For managing user's password, I make use…
user1576882
  • 147
  • 2
  • 3
  • 13
2
votes
1 answer

Getting Error Querying Active Directory On The Server Only

I have the following block of code that queries Active Directory for users by Group Name using System.DirectoryServices.AccountManagement: var domainContext = new PrincipalContext(ContextType.Domain, "company.container.internal"); var…
atconway
  • 20,624
  • 30
  • 159
  • 229