Search results for: “get-aduser”

  • PowerShell: Looking up specific user properties

    Many of my customers use specific properties for various things. Most users do not have ADUC installed, and some of our customers even disallow installation of ADUC on end user computers. I recently had a user ask about looking up the contents of a specific attribute (extensionAttribute6, in case you were wondering). Luckily, this –…

  • PowerShell: Find many users using their name

    This time around, I take the basis that I created last week, add a way to catch any users that is not found, as well as a way to run it on multiple users.

  • PowerShell: Find User based on partial name

    Some time ago, I needed to look up the account names of a handful of users in Active Directory. The information I had beforehand was their names. I did not have ADUC available to me, but I did have PowerShell. This is an excellent use case for the Get-ADUser cmdlet when combined with the -Filter…

  • PowerShell: Default properties

    Last week, when describing how to return specific properties, I mentioned that the command returns some standard properties, which is why I didn’t have to specify that it should get the Displayname for the members of the group. What properties are by default returned for the commonly used commands?

  • PowerShell: Return multiple specific properties

    The script I described a few weeks ago for finding all members of several groups is serving me very well indeed. I was recently asked to provide both the display name and the login name for each member in the group. This was readily achieved by modifying the script slightly. The rest of the script…

  • Powershell: A script to find all members of several groups refined

    One of the scripts that I use most often is the one I wrote about back in September of 2019. Usually, I only run it for up to ten or so groups, so it’s not a big problem to simply swap out the group name, rince and repeat. Recently, however, I needed to run it…

  • Finding the full OU path of an AD OU

    Using PowerShell, I was building a script to identify a subset of the groups in a given organizational unit (OU). As you may know, these are built up of subsections with the prefixes CN (common name) and DC (Domain Component). In order to have the script run successfully, you need to specify the OU using…

  • PowerShell: Find all groups containing a specific string

    Sometimes, you need a list of all groups whose name contain a specific string, whether that is in the beginning, middle, or end of the group name. As we’ve seen previously, looking up groups in PowerShell is done with the Get-ADGroup command. Adding the -filter parameter allows us to find groups that satisfy our needs.…

  • Excel: Text to Columns

    I work a lot with text files containing data which is, to some degree or another, structured. Whether a breach file from a published breach, or the result of a powershell query such as Get-ADUser, Get-ADComputer, or Get-ADDirectReports, I need to separate the data into columns so that I can work with it. This is…

  • PowerShell: Pipe output to CSV file

    Last week, I showed you how to get specific properties for all users in a given OU. Knowing that the output of that query quickly gets hard to navigate, wanting to remove the extraneous data that the customer didn’t request, and assuming that they wanted to manipulate the data, I decided to return the results…

  • PowerShell: Getting properties for all user objects in a given OU

    Two weeks ago, I showed you how I got some specific properties for a specific user. Perhaps unsurprisingly, the next request from my customer was a similar dump from a specific OU. While the Identity parameter works well when you’re dealing with a specific user, it doesn’t help when you want all users. Furthermore, they…