header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Need help using get-qaduser...
Last Post 11 Aug 2010 11:36 AM by MaryK. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
MaryKUser is Offline
Basic Member
Basic Member
Posts:104
Avatar

--
11 Aug 2010 11:36 AM
    Hi

    I have the below script that works fine giving me what I need. However, I would like to add attributes like EmplyeeID, office, samAccountName we have in AD to the columns. However, the script returns every user, not only the ones with "$_.LastSuccesssync -ne $null". And also, if a user has two devices, the some of the information like lastsync time is blank.

    $ExServers = Get-ExchangeServer servername
    $Mbx = $ExServers | get-mailbox | where {$_.Name -notlike '*CAS_*'}
    $Mbx | ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity} | where-object {$_.LastSuccesssync -ne $null} | Select-Object DeviceType,@{Name="FirstSyncTime";expression={$_.FirstSyncTime}},DeviceID | export-csv -NoTypeInformation c:\export\export.csv

    What I tried:

    $ExServers = Get-ExchangeServer servername
    $Mbx = $ExServers | get-mailbox | where {$_.Name -notlike '*CAS_*'}
    $Mbx | ForEach { Get-ActiveSyncDeviceStatistics -Mailbox:$_.identity | where-object {$_.LastSuccesssync -ne $null} ; get-qaduser $_.name -includedproperties EmployeeID} | Select Samaccountname,DeviceType,@{Name="LastSuccesssync";expression={$_.LastSuccesssync}},@{Name="FirstSyncTime";expression={$_.FirstSyncTime}},DeviceID,employeeID,office | export-csv -NoTypeInformation c:\export\export.csv
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer