Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial attempt at replacing MSOL module references with cmdlets from newer AzureAD module #49

Merged
merged 3 commits into from Jan 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions Modules/Office365DSC/Modules/Office365DSCUtil.psm1
Expand Up @@ -26,8 +26,8 @@ function Test-O365ServiceConnection
[System.Management.Automation.PSCredential]
$GlobalAdminAccount
)
Write-Verbose "Verifying the LCM connection state to Microsoft Online Services"
Connect-MSOLService -Credential $GlobalAdminAccount
Write-Verbose "Verifying the LCM connection state to Microsoft Azure Active Directory Services"
Connect-AzureAD -Credential $GlobalAdminAccount
}

function Invoke-ExoCommand
Expand Down Expand Up @@ -317,7 +317,7 @@ function Get-UsersLicences
Test-O365ServiceConnection -GlobalAdminAccount $GlobalAdminAccount
Write-Verbose "Store all users licences information in Global Variable for futur usage."
#Store information to be able to check later if the users is correctly licences for features.
if ($Global:UsersLicences -eq $NULL)
if ($null -eq $Global:UsersLicences)
{
$Global:UsersLicences = Get-MsolUser -All | Select-Object UserPrincipalName, isLicensed, Licenses
}
Expand Down Expand Up @@ -397,7 +397,7 @@ function Export-O365Configuration

# Security Groups
Test-O365ServiceConnection -GlobalAdminAccount $GlobalAdminAccount
$securityGroups = Get-MSOLGroup | Where-Object {$_.GroupType -eq "Security"}
$securityGroups = Get-AzureAdGroup | Where-Object {$_.SecurityEnabled -eq $true}

foreach ($securityGroup in $securityGroups)
{
Expand All @@ -410,7 +410,7 @@ function Export-O365Configuration
}
}

$securityGroups = Get-MSOLGroup | Where-Object {$_.GroupType -eq "Security"}
$securityGroups = Get-AzureAdGroup | Where-Object {$_.SecurityEnabled -eq $true}

# Other Groups
$groups = Invoke-ExoCommand -GlobalAdminAccount $GlobalAdminAccount `
Expand Down Expand Up @@ -450,7 +450,7 @@ function Export-O365Configuration
Import-Module $O365UserModulePath
Test-O365ServiceConnection -GlobalAdminAccount $GlobalAdminAccount

$users = Get-MSOLUser
$users = Get-AzureADUser

foreach ($user in $users)
{
Expand Down