Create local AD User, assign O365 licenses, groups and shared mailboxes

 This script create automatically a AD user, define the Username, assign group members copied from a user, sync to Office 365, assign licences, automatically assign Shared Mailboxes, Distribution lists, Office 365 Groups.  If you want to add anything or give me feedback please do

Add to favorites
Active Directory
E-mail Twitter Digg Facebook
  • Good script, I added some functionality for creating the Home Folder
    1 Posts | Last post June 07, 2018
    • $Fileserver = "WWTS02"
      $FSLocalPath = "C:\HomeFolders"
          ### Setup Home Folder ###
      $SetupFolder = "$FSLocalPath\$Username"
      Invoke-Command -ComputerName "$FileServer" -argumentlist $SetupFolder, $Username -ScriptBlock { 
          Write-Host "Creating Home Folder: "($args[0])" : "($args[1])
          New-Item -Path ($args[0]) -type directory -Force
          $Acl = Get-Acl ($args[0])
          $rights = [System.Security.AccessControl.FileSystemRights]::FullControl
          $inheritance = [int]([System.Security.AccessControl.InheritanceFlags]::ContainerInherit) + [int]([System.Security.AccessControl.InheritanceFlags]::ObjectInherit)
          $propagation = [System.Security.AccessControl.PropagationFlags]::None
          $accessControl = [System.Security.AccessControl.AccessControlType]::Allow
          $Ar = New-Object System.Security.AccessControl.FileSystemAccessRule(($args[1]), $rights, $inheritance, $propagation , $accessControl)
          Set-Acl ($args[0]) $Acl 
          Write-Host "Home Folder creation complete"