Skip to content

O365 - Does not track "problem accounts" #7

@crossan007

Description

@crossan007

ForEach($User in $Users)
{
#Get the AD Object based on UPN, which MSonline
$x = Get-ADUser -Filter {UserPrincipalName -eq $User.UserPrincipalName}
#Determine if the account lives in a student OU, otherwise it's staff
If($x.DistinguishedName -ilike $StudentOU)
{
$Students += $x.UserPrincipalName
}
Else
{
if($x) #If there is an object
{
$Faculty += $x.UserPrincipalName
}
else
{
$ProblemAccounts += $User
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions