ODMAPI

Hello,

Im just getting started with ODMAPI. Im able to connect and select a project.

Id like to download the accounts associated in a particular collection.

I addition, id like to download the status of Mailboxes, OneDrive, and Desktop agents with all of the fields for a particular collection.

Can anyone show me an example of a script that would do that?

Thank you!

Steve

  • Hi Steve, take a look at the example scripts on the following post -  Example PowerShell Scripts 

    I think the one in section "Monitor Tasks - Return status and details for In Progress tasks" should get you on the right track.

  • Hi Steve,

    Objects from collection (use latest public release 2.1.199):
    $CollectionName = "Example"
    $Objects = Get-OdmCollection -WildcardFilter @{name = $CollectionName } | Get-OdmObject -All -IncludeAllProperties -IncludeCollections
    This will contains ACC/MBX/OD/DUA info.

    At Get-OdmObject watch for -TypeOfTeam (Chats, Teams, Groups), need to use only when downloading Teams project objects.
    Another thing is for Public Folders need to use Get-OdmPfPublicFolder command instead of Get-OdmObject.
    Don't forget add -All, otherwise get the first 1000 result only.

  • Jozsef,

    thank you so much for the response.

    This will help me a lot. I had looked at many of the online examples but, couldnt quite figure it out.

    Thank you!

    Steve

  • Jozsef,

    the Get-odmcollection you documented is working great.

    I have found to get a similar report as the mailbox console, I can run this:

    $mailboxes = $Objects | select displayname,@{N="Mailbox State";e={$_.mailboxstatus}},@{n="Source Email";e={$_.sourceemail}},@{n="Target Email";e={$_.targetemail}},@{N="Mail Flow";e={$_.switchdirection}},mailboxitemscount,@{N="size GB";e={[Math]::Round($_.mailboxsize/1GB,2)}},@{n="Items to Migrate";e={"{0:N0}" -f $_.mailmigrationestimated}},@{n="processed";e={"{0:N0}" -f $_.mailmigrationprocessed}},mailmigrationerrors |

    And for Onedrive

    $onedrive = $Objects | select -First 2 | select displayname,OneDriveMigrationState,OnedriveTaskPriority,@{N="Items Migrated %";e={$_.onedriveMigrationprogress}},@{n="Source Items";e={"{0:N0}" -f $_.onedrivesourceitemcount}},@{N="Source Size";e={[Math]::Round($_.OneDriveSourceTotalSize/1mb,2)}},OneDriveLastSuccessfulRun,Onedrivesourcelastmodified,OnedriveTargetitemcount,sourceuserprincipalname,targetuserprincipalname |FT

    But, I cant find attributes for the Desktop agent panel where it shows

    name, SourceUPN, Officeactivation, mailboxstate, Outlookapp, onedrivestate, Onedriveapp

    User  user@mycorp.com waiting switched waiting  migrated waiting

    Any idea how I can get the officeactivation, outlookapp, Onedrive app fields?

    Thanks!

    Steve

  • Hi Steve,

    I use ODMAPI.Support module and that returns DuaOfficeActivationStatus DuaOutlookAppStatus DuaOneDriveAppStatus DuaTeamsStatus values. Just tested with ODMAPI (end-user module, this what you use) and the above values are missing. I report it to our production team as both module should return the same values. Keep you posted here.

  • Hi Steve,

    Just a quick update:

    If I run a get-odmobject like this:

    ------------------------
    $ConnectionParam = "import-module C:\temp\odmapi\ODMApi.Support\2.1.214\ODMApi.Support.psd1"
    $ConnectionParam += "`n"
    $ConnectionParam += "get-module ODMApi.Support"
    $ConnectionParam += "`n"
    $ConnectionParam += "Connect-OdmService EU"
    $ConnectionParam += "`n"
    $ConnectionParam += "Select-OdmOrganization ee8b3eb6-79e3-648d-1b57-4fef624b75c5"
    $ConnectionParam += "`n"
    $ConnectionParam += "Get-OdmProject mOINXJUB5FWjm-513jF8 | Get-OdmProjectWorkload -Type Accounts | Select-OdmProjectWorkload"
    $ConnectionParam += "`n"
    $ConnectionParam += 'get-OdmObject -Name "Jozsef Budahazy"'
    $ObjectsOfTaskJob = [scriptblock]::Create($ConnectionParam)
    $Job1 = start-job -Name "test" -ScriptBlock @ObjectsOfTaskJob
    get-job
    Receive-Job -Job $job1 -Keep
    -------------------------------

    I receive DUA values, but when I run the same commands on a "normal" way:

    ---------------------
    import-module C:\temp\odmapi\ODMApi.Support\2.1.214\ODMApi.Support.psd1
    get-module ODMApi.Support
    Connect-OdmService EU
    Select-OdmOrganization ee8b3eb6-79e3-648d-1b57-4fef624b75c5
    Get-OdmProject mOINXJUB5FWjm-513jF8 | Get-OdmProjectWorkload -Type Accounts | Select-OdmProjectWorkload
    get-OdmObject -Name "Jozsef Budahazy"
    --------------------------

    DUA values are missing.

    Those values are hidden in the module, normally not printed out. For some reason the script is returns hidden fields also.

    I assume, if you remove the hidden before the values in the corresponding .ps1 file will returns those values for you on the normal way too. I do not suggest it as it's out of support.

  • Hi Jozsef!

    I appreciate you putting more effort into this! 

    What are the odds that the developers will release an update that will show the hidden values soon?

    I know its not supported but, how do I remove the Hidden before the values?

    Is 2.1.199 the latest end user version?

    I modified the parameters of your script to match my odmorganization and project, and object name

    I get a correct value for "Get-odmprojectworkload -type accounts " but, nothing is returned for "select-odmprojectworkload and nothing seems to be returned in Job1. Not sure what Im doing wrong.. Ill have to keep working on it.

    Thank you very much for all the effort and replies.

    Steve