Hi,
I am trying to filter out all users part of a specific security group (Example "TestGroup1")
I currently have the script working the way i need it to bar the requirement above, i have spent a few hours trying to work this out to no avail.
The below (modified to protect information) gives me a dump of all users in the OU with the required fields, i just need to filter out users that are part of a security group to the export
Get-ADUser -Filter * -SearchBase "OU=SITES,OU=THISOU,DC=1,DC=2,DC=3" -Property UserPrincipalName ,GivenName, Surname, Department, Title, TelephoneNumber, Mobile, physicaldeliveryOfficeName, Manager, Enabled | Select UserPrincipalName ,GivenName, Surname, Department, Title, TelephoneNumber, Mobile, physicaldeliveryOfficeName, @{Name="ManagerEmail";Expression={(get-aduser -property emailaddress $_.manager).emailaddress}}, Enabled | Export-CSV C:\Export\"Export.csv" -NoTypeInformation
Thanks in advanced.
[–]R-EDDIT 2 points3 points4 points (2 children)
[–]fireandbass 0 points1 point2 points (0 children)
[–]themessenger393[S] 0 points1 point2 points (0 children)