This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foreach($user in $csvimport) | |
| { | |
| $mail = $user.$eMailField | |
| $surname = $user.$surnameField | |
| $givenname = $user.$givennameField | |
| try{ | |
| $user = Get-AzureADUser -ObjectID $mail | |
| Add-RoleGroupMember $EXORole -Member $mail | |
| Write-Host "User added;"$mail";"$surname";"$givenname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Stop-Transcript | |
| Disconnect-ExchangeOnline | |
| Disconnect-AzureAD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create logfile | |
| $date = Get-Date -Format FileDateTime | |
| $logFile = $log + "roles_added_" + $date + ".txt" | |
| Start-Transcript -Path $logFile | |
| Read-Host "Press Enter to continue..." | |
| # import csv | |
| $csvimport = Import-Csv -Path $csvinputfile -Delimiter $delimiter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Connect to Exchange Online | |
| $Credentials = Get-Credential | |
| Connect-ExchangeOnline -Credential $Credentials | |
| #Connect to AzureAD | |
| Connect-AzureAD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| givenname | surname | ||
|---|---|---|---|
| Test | User | tu@sprocks.io |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Config> | |
| <EXORole>Help Desk</EXORole> | |
| <log>config\</log> | |
| <csvinput>csvinput\csv1.csv</csvinput> | |
| <delimiter>,</delimiter> | |
| <eMailField>E-Mail</eMailField> | |
| <givenname>Givenname</givenname> | |
| <surname>Surname</surname> | |
| </Config> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Write-Host "-------------------------------------------------" -ForeGroundColor Yellow | |
| Write-Host "Loading config settings xml..." -ForeGroundColor Yellow | |
| # Path to config File | |
| $configFile = "config\config.xml" | |
| # Test if config file does exist | |
| if((Test-Path $configFile) -eq $false) | |
| { | |
| Write-host "Config XML not found" | |
| #exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### | |
| # Danny Davis | |
| # twitter: twitter.com/pko3 | |
| # github: github.com/pkothree | |
| # Created: 01/27/21 | |
| # Modified: 01/27/21 | |
| # Description: add Users to a Exchange Online Role | |
| ### | |
| Write-Host "-------------------------------------------------" -ForeGroundColor Yellow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Set-Mailbox -Identity "E-Mail-Address" -IssueWarningQuota 10gb -ProhibitSendQuota 11gb -ProhibitSendReceiveQuota 12gb -UseDatabaseQuotaDefaults $false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Set-OwaMailboxPolicy OwaMailboxPolicy-Default -SetPhotoEnabled $false |
NewerOlder