Tell me more
Hello, I often have a list of users or DGs and I would like to know if I could from an imcomplete list get further information. (EXCH 2007) Please refer the below example: 1) Here is the information I have when I do a get-mailbox on the users: Firstname; lastname; Displayname; SamAccountName User1 ; name1; user1 name1; UN1 User2 ; name2; user2 name2; UN2 User3 ; name3; user3 name3; UN3 2)Here is the list that I receive: user1 name1 UN2 name3 I would like to know how I could get full information (point 1)) based on the information porvided in the point 2) I hope I am clear enought, if not, please do not hesitate to ask me further information, G
February 10th, 2010 12:16pm

Get-mailbox will accept both display name and samaccountname as the identity parameter. If an identity parameter contains embedded spaces, it must be quoted.get-mailbox UN2get-mailbox "user1 name1"For finding mailbox with other criteria:get-mailbox | where-object {$_.firstname -eq "name3"}using the ? alias for where-objectget-mailbox |? {$_.firstname -eq "name3"}get-mailbox will also return multiple results on ambiguous matches, so you'll need to test for that if you use it in a script.
Free Windows Admin Tool Kit Click here and download it now
February 10th, 2010 3:03pm

In fact I often receive list of Users with sometime only lastname or only the SamAccountName or both etc.. When I receive a user.txt file like this one: user1 name1 UN2 name3 I would like through a shell command getting full details based on the user.txt file. To obtain a list like the below one: Firstname; lastname; Displayname; SamAccountName User1 ; name1; user1 name1; UN1 User2 ; name2; user2 name2; UN2 User3 ; name3; user3 name3; UN3 Would that be possible?
February 10th, 2010 3:19pm

If you're asking how to get the output for just those fields: get-mailbox <identity> | select firstname,lastname,displayname,samaccountname If your AD is small, and there's little or no chance of ambibuous resolutions gc list.txt |% get-mailbox |? {$_.name -like "*$_*"} | select firstname,lastname,displayname,samaccountname might work for you.
Free Windows Admin Tool Kit Click here and download it now
February 10th, 2010 3:31pm

Thanks Mjolinor, I am not trying to get the output but I would like to get --> Firstname; lastname; Displayname; SamAccountName From a list of users where I only have the Lastname or displayname or SamAccountName. There are shell commands that only work with the SamAccountName and when I get a request from a client, I get bunch of users in a txt file without the full users details and then I need to add those user to a DG for instance.. I could get the full users detail by typing get-mailbox -identity UN1 | fl But I would like be able to run that command from a txt file eventhough I only have the user's lastname or displayname in it. Like: user1 name1 UN2 name3
February 10th, 2010 4:09pm

I don't know of a cmdlet or script that will do that reliably. I'd send the list back to the client with a request for coherent data.
Free Windows Admin Tool Kit Click here and download it now
February 10th, 2010 4:16pm

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

Other recent topics Other recent topics