Import-csv and contact information
I need a script to obtain mail contacts' name, display name and alias from a list of users.Unfortunately, my script returns all mail contact's names, display names and aliases. Any help would be appreciated.[PS] C:\admin>get-content c:\admin\alias.csv |foreach-object {get-mailcontact |fl name,displayname,alias}
February 13th, 2010 3:02am

It depends on how the csv is setup. If you had all the users email address under the header emailaddress in the csv, you would do this:import-csv c:\admin\alias.csv | foreach-object {get-mailcontact -identity $_.emailaddress | fl name, displayname, alias}You can pass the following values to the identity parameter: ADObjectID, distinguished name, LegacyExchangeDN, GUID, Domain\SamAccountName, user principal name (UPN), e-mail address, or alias.
Free Windows Admin Tool Kit Click here and download it now
February 13th, 2010 5:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics