Monday, September 3, 2018

Microsoft Exchange Server အတြက္အသံုးဝင္ေသာ Command line မ်ား အပိုင္း ၁

Microsoft Exchange Server ကို install လုပ္တာျပီးဆံုးသြားျပီဆိုရင္ေတာ့ email ပို့နိုင္ရန္အတြက္ Mail User account အသစ္ကို ဖန္းတီးပါမယ္ Power shell ကိုဖြင့္ပါ

>Get-mailboxdatabase

အထက္ပါ command က Mailbox Database Name ကိုျမင္ရပါမယ္

>New-Mailbox -UserPrincipalName nanda@loop.com -Alias nanda -Database "MailboxDatabase" -Name nanda -OrganizationalUnit "loop.com/MyOUName" -FirstName Nanda -DisplayName "Nanda" -ResetPasswordOnNextLogon $false
Password:************

အထက္ပါ command က Mailbox User account အသစ္ကိုဖန္းတီးလိုက္တဲ့ Command ပါ

AD ထဲမွာ User Account ေတြ အမ်ားျကီးဖန္းတီးလို့ရမယ့္ Command
Run box ဖြင့္ျပီး cmd ထဲဝင္ပါ

ျပီးရင္ OU အသစ္တခုကိုစဖန္းတီးပါမယ္

>dsadd ou "OU=LAOrg,DC=loop,DC=com"

အထက္ပါ Command တြင္ dsadd ou ဆိုတာက OU အသစ္ျပုလုပတဲ့ command ျဖစ္ပါတယ္
OU=LAorg က OU ကို LAOrg လို့ေပးတပါ DC=loop,DC=com ဆိုတာကေတာ့ မိမိ ADDS ရဲ့ Domain name loop.com ကိုဆိုလိုတာျဖစ္ပါတယ္

>dsadd user "CN=mailuser,OU=LAOrg,DC=loop,DC=com" -upn mailuser@loop.com -pwd YOURPASSWORD -pwdneverexpires yes -disabled no

အထက္ပါ Command သည္ ADDS Database ထဲမွာ User Account အသစ္ျပုလုပ္တာျဖစ္ပါတယ္
User Account မ်ားမ်ားဖန္းတီးမယ္ဆိုရင္ေတာ့ bat file ျပုလုပ္ပါ
Batch File ဖန္းတီးပံု ဥပမာ

Open Notepad

@echo off
dsadd user "CN=mailuser01,OU=LAOrg,DC=loop,DC=com" -upn mailuser01@loop.com -pwd YOURPASSWORD -pwdneverexpires yes -disabled no
dsadd user "CN=mailuser02,OU=LAOrg,DC=loop,DC=com" -upn mailuser02@loop.com -pwd YOURPASSWORD -pwdneverexpires yes -disabled no
dsadd user "CN=mailuser03,OU=LAOrg,DC=loop,DC=com" -upn mailuser03@loop.com -pwd YOURPASSWORD -pwdneverexpires yes -disabled no
dsadd user "CN=mailuser04,OU=LAOrg,DC=loop,DC=com" -upn mailuser04@loop.com -pwd YOURPASSWORD -pwdneverexpires yes -disabled no
dsadd user "CN=mailuser05,OU=LAOrg,DC=loop,DC=com" -upn mailuser05@loop.com -pwd YOURPASSWORD -pwdneverexpires yes -disabled no
dsadd user "CN=mailuser06,OU=LAOrg,DC=loop,DC=com" -upn mailuser06@loop.com -pwd YOURPASSWORD -pwdneverexpires yes -disabled no

 ျပီးရင္ Save As နဲ့သိမ္းျပီး text file ကို .bat ျဖစ္ဖို့ Extenstion ေျပာင္းပါမယ္
ေျပာင္းျပီးသြားျပီဆိုရင္ေတာ့ Double click ကိုနိုပ္ျပီး Batch File ကို Run လိုက္ရင္ ADDS ထဲမွာ User Account ေတြဖန္းတီးျပီးသြားပါျပီ

အခုထန္းတီးထားတဲ့ User Account ေတြကို Mail ပို့လို့ရေအာင္ Exchange Server ရဲ့ Powershell ထဲမွာ

>Get-User -organizationunit LAOrg | where-object{$_.RecipientType -eq "User"} | Enable-Mailbox -database "DatabaseName"

ကိုရုိက္မယ္ဆိုရင္ Mail ပို့လို့ရမယ့္ Mailbox Enabled User မ်ားကိုရပါျပီ




No comments:

Post a Comment