-
-
Save Sulkar/422938540530b98cc7eff844b4b5fc62 to your computer and use it in GitHub Desktop.
This file contains 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
#1. Installiert das MSOnline Modul: | |
Install-Module MSOnline | |
#2. Stellt eine Verbindung mit dem MsolService her | |
Connect-MsolService | |
#3. Listet alle Nutzer des Tennants auf | |
Get-MsolUser -All | Sort DisplayName | Select DisplayName, UserPrincipalName | More | |
#4. Listet alle möglichen verfügbaren Rollen auf: | |
Get-MsolRole | Sort Name | Select Name,Description | |
#5. Liest die .CSV Datei aus und fügt jedem dort aufgeführten Benutzer die entsprechende | |
# Rolle zu: | |
$fileName="C:\Users\Administrator\Desktop\BenutzerAdminRollehinzufügen.CSV" | |
$roleChanges=Import-Csv $fileName | ForEach { Add-MsolRoleMember -RoleMemberEmailAddress ` | |
$_.UserPrincipalName -RoleName $_.RoleName } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Link zur ausführlichen Dokumenation von Microsoft:
https://docs.microsoft.com/de-de/office365/enterprise/powershell/assign-roles-to-user-accounts-with-office-365-powershell