windows:scripts:ps:bal-sharedtolicense
convertir Bal Partagée en Bal avec License
# Script pour créer un compte sous Office365 # Pre-requis: connexion à Office365 et Exchange faites Write-Host "Pre-requis: connexion à Office365 fait" -ForegroundColor Yellow #Write-Host "Avant, vous devez ajouter une licence avec l'interface de gestion d'Office365." Write-Host "Vous devez définir un mot de passe et mettre à jour la procédure Plateforme Office365" $Login = read-host "Compte ex. srvSociétéService" $Domaine = read-host "Domaine avant l'ajout par defaut domaine.onmicrosoft.com" if ($Domaine -eq '') { $Domaine = "domaine.onmicrosoft.com"} $SMTP = read-host "Alias SMTP ex. pnom@domaine.fr" $Societe = read-host "Société BAL" $Mdp = read-host "Mot de passe 8 caractères" $Compte = $Login + "@" + $Domaine $NewCompte = $Login + "@domaine.com" $Choix = read-host "Voulez-vous modifier la BAL de service" $Compte "pour ajouter une licence? O pour Oui" if ($Choix -eq 'O') { # ajout licence Set-MsolUser -UserPrincipalName $Compte -UsageLocation FR -Department $Societe Start-Sleep -Milliseconds 100 Set-MsolUserLicense -UserPrincipalName $Compte -AddLicenses "domaine:EXCHANGESTANDARD" Start-Sleep -Milliseconds 100 # modif mdp Set-MsolUserPassword -UserPrincipalName $Compte -NewPassword $Mdp -ForceChangePassword $false Start-Sleep -Milliseconds 100 # change le login Set-MsolUserPrincipalName -NewUserPrincipalName $NewCompte -UserPrincipalName $Compte Start-Sleep -Milliseconds 80000 # modif compte Set-Mailbox $Login -Type Regular Start-Sleep -Milliseconds 100 Set-Mailbox $Login -ProhibitSendReceiveQuota 50GB -ProhibitSendQuota 49.5GB -IssueWarningQuota 49GB Set-User -Identity $Login -Company $Societe set-msoluser -UserPrincipalName $Compte -Department $Societe # Modifie le SMTP Set-Mailbox $Login -WindowsEmailAddress $SMTP # Désactive le POP Set-CASMailbox -Identity $Login -PopEnabled $False }
— sylvain 2019/06/03 22:24
windows/scripts/ps/bal-sharedtolicense.txt · Dernière modification : de 127.0.0.1
