In a recently closed ticket, I had specified that the solution would be automatically applied upon reboot of a computer. As so often happens one of the twenty or so users affected by the solution emailed to say that it didn’t work. Having dealt with said user before, I had a hunch that they hadn’t actually read the solution text, and wanted to see if I could find out when the computer had last been rebooted.
(more…)Category: PowerShell
-
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 as a CSV-file.
(more…) -
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.
(more…) -
Powershell: Retrieving all properties for a given user object
I was asked to provide an overview of all available properties in an Active Directory user object for an upcoming project. As it turns out, that is very easily accomplished. Unsurprisingly, PowerShell has an applet for this. We use the
(more…)Get-ADUser
applet, with the parametersIdentity
to identify the user in question andProperties
with a wildcard to return all properties. -
PowerShell: Look up all direct reports
In the Organisation tab of a user object in Active Directory, you have the option to set who is the manager of a given user. While this may seem unnecessary, I have found it very useful when supporting a customer where I don’t know the reporting lines, as it gives me a one-stop place to go to find that information.
(more…) -
PowerShell: Count enabled user accounts
A few weeks ago, I showed you how to get a list of all enabled user accounts in PowerShell. Perhaps unsurprisingly, after having presented this to my customer, it transpired that what they really wanted, was to know how many enabled user accounts existed in Active Directory.
(more…) -
PowerShell: Find all users in a specific OU
One of my customers asked for an overview of the UPNs of all users in a specific OU. Having become fairly familiar with the Get-ADUser command, I decided to see if I couldn’t make it do this, too.
(more…) -
PowerShell: Find all enabled user accounts
Some time ago, I was asked to provide a list of all enabled user accounts in Active Directory. My thoughts immediately went to PowerShell, assuming that there would be tools available to achieve that task. I knew that the
(more…)Get-ADUser
query, combined with a parameter, would likely be the ticket. -
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…) -
Building a script to find all members of a given group
Some time ago, I was asked to provide a list of everyone with access to a specific system. After communicating with the client, it transpired that they were particularly interested in knowing who were the members of a set of Active Directory groups. While this can be done manually, I wanted to try my hand at building a PowerShell-script that returned the information the client was asking for, and which I could reuse at some later point, as such requests pop up with some regularity.
(more…) -
Exporting a list of a given users group memberships from Active Directory
A while back, I showed you how to export a list of all members of a group, as well as all computers, from Active Directory. On a related note, here’s how to export all group memberships held by a single user: (more…)