Retrieving Mobile Devices

In order to retrieve Mobile Device objects, the cmdlet Get-EmdbMobileDevice is used.


Examples:


Hint: The execution of these examples requires a connected PowerShell drive.


The following example retrieves all Mobile Devices from the context "emdb:\rootDSE\Managed Mobile Devices" and below:


Get-EmdbMobileDevice "emdb:\rootDSE\Managed Mobile Devices\*" -Recurse


This snippet retrieves the Mobile Device object "Android_HTC_01" from the context "emdb:\rootDSE\Managed Mobile Devices\HTC":


$MyMobileDevice = Get-EmdbMobileDevice "emdb:\rootDSE\Managed Mobile Devices\HTC\Android_HTC_01"


The code below retrieves the Mobile Device "IOS_IPHONE_05" from the current context:


Cd "emdb:\rootDSE\Managed Mobile Devices\Apple"

Get-EmdbMobileDevice "IOS_IPHONE_05"


Retrieve the Mobile Device object "HTC One M9" in the current context through its Item-ID (this ID will vary in different DSM environments):


Get-EmdbMobileDevice -ItemID 4712 -Recurse


Tip: the alias ID can be used instead of ItemID.


Note: The functionality described here is available for FrontRange DSM 7.1 and above only.


Starting with PSX 3.1 there was a new option implemented when retrieving Mobile Device objects. When specifying the SingleItemExpected-switch it is expected, that none or exactly one object is contained in the result. If the retrieval returns more than one object, an error is raised that can be caught and handled in scripts.