Michael Leonard
asked on
need assistance with this powershell script
can someone help me with this script, this is what i have so far, but its not working, getting a blank CSV:
the goal is to export out the values of the "targetAddress" attribute for all users that match company: XYZ
the goal is to export out the values of the "targetAddress" attribute for all users that match company: XYZ
Get-ADUser -Filter {Company -eq "XYZ"} -Properties targetaddress | Select-Object Name, targetaddress | Sort-Object Name | Export-Csv -NoTypeInformation c:\temp\taexport.csv
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks we will test again this morning with the wildcard option.
ASKER
thanks for the help, we retested with the wildcard option and that worked!
break it down into its parts to work out where the issue is
i.e.
Get-ADUser -Filter {Company -eq "XYZ"} do you get anything back for that? if not, your filter is wrong
if you do get the correct info back, move on to
Get-ADUser -Filter {Company -eq "XYZ"} -Properties targetaddress | Select-Object Name, targetaddress | Sort-Object Name