PowerShell one-liner: Find AD user based on property

While working in Active Directory based environment you are often dealing with AD user accounts and probably using often Get-ADUser command. In this article I want to present several simple examples how to use it. Normally when we want to display user details we use -Identity : To list names of all available user properties we can use Get-Member command: The case will be a little bit different when we …

Test LDAP Connection with PowerShell

In this article you will find out how to test LDAP Connection to your domain controllers. It is very similar to previous post about Test-PortConnection function. In this example we will focus on making an LDAP connection using ADSI. On the beginning of function we need to check if DC name provided as a parameter is valid: Usage: Final script:

ADSI – Searching for an user object in Active Directory

In this article you will learn how to use ADSI searcher. Script finds users based on samaccountnames and gathers their attributes. Instead of using AD cmdlets like Get-ADUser we can use ADSI search method which is much faster – it can be used when we have to query many users: In $SAMNames variable you have to add your AD users samaccountnames and in object part you can specify which attributes …