Hi everyone,
I have this script, that collects data from each user:
Get-ADUser -Filter * -Properties Name,memberof, SamAccountName,Displayname,UserPrincipalName,Description,ObjectClass,ObjectGUID,passwordlastset,passwordneverexpires,LastLogonDate,DistinguishedName,Enabled,whenCreated,SID,badpwdcount,msDS-UserPasswordExpiryTimeComputed | Select-Object -Property Name,@{ l="GroupMembership"; e={$_.memberof -join ";" } },SamAccountName,Displayname,UserPrincipalName,Description,ObjectClass,ObjectGUID,passwordlastset,passwordneverexpires,LastLogonDate,DistinguishedName,Enabled,whenCreated,SID,badpwdcount,@{Name="PasswordExpirationDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}| Sort-Object -Property Name| Export-csv -path "c:\temp\extract.csv" -NoType
this gives me each group membership in the same field, separated by a comma. is there any way i can print one line with user data per group membership?
i tried using the ´-d delimiter to print out a new line (at least in excel) but without any luck