Recently a friend of mine was doing a deployment of Office 365 in a hybrid environment with Exchange 2013.
There was a CSV file with the required fields, and he asked me to help him create a script to create the users.
I did him one better, and also enabled the mailboxes on 365 for him.
$Users = Import-Csv -Path "C:\Users.csv"
$OU = read.host "What OU would you like the users created in?"
$domain = read.host "What is your domain?"
$Password = read.host "What password would you like to set all accounts to?"
foreach ($User in $Users)
{
$Displayname = $User.Firstname + " " + $User.Lastname
$UserFirstname = $User.Firstname
$UserLastname = $User.Lastname
$SAM = $User.Username
$UPN = $User.Firstname + "." + $User.Lastname + "@" + $domain
$Mobile = $User.Mobile
$Home = $User.PersonalEmail
New-ADUser -Name "$Displayname" -DisplayName "$Displayname" -SamAccountName $SAM -UserPrincipalName $UPN -GivenName "$UserFirstname" -Surname "$UserLastname" -AccountPassword (ConvertTo-SecureString $Password -AsPlainText -Force) -Enabled $true -Path "$OU" -ChangePasswordAtLogon $false –PasswordNeverExpires $true -MobilePhone $Mobile -HomePhone $Home
$RemoteRouting = "smtp:" + $UPN
Enabled-RemoteMailbox $SAM -RemoteRoutingAddress $RemoteRouting
}
A quick run through.
The script will prompt the OU path where you want to create the users, the domain and the password you want to use.
It then creates the account, with the fields populated by the CSV file.
Those fields are Firstname, Lastname, Username, Mobile, PersonalEmail
Once the account is created, it will then create the mailbox on 365.
All that's left to do is assign the licenses.
Quick sidenote: while running through the script in the lab worked well without problem, in production we could not run the script more than once without requiring a restart of EMS.
Great Article
ReplyDeleteIEEE Projects on Information Security
Project Centers in Chennai
JavaScript Training in Chennai
JavaScript Training in Chennai
This comment has been removed by the author.
ReplyDeleteA week ago, I had nothing to do and went to this site wholesome free online casino games and decided to take a risk. We only live once to play in a casino. And did not regret
ReplyDeletewww.escortsmate.com
ReplyDeleteescortsmate.com
https://www.escortsmate.com
tiktok jeton hilesi
ReplyDeletetiktok jeton hilesi
referans kimliği nedir
gate güvenilir mi
tiktok jeton hilesi
paribu
btcturk
bitcoin nasıl alınır
yurtdışı kargo
İnstagram takipçi satın al! İnstagram takipçi sitesi ile takipçi satın al sende sosyal medyada fenomen olmaya bir adım at. Sende hemen instagram takipçi satın almak istiyorsan tıkla:
ReplyDelete1- takipçi satın al
2- takipçi satın al
3- takipçi satın al
seo fiyatları
ReplyDeletesaç ekimi
dedektör
instagram takipçi satın al
ankara evden eve nakliyat
fantezi iç giyim
sosyal medya yönetimi
mobil ödeme bozdurma
kripto para nasıl alınır
instagram beğeni satın al
ReplyDeleteyurtdışı kargo
seo fiyatları
saç ekimi
dedektör
fantazi iç giyim
sosyal medya yönetimi
farmasi üyelik
mobil ödeme bozdurma
bitcoin nasıl alınır
ReplyDeletetiktok jeton hilesi
youtube abone satın al
gate io güvenilir mi
referans kimliği nedir
tiktok takipçi satın al
bitcoin nasıl alınır
mobil ödeme bozdurma
mobil ödeme bozdurma
SMM PANEL
ReplyDeletesmm panel
iş ilanları
İnstagram Takipçi Satın Al
hırdavatçı
WWW.BEYAZESYATEKNİKSERVİSİ.COM.TR
Servis
tiktok hile
kadıköy mitsubishi klima servisi
ReplyDeletekartal vestel klima servisi
ümraniye vestel klima servisi
beykoz daikin klima servisi
üsküdar daikin klima servisi
kadıköy daikin klima servisi
kartal toshiba klima servisi
ümraniye toshiba klima servisi
kartal beko klima servisi