Below is the syntax I am using to run a script that includes all the groups, group description and group category for any one user. What I am missing is a simple "ADUser -Properties | Select Name (type of out-put near the top of the report, a field that includes the User Name, or logon, or SAMAccount name. Right now, without that header the syntax runs great, queries from fairly large databases, but when I add that additional pipe, it really bogs it down. Any help would be great...
ps. I am fairly new to PS, running version 4.0
Thanks
-R
<#
.DESCRIPTION
This script grabs the specified
user's group membership from
Active Directory
#
import-module activedirectory
$username = Read-Host 'Please enter Username'
Get-ADPrincipalGroupMembership $username | Get-ADGroup -Properties * | select name, description, GroupCategory `
| Export-Csv "C:\