diff --git a/PowerShell/Working/o365/GetMSOnlineUserReport.ps1 b/PowerShell/Working/o365/GetMSOnlineUserReport.ps1 index c7a0eff..25c4ebb 100644 --- a/PowerShell/Working/o365/GetMSOnlineUserReport.ps1 +++ b/PowerShell/Working/o365/GetMSOnlineUserReport.ps1 @@ -979,7 +979,7 @@ Function GetActiveSyncDeviceStatistics [String]$PrimarySmtpAddress ) - $activeSyncDeviceStatistics = Get-ActiveSyncDeviceStatistics -Mailbox $PrimarySmtpAddress + $activeSyncDeviceStatistics = Get-MobileDeviceStatistics -Mailbox $PrimarySmtpAddress Return $activeSyncDeviceStatistics } @@ -998,7 +998,7 @@ Function GetActiveSyncDeviceStatisticsResultsProperty .PARAMETER ActiveSyncDeviceStatisticsResults Specifies an object representing the results returned by - the cmdlet named Get-ActiveSyncDeviceStatistics. + the cmdlet named Get-MobileDeviceStatistics. .PARAMETER PropertyToReturn Specifies the property name whose value should be returned. @@ -1098,15 +1098,15 @@ $Error.Clear() $ScriptStartTime = Get-Date # verify that the MSOnline module is installed and import into current powershell session -If (!([System.IO.File]::Exists(("{0}\modules\msonline\Microsoft.Online.Administration.Automation.PSModule.dll" -f $pshome)))) -{ - WriteConsoleMessage -Message ("Please download and install the Microsoft Online Services Module.") -MessageType "Error" - Exit -} + $getModuleResults = Get-Module If (!$getModuleResults) {Import-Module MSOnline -ErrorAction SilentlyContinue} Else {$getModuleResults | ForEach-Object {If (!($_.Name -eq "MSOnline")){Import-Module MSOnline -ErrorAction SilentlyContinue}}} +$getModuleResults = Get-Module +If (!$getModuleResults) {Import-Module AzureRM -ErrorAction SilentlyContinue} +Else {$getModuleResults | ForEach-Object {If (!($_.Name -eq "AzureRM")){Import-Module AzureRM -ErrorAction SilentlyContinue}}} + # verify output directory exists for results file WriteConsoleMessage -Message ("Verifying folder: {0}" -f $OutputFile) -MessageType "Verbose" If (!(TestFolderExists $OutputFile)) @@ -1280,4 +1280,4 @@ WriteConsoleMessage -Message ("Output File : {0}" -f $OutputFile) -Messa # # End of Script. # -# ----------------------------------------------------------------------------- \ No newline at end of file +# -----------------------------------------------------------------------------