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?