I wrote this small script to pull the office property from get-user by piping the exchange mailbox object.
$server = "tms08"
$arrUser = get-mailbox -Server $server |Get-MailboxStatistics |select identity
foreach ( $id in $arrUuser)
{
$office = get-user -Identity $id.Identity |select office
$out += $id.Identity
}
$out
I don't get any output or red errors. just the warning:
WARNING:There is no data to return for the specifed mailbox 'Globe/MobileElect Usertemplate', because it has not been logged on to. WARNING:By default only the first 1000 items are returned. To change the number of items returned, specify the parameter "-ResultSize". To return all items specify "-ResultSize Unilimited" (Note: REturning all items maytake a long time and consume a large amount of memory depending on the actual number of items). It is not recommended to store the results in a variable; instead pipe the results to another task or script to perform batch changes.
Any ideas on what might be causing this?
My goal is to develop a script which executes once a day via scheduled task which compiles all mailbox names, mailbox sizes, totalitems, totaldeleted items, along with their office and description fields (from active directory).
I'm guessing the get-qaduser is part of the quest powershell addon. I'll install it locally and give it a try..
the identiy property seems to give a number similar to the guid which looks like 1234as01-4f54-1234-b1df-f1df1df12d2d
I tried running
get-user -identity 1234as01-4f54-1234-b1df-f1df1df12d2d
and it found a name (joey blasio) and recipient type (usermailbox)
then i ran
get-user -Identity 1234as01-4f54-1234-b1df-f1df1df12d2d | select displayname, distinguistedname
Displayname (Joey Blasio ) and DistinguishedName (CN=Joey Blasio,OU=EWE,DC=BLA-1,DC=net)