Tag: get-adgroup

  • 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?

    (more…)
  • Finding all groups without a manager in a specific OU in AD

    Last week, I showed you how you can easily find the OU to use when looking for the members of a specific OU. Today, I’d like to show you how I use that information. The background was that we use AD groups to control access to network shares. In order for IT support to know who is authorized to approve requests for access to these shares, we use the Managed By tab, assigning the owner of the network share as manager:

    (more…)
  • 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. Using asterisks as wildcards, we can specify whether the string should be at the start, middle, or end:

    (more…)
  • PowerShell: Building a script to find all members of several given groups

    Last week, I showed you how I find all the nested members of a specified group. When we get requests for such audits, however, they usually specify doing so for a number of groups. Now, we could of course do it, one group at a time, adding information to our output as we go, however the script as written overwrites the file. What, then, if we want to run this on a number of groups, and avoid overwriting the file? That requires the -Append parameter:

    (more…)