Вы находитесь на странице: 1из 27

POWERSH

NO FUNCTION POWERSHELL
$Session = New-PSSession -C
https://ps.outlook.com/po
Connect Windows PowerShell Windows PowerShell
1
to Office 365 Set

Connect MSOL Powershell to


2 Office 365 MSOL PowerShell
Configure Send As
3 Windows PowerShell Add-RecipientPermissio
permissions
List users who have Send As
4 Windows PowerShell
permissions Get-R
Configure Send On Behalf Of
5 Windows PowerShell Set-Mailbox -Identity <M
permissions
Verify Send On Behalf Of
6 Windows PowerShell Get-Mailbox -Identity
permissions
7 Configure email forwarding Windows PowerShell Set-Mailbox -Identity <Mailbo

To save a copy of the message


to the local mailbox before Set-Mailbox -Identity <Mailbo
8 Windows PowerShell
the message is forwarded to -Deli
another SMTP address
Verify E-mail Forwarding on a
9 Windows PowerShell Get-Mailbox -Identity
mailbox
Grant full mailbox access Add-MailboxPermission -Iden
10 Windows PowerShell
permissons to one user FullAccess -In
Grant a user access to a room
mailbox where the
11 Windows PowerShell Add-MailboxPermission
administrator may want to
specify that user as the Owner
Veirfy User Mailbox
12 Windows PowerShell Get-MailboxPermission -Ide
permissions
Add-MailboxPermission -Iden
13 Grant Receive As access Windows PowerShell Fu
Remove Send As settings from Remove-RecipientPermission
14 Windows PowerShell
a mailbox
Remove email forwarding
15 Windows PowerShell Set-Mailbox -Identity
from a mailbox
16 Remove Send On Behalf Of Windows PowerShell Set-Mailbox -Identit
permissions
17 Set primary smtp address for a Windows PowerShell Set-Mailbox <mailbox name
mailbox
Set User Principal Name for a Set-MsolUserPrincipalNam
18 MSOL PowerShell
mailbox -NewUse
Set single user password as
19 MSOL PowerShell Set-MsolUser userprincipal
never expire
Set bulk user password as
20 MSOL PowerShell Get-MSOLUser |
never expire
21 Verify password never expire MSOL PowerShell Get-MsolUser
value
New-Mailbox -Name "Nam
22 Set up a Shared Mailbox Windows PowerShell
View all Send As permissions
Get-RecipientPermission | wh
23 you've configured in your Windows PowerShell
organization
Get all the attributes of a
24 Windows PowerShell G
given mailbox
25 Remove E-mail Forwarding Windows PowerShell Set-Mailbox Identit

26 Disable Outlook Access Windows PowerShell Set-CASma

27 Disable ActiveSync Windows PowerShell Set-CASMailbox -Identity

28 Disable OWA Windows PowerShell Set-CASMailbox

Become an owner of a Set-DistributionGroup -identi


29 Windows PowerShell
Distribution Group Bypa
Become an owner of all the
Get-DistributionGroup |
30 Distribution Groups in your Windows PowerShell Bypa
domain
View the protocols enabled
31 for client connections for all Windows PowerShell G
one or all mailboxes
How to check the last logon
Get-Mailbox -ResultSize Un
32 time for all the users in the Windows PowerShell LastLogonTime | export-c
domain
Get licensing information for Get-msoluser | Select Disp
33 MSOL PowerShell
all the users in the domain c:\Folde

How to find all distribution


Get-DistributionGroup | wh
34 groups that is associated with Windows PowerShell
specific domain
How to find all mailboxes that
Get-Mailbox | where {$_.E
35 is associated with specific Windows PowerShell Re
domain
To add Member into Add-DistributionGroupMe
36 Windows PowerShell
distribution group
Grant Read Permissions to a Add-MailboxPermission -Id
37 Windows PowerShell given> -User <mailbox to wh
user mailbox
To verify the Provisioning
38 Status in all Office 365 MSOL PowerShell Get-Mso
38 Status in all Office 365 MSOL PowerShell Get-Mso
services (EXO/SPO/LYO/APPS)
Assign permissions to one Get-Mailbox -ResultSize unl
39 user to have full access on all Windows PowerShell -and (Alias -ne '<Mailbox ID
the mailboxes -AccessRights fullaccess
Assign Full access permission Get-Mailbox | where-Object
40 to one user to specific domain Windows PowerShell MailboxPermission -user <
in the organization
How to view Inbox Rules
41 Windows PowerShell Get-InboxRu
created in the organization

To create a new password for Set-MsolUserPassword -U


42 MSOL PowerShell
a user <password>

Enable or Disable a user's Set-MsolUser -UserPrincipal


43 MSOL PowerShell
credential in Office 365

How to get complete mobile Windows PowerShell


44 Get-ActiveSyn
device information for a user

Bulk-create external contacts Windows PowerShell Import-Csv C:\FolderName


45 -DisplayName $_.Name -Exte
in Exchange Online $_.Firs
SEM / SSEM - Establish
Connection between Office $MigrationSettings = Test-M
365 and your local Exchange Windows PowerShell Credential) -ExchangeServ
Server
New-MigrationBatch
Cutover Migration / SEM - -ExchangeConnection
Create a New Migration Batch Windows PowerShell -MaxConcurrentMigrations n

New-MigrationBatch
-ExchangeConnection
Staged Exchange Migration - Windows PowerShell -MaxConcurrentMigrations n
Create a New Migration Batch EST-CST" -CSVData:([Syste
New-MigrationBatch -I
([System.IO
46 Windows PowerShell \Desktop\BOOK4.csv"))
IMAP Migration - Create a migrations -RemoteServer <f
New Migration Batch
Start an existing Migration Windows PowerShell Start-Migratio
Batch
List details for an existing Get-MigrationBatch -identi
Windows PowerShell
Migration Batch
Complete an existing Windows PowerShell Complete-Mig
Migration Batch
Test the availablity of the Test-MigrationServerAvailabi
Windows PowerShell OR Test-MigrationServer
Migration Server exchange serv

Enable OWA to access all Set-OwaMailboxPolicy -Id


'.rpmsg','.xlsx','.xlsm','.xlsb','
47 known file types that come as Windows PowerShell xls','.wmv','.wma','.wav','.vsd
attachments g',
Enable OWA to access all Set-OwaMailboxPolicy -Id
'.rpmsg','.xlsx','.xlsm','.xlsb','
47 known file types that come as Windows PowerShell xls','.wmv','.wma','.wav','.vsd
attachments g',
Enable mailbox auditing for all
$UserMailboxes = Get-mai
48 user mailboxes in your Windows PowerShell $UserMailboxes | ForE
organisation
Create a new dynamic New-DynamicDistributi
49 distribution group by using a Windows PowerShell -RecipientFilter {(Recipient
customized filter Title -like 'Man

View the members of a $DDG = Get-Dy


50 Windows PowerShell
dynamic distribution group Get-Recipient -R

Identify all the Security


51 Windows PowerShell Get-DistributionGroup -F
Groups

Assign full access permission


52 to the admin on all the Windows PowerShell
mailboxes in the organization Add-MailboxPermission $L

Remove full access


permission to the admin on all Windows PowerShell
53
the mailboxes in the
organization Remove-MailboxPermission $

Assign Bulk Calendar


54 Windows PowerShell $users | ForEach-Object {
Permission to a user <User_who_need_p

Get UPNs for all the users in Get-User | Where-Object {$


55 Windows PowerShell
the organization

Enable archive mailboxes for Windows PowerShell Get-Mailbox -ResultSize unlim


56 all users in your organization

$data=g

Get the list of users who have $


57 never logged in to their Windows PowerShell If
$data=g

Get the list of users who have $


57 never logged in to their Windows PowerShell If
mailbox in O365
get-m

$DL = Impo

Add members to an existing Windows PowerShell


58
Distribution list using CSV file
Add-DistributionGroup
-Bypa

Retrieves auto-reply settings Windows PowerShell


59 Get-Mailbox
for a mailbox

Disable auto-reply configured Windows PowerShell Set-MailboxAutoReplyCon


59 for a mailbox ExternalM

Schedule internal and external Windows PowerShell Set-MailboxAutoReplyCon


60 StartTime Start Date E
Auto-replies for a mailbox message In

Enable / Disable External Set-RemoteDomain


61 Windows PowerShell
Forwarding on a Domain -Au

Grant full access permissions Windows PowerShell Get-Mailbox | Add-MailboxP


62 on all mailboxes

Remove full access Get-Mailbox | Remove-M


63 Windows PowerShell
permissions on all mailboxes Fu

Modify password expiration


Set-MsolPasswordPolic
64 period and notification days MSOL PowerShell -D
for the entire domain
Add e-mail aliases to a Set-DistributionGroup
65 Windows PowerShell
Distribution Group SMTP:PrimaryEmai

Set a Room Mailbox to Show


Set-MailboxFolderPermission
66 Details of a Meeting in its Windows PowerShell Na
Calendar
Set a user's calendar to show Windows PowerShell Set-MailboxFolderPermis
67 limited details by default
Set a user's calendar to show Set-MailboxFolderPermis
67 limited details by default Windows PowerShell
Set the Room calendar to
Set-CalendarProcessing -Iden
68 show the Organiser and Windows PowerShell -DeleteCo
Subject of the meeting
Modify Time Zone /
69 Language / Date Format / Windows PowerShell Set-MailboxRegionalConfigu
Time Format for a user -Language <language
mailbox

Add proxy address to each


70 users in your organization for Windows PowerShell foreach ($a in $users) {$a.em
each accepted domain $users | %{Set-Mailbox

Hide external contact(s) from


71 global address list (GAL) in MSOL PowerShell Set-MailContact -Identity <
Office 365

$data=Get-MsolUse

Get E-mail Forwarding details MSOL PowerShell + $Blo


$
72 for all the blocked <disabled>
Windows PowerShell I
users
Get-Mailbox -Identity $U

Enable or Disable credential


73 for all the users in Office 365 MSOL PowerShell Get-MsolUser | S
domain

$data=Get-MsolUse

$Blo
View all the users whose MSOL PowerShell + $
74
credentials have been blocked Windows PowerShell I

Get-Mailbox -Iden

$data=Get-MsolUser -

$
View all the users whose $PasswordN
Password has been set as $
75 Never Expire or not set as MSOL Powershell If($Pass
Never Expire and then export
$data=Get-MsolUser -

$
View all the users whose $PasswordN
Password has been set as $
75 Never Expire or not set as MSOL Powershell If($Pass
Never Expire and then export
Get-MsolUser -UserPr
the results to a CSV file

$Result | E

Get list of users with licenses Get-msoluser -all | For


76 MSOL Powershell
assigned $

77 Hide a user from GAL Windows PowerShell Set-Mailbox -Identity <M

78 Hide all the users from GAL Windows PowerShell Get-mailbox | Set-m

Increase Single Item Recovery Windows PowerShell Set-Mailbox -identity "


79 timeframe to 30 days
SendAs permission for all Foreach ($Mailbox in (Get-Ma
80 Windows PowerShell -identity "$($Mailbox.Na
users to one account Acces
Export GAL to a CSV File from Get-Recipient | Select-Ob
81 Windows PowerShell
O365 [Lo

$AllUsers
F
Check the permission
$Mailb
82 /delegate on inbox for all the Windows PowerShell get-mailboxfolderpermis
users AccessRights | ft $mailbox, u

$AllUsers
F
Check the permission
$Mailbo
83 /delegate on Calendar for all Windows PowerShell get-mailboxfolderpermis
the users AccessRights | ft $mailbox, u

$AllUsers
F
Check the permission
$Mailbo
84 /delegate on Contacts for all Windows PowerShell get-mailboxfolderpermis
the users AccessRights | ft $mailbox, u
Check the permission
$Mailbo
84 /delegate on Contacts for all Windows PowerShell get-mailboxfolderpermis
the users AccessRights | ft $mailbox, u

Export All users First Name, Windows PowerShell $UserMailboxes = Get-mai


85 Get-User | Select-Object Firs
Last Name and E-mail Address

86 To get archive statistics Windows PowerShell Get-Mai

To retrieve archive size and


87 related details for multiple Windows PowerShell Get-Mailbox -Filter {Archive
users and have the results DisplayName,Item
formatted as a table
Find all users with Forwarding
Get-Mailbox | Where
88 Address is set to Internal Windows PowerShell ForwardingA
Recipient

Find all users with Forwarding


Get-Mailbox | Where {$_
89 Address is set to External Windows PowerShell ForwardingAddress,Forw
Recipient

Forward Email of ALL Users to Get-Mailbox | Where {$


-Deliv
90 internal Recipient & save local Windows PowerShell Get-Mailbox | Where {$
copy -ForwardingA

Forward Email of ALL Users to Get-Mailbox | Where {$


-Deli
91 External Recipient & save local Windows PowerShell Get-Mailbox | Where {$
copy -ForwardingSmt

Turn off Forwarding rule for Windows PowerShell Get-Mailbox | Where {$


92 ALL Users to internal Recipient
Turn off Forwarding rule for
Get-Mailbox | Where {$
93 ALL Users to External Windows PowerShell -F
Recipient
Display Room Mailbox Get-Mailbox
94 Permissions and Calendar Windows PowerShell RejectMessagesFrom,RejectM
Settings OrMem

Import Distribution Group Import-Csv <Path>| foreach


95 Windows PowerShell
members from a CSV File Grou

Create bulk Distribution


96 Windows PowerShell Import-CSV <Path>| foreach
Groups from a CSV File
Run the Managed Folder
$UserMailboxes = Get-mail
97 Assistant for all office 365 Windows PowerShell $UserMailboxes | For
Mailboxes
Create New tag for Sync Issues New-RetentionPolicyTag -Na
98 Windows PowerShell
Folder days -RetentionAction 'D
Display the Retention Policy
Get-Mailbox -Res
99 applied to all Office 365 users Windows PowerShell '*DiscoverySear
Mailboxes
Apply Retention Policy to ALL Windows PowerShell $UserMailboxes = Get-mail
100 office 365 Mailboxes $UserMailboxes |
POWERSHELL COMMANDS & SCRIPTS
SCRIPT
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic
-AllowRedirection
Set-ExecutionPolicy Unrestricted
Import-PSSession $Session
Connect-MsolService
To give the user named John Sm
Add-RecipientPermission <identity> -AccessRights SendAs -Trustee <user> following command: Add-Recip

To list the users who have Send


Get-RecipientPermission <Mailbox Id> command:
To give a user secretary@m
Set-Mailbox -Identity <Mailbox ID 1> -GrantSendOnBehalfTo <Mailbox ID 2> boss@microsoft.com, r
boss@microsoft.com -
To verify who has the Send On
Get-Mailbox -Identity <Mailbox ID 1> | Select GrantSendOnBehalfTo following command: Get-mail
To forward email to an externa
Set-Mailbox -Identity <Mailbox ID> -ForwardingSmtpAddress <Target SMTP Address> command: Set-Mailbox -id

To forward email to a forwardin


Set-Mailbox -Identity <Mailbox ID> -ForwardingSmtpAddress <Target SMTP Address> mailbox, please run the followi
-DeliverToMailboxAndForward:$true -ForwardingSmtpAddress m
To verify if Email-forwarding
Get-Mailbox -Identity <Mailbox ID 1> | Select ForwardingSmtpAddress following command: G
To grant full mailbox access to
Add-MailboxPermission -Identity <Mailbox ID 1> -User <Mailbox ID 2> -AccessRights command: Add-Mailbo
FullAccess -InheritanceType All -Automapping $False secretary@microsoft.com -Access

To grant access to a Room Mailb


Add-MailboxPermission -Identity <Mailbox ID 1> -Owner <Mailbox ID 2> run the following command:

To verify what permissions a u


Get-MailboxPermission -Identity <Mailbox ID 1> | Select User, AccessRights, Deny MailboxPermission boss
To grant Receive As permisson t
Add-MailboxPermission -Identity <Mailbox ID 1> -User <Mailbox ID 2> -AccessRights command: Add-Mailbo
FullAccess -InheritanceType All
secretary@microsoft.c
To remove Send As permission
Remove-RecipientPermission -Identity <Mailbox ID 1> -AccessRights SendAs -Trustee Remove-RecipientPermission -id
<Mailbox ID 2>
To remove forwarding set on a us
Set-Mailbox -Identity <Mailbox ID> -ForwardingSmtpAddress $NULL boss@micros
To remove SendOnBehalfOf pe
Set-Mailbox -Identity <Mailbox ID 1> -GrantSendOnBehalfTo $NULL command: Set-Mailbox -iden
Set-Mailbox <mailbox name> -WindowsEmailAddress <primary smtp address that To change the primary smtp add
you want to set> Set-Mailbox boss@microsoft.com
To change the UPN boss@micros
Set-MsolUserPrincipalName -UserPrincipalName user@domain.onmicrosoft.com following command: Set-MsolUs
-NewUserPrincipalName user@domain.com -NewUserPrinci
To set a user password as Never
Set-MsolUser userprincipalname user@domain.com -PasswordNeverExpires $true -UserPrincipalName bo
To set bulk user password to Nev
Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true | Set-Mso
To verify the password Never Exp
Get-MsolUser | fl PasswordNeverExpires, Displayname | fl Pas
New-Mailbox -Name "Name of the mailbox" -Alias alias name for that mailbox To create the shared mailbox for
-Shared New-Mailbox -Name "Co

Get-RecipientPermission | where {($_.Trustee -ne 'nt authority\self') -and ($_.Trustee


-ne 'null sid')}

To list all the attributes of a given m


Get-mailbox <mailbox ID> | fl M
If the value of ForwardingSmtpAddr
Set-Mailbox Identity <Mailbox ID> ForwardingSmtpAddress $null value to null by running the bel

To disable Outlook access for


Set-CASmailbox <Identity> mapienabled $false ruby@
To disable ActiveSync for a user
Set-CASMailbox -Identity <Mailbox ID> -ActiveSyncIntegrationEnabled $false mark@contoso
To disable OWA for a user ple
Set-CASMailbox -Identity <Mailbox ID> -OWAEnabled $false mark@
Set-DistributionGroup -identity <Distirbution Group ID> -ManagedBy <Mailbox Id> To become owner of a Distribution
DistributionGroup -identity Acco
BypassSecurityGroupManagerCheck
To become owner of all the Dis
Get-DistributionGroup | Set-DistributionGroup -ManagedBy <Mailbox ID>
command: Get-DistributionGroup
BypassSecurityGroupManagerCheck Bypa

To View the protocols that are en


Get-CASMailbox <Mailbox ID> the following comm

To check the last logon time


Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select DisplayName, command: Get-Mailbox -ResultS
LastLogonTime | export-csv c:\FolderName\FileName.csv -notypeinformation LastLogonTime | export
To check licensing information
Get-msoluser | Select DisplayName, UserPrincipalName, islicensed | export-csv command: Get-msoluser | Selec
c:\Folder\FileName.csv -notypeinformation c:\nirav\
To get all the DLs for microsoft
Get-DistributionGroup | where {$_.EmailAddresses -match "DOMAIN NAME"} | fl DistributionGroup | where {
Name, EmailAddresses

To get all the mailboxes for micro


Get-Mailbox | where {$_.EmailAddresses -match "DOMAIN NAME} | fl Name, Mailbox | where {$_.EmailAdd
RecipientType, EmailAddresses

Add-DistributionGroupMember Identity Distribution Group Name Member To add a member to the distribu
user@domain.com DistributionGroupMembe
Add-MailboxPermission -Identity <mailbox on which read permissions need to be To grant secretary@microsoft.co
given> -User <mailbox to which read permissions needs to be granted -AccessRights please run the following comma
ReadPermission -User secretary@m

Get-MsolAccountSku | % { $_.ServiceStatus }
Get-MsolAccountSku | % { $_.ServiceStatus }

To grant mark@microsoft.com
Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'UserMailbox') following command: Get-Mailb
-and (Alias -ne '<Mailbox ID 1>' )} | Add-MailboxPermission -User <Mailbox ID 1> 'UserMailbox') -and (Alias -ne
-AccessRights fullaccess -InheritanceType all -Automapping $<true/false> mark@microsoft.com -AccessR
Get-Mailbox | where-Object {$_.EmailAddresses -match "DOMAIN NAME"} | Add- To grant mark@microsoft.com fu
MailboxPermission -user <Mailbox ID 1> -AccessRights FullAccess -Automapping the following command: Ge
$<true/false> "microsoft.com"} | Add-Mailb

Get-InboxRule |fl Name,Enabled,Description,*Box*

To change the password for the u


Set-MsolUserPassword -UserPrincipalName <UPN of the user> -NewPassword
following command: Set-Msol
<password> -ForceChangePassword $<true/false> -NewPassword w

Set-MsolUser -UserPrincipalName <UPN of the user to be blocked> -blockcredential To block john@microsoft.com f


$<true/false> command: Set-MsolUser -UserP

To get complete mobile device in


Get-ActiveSyncDeviceStatistics -Mailbox <Mailbox ID> following command: Get-Ac

Import-Csv C:\FolderName\FileName.csv|%{New-MailContact -Name $_.Name


-DisplayName $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -FirstName
$_.FirstName -LastName $_.LastName}
$MigrationSettings = Test-MigrationServerAvailability -Exchange -Credentials (Get- $MigrationSettings = Test-Migrati
Credential) -ExchangeServer internal-exchange-fqdn -RPCProxyServer external-
-ExchangeServer gien1wmex0
outlook-anywhere-fqdn
New-MigrationBatch -Exchange -Name unique-name-for-migration New-MigrationBatch -Exchange
-ExchangeConnectionSettings $MigrationSettings.ConnectionSettings $MigrationSettings.ConnectionS
-MaxConcurrentMigrations number-of-concurrent-migrations -TimeZone "MST-PST-
EST-CST"
New-MigrationBatch -Exchange -Name unique-name-for-migration New-MigrationBatch -Exchange
-ExchangeConnectionSettings $MigrationSettings.ConnectionSettings $MigrationSettings.ConnectionS
-MaxConcurrentMigrations number-of-concurrent-migrations -TimeZone "MST-PST- Standard Time" -CSVD
EST-CST" -CSVData:([System.IO.File]::ReadAllBytes("C:\Folder\FileName.csv")) 9nisav.
New-MigrationBatch -Imap -Name unique-name-for-migration -CSVData New-MigrationBatc
([System.IO.File]::ReadAllBytes("C:\Users\v-9naga ([System.IO
\Desktop\BOOK4.csv")) -MaxConcurrentMigrations number-of-concurrent- \Desktop\BOOK4.csv")) -MaxCo
migrations -RemoteServer <fqdn of imap server> -Port 993 -Timezone "MST-PST-EST- 993 -Ti
CST"
To start the Migration batch Test
Start-MigrationBatch -identity <Migration Batch Name> Migration
To get the status of the mig
Get-MigrationBatch -identity <Migration Batch Name> OR Get-MigrationStatus MigrationBatch -identity
Diagnostic Tes
To complete an existing Migrati
Complete-Migration -identity <Migration Batch Name> Migrati
Test-MigrationServerAvailability -Imap -Port 993 -RemoteServer <imap server name> To test the availability of the IM
OR Test-MigrationServerAvailability -Exchange -ExchaneServer <fqdn of the Test-MigrationServerAvailabili
MigrationServerAvailability -E
exchange server> -RpcProxyServer <external owa url>
Set-OwaMailboxPolicy -Identity OwaMailboxPolicy-Default -AllowedFileTypes
'.rpmsg','.xlsx','.xlsm','.xlsb','.tiff','.pptx','.pptm','.ppsx','.ppsm','.docx','.docm','.zip','.
xls','.wmv','.wma','.wav','.vsd','.txt','.tif','.rtf','.pub','.ppt','.png','.pdf','.one','.mp3','.jp
g','.gif','.doc','.bmp','.avi','.xml'
Set-OwaMailboxPolicy -Identity OwaMailboxPolicy-Default -AllowedFileTypes
'.rpmsg','.xlsx','.xlsm','.xlsb','.tiff','.pptx','.pptm','.ppsx','.ppsm','.docx','.docm','.zip','.
xls','.wmv','.wma','.wav','.vsd','.txt','.tif','.rtf','.pub','.ppt','.png','.pdf','.one','.mp3','.jp
g','.gif','.doc','.bmp','.avi','.xml'

$UserMailboxes = Get-mailbox -Filter {(RecipientTypeDetails -eq 'UserMailbox')}


$UserMailboxes | ForEach {Set-Mailbox $_.Identity -AuditEnabled $true}
To create a new DDL Washingto
New-DynamicDistributionGroup -Name "Washington Management Team" New-DynamicDistributionGroup
-RecipientFilter {(RecipientType -eq 'UserMailbox') -and (Title -like 'Director*' -or {(RecipientType -eq 'UserMailbox
Title -like 'Manager*') -and (StateOrProvince -eq 'WA')} (
To get all the recipient listed in DD
$DDG = Get-DynamicDistributionGroup <Group Name> command: $DDG = Get-Dynam
Get-Recipient -RecipientPreviewFilter $DDG.RecipientFilter Get-Recipient -R

Get-DistributionGroup -Filter '(GroupType -eq "Universal,SecurityEnabled")'

To grant full mailbox access on al


$csv = get-mailbox
the following com
foreach($line in $csv)

Add-MailboxPermission $Line.identity -AccessRights FullAccess -user <User ID> Add-MailboxPermissi


AutoMapping:$false niravsavla@
}

To remove full mailbox access on


$csv = get-mailbox run the following co
foreach($line in $csv)

Remove-MailboxPermission $Line.identity -AccessRights FullAccess -user <User ID> Remove-MailboxPermi


AutoMapping:$false niravsavla@
}

In order to assign mark@micros


$users = Get-mailbox organization, please run the follow
$users | ForEach-Object {Add-MailboxFolderPermission $_":\Calendar" -User
$users | ForEach-Object {
<User_who_need_permission> -AccessRights <Permission Level>} mark@m

Get-User | Where-Object {$_.UserPrincipalName -like "*" + $searchText + "*"} | fl


UserPrincipalName

Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'UserMailbox')} |


Enable-Mailbox -Archive

$data=get-mailbox | get-mailboxstatistics
foreach($i in $data)
{
$LastLogon=$i.LastLogontime
$Identity=$i.DisplayName
If(-not($LastLogon-ne$None))
$data=get-mailbox | get-mailboxstatistics
foreach($i in $data)
{
$LastLogon=$i.LastLogontime
$Identity=$i.DisplayName
If(-not($LastLogon-ne$None))
{
get-mailboxstatistics -identity $Identity
}
}

$DL = Import-Csv -Path "[ Path of the CSV File ]"


$DL | ForEach-Object {
$Members = $_.members
$Identity = $_.Identity
Add-DistributionGroupMember -Identity $Identity -Member $Members
-BypassSecurityGroupManagerCheck
}

To retrieve auto-reply settings fo


Get-MailboxAutoReplyConfiguration <Mailbox Id>
command: Get-Mailbo

To disable auto-reply settings con


Set-MailboxAutoReplyConfiguration <Mailbox Id> AutoReplyState Disabled following command: Set-M
ExternalMessage $null InternalMessage $null AutoReplyState Disable
To set OOF for mark@micro
MailboxAutoReplyConfigurati
StartTime 9/1/2012 EndTime
Set-MailboxAutoReplyConfiguration <Mailbox Id> AutoReplyState Scheduled 9/1/2012 to 9/152012. So I will b
StartTime Start Date EndTime End Date ExternalMessage External OOF 365 Subscription Holder and you
message InternalMessage Internal OOF message my Team Manager whose details
will be in training from 9/1/2

Set-RemoteDomain -Identity Default -AutoForwardEnabled:$False


-AutoReplyEnabled:$True / False

To grant full mailbox access to


Get-Mailbox | Add-MailboxPermission -User <Mailbox Id> -AccessRights Fullaccess please run the following co
-InheritanceType all mark@microsoft.co
To remove full mailbox
Get-Mailbox | Remove-MailboxPermission -User <Mailbox Id> -AccessRights mark@microsoft.com, pleas
Fullaccess -InheritanceType all MailboxPermission -User mark@
To modify the password ex
Set-MsolPasswordPolicy -ValidityPeriod <Days> -NotificationDays <Days> microsoft.com, please run the fo
-DomainName <Domain Name> 1000 -Notificati
To add email aliases to the distr
Set-DistributionGroup "Distribution Group Name Here" -EmailAddresses following command: S
SMTP:PrimaryEmail@domain.com,SecondaryEmail@domain.com SMTP:accounting@

Set-MailboxFolderPermission -AccessRights LimitedDetails -Identity <Room Mailbox To following


set a room mailbox Conference
command: Set-Mailb
Name>:\calendar -User default Confe
To set a user Mark's calendar to s
Set-MailboxFolderPermission -AccessRights LimitedDetails -Identity <Mailbox the following command: Set-Mai
Id>:\calendar -User default
mark@m
To set a user Mark's calendar to s
Set-MailboxFolderPermission -AccessRights LimitedDetails -Identity <Mailbox
the following command: Set-Mai
Id>:\calendar -User default mark@m
To set the room calendar for room
Set-CalendarProcessing -Identity <Room Mailbox Id> -AddOrganizerToSubject $true and 'subject' of the meeting, pl
-DeleteComments $false -DeleteSubject $false -Identity Conference1@sky2sky.c

To modify the time zone, la


Set-MailboxRegionalConfiguration -identity <Mailbox Id> -TimeZone "<TimeZone>" mark@microsoft.com, please run
-Language <language> -DateFormat <format> -TimeFormat <format> -identity mark@microsoft.co
-DateForm

$users = Get-Mailbox
foreach ($a in $users) {$a.emailaddresses.Add("$($a.alias)@<New Domain Name>")} In order to add e-mail
$users | %{Set-Mailbox $_.Identity -EmailAddresses $_.EmailAddresses} mssupport.microsoft.com, pl
foreach ($a in $users) {$a.emai
$users | %{Set-Mailbox
To hide a user mark@microsoft.c
Set-MailContact -Identity <Mailbox Id> -HiddenFromAddressListsEnabled $true Set-MailContact -Identity mark

$data=Get-MsolUser | Select BlockCredential, UserPrincipalName


foreach($i in $data)
{
$BlockCredential=$i.BlockCredential
$UPN=$i.UserPrincipalName
If($BlockCredential-eq$True)
{
Get-Mailbox -Identity $UPN | Select-Object UserPrincipalName, Forwarding*
}
}

Get-MsolUser | Set-MsolUser -BlockCredential $True / False

$data=Get-MsolUser | Select BlockCredential, UserPrincipalName


foreach($i in $data)
{
$BlockCredential=$i.BlockCredential
$UPN=$i.UserPrincipalName
If($BlockCredential-eq$True)
{
Get-Mailbox -Identity $UPN | Select-Object UserPrincipalName
}
}

$data=Get-MsolUser -MaxResult 3000 | Select PasswordNeverExpires,


UserPrincipalName
$Result=foreach($i in $data)
{
$PasswordNeverExpires=$i.PasswordNeverExpires
$UPN=$i.UserPrincipalName
If($PasswordNeverExpires-eq$True / False)
{
$data=Get-MsolUser -MaxResult 3000 | Select PasswordNeverExpires,
UserPrincipalName
$Result=foreach($i in $data)
{
$PasswordNeverExpires=$i.PasswordNeverExpires
$UPN=$i.UserPrincipalName
If($PasswordNeverExpires-eq$True / False)
{
Get-MsolUser -UserPrincipalName $UPN | Select-Object DisplayName,
PasswordNeverExpires
}
}
$Result | Export-Csv C:\nirav\pswd.csv -notype

Get-msoluser -all | ForEach-Object { "============="; $_.DisplayName;


$_.licenses[0].servicestatus }
To hide a user mark@microsoft.c
Set-Mailbox -Identity <Mailbox Id> -HiddenFromAddressListsEnabled $true Set-Mailbox -Identity <mark@

Get-mailbox | Set-mailbox -HiddenFromAddressListsEnabled $true


To increase the single item rec
Set-Mailbox -identity "Display Name" -SingleItemRecoveryEnabled $True execute the following
-RetainDeletedItemsFor 30 -SingleItemRecove
Foreach ($Mailbox in (Get-Mailbox -ResultSize Unlimited)) { Add-RecipientPermission To give all the users in the dom
-identity "$($Mailbox.Name) -Trustee user@domain.microsoftonline.com execute the following command
AccessRights SendAs -confirm:$false} { Add-RecipientPermission -iden

Get-Recipient | Select-Object Name,PrimarySmtpAddress | Export-CSV -Not Get-Recipient | Select-Ob


[Location of storage of CSV File ]

$AllUsers = get-mailbox * -resultsize:unlimited $AllUsers


ForEach ($alias in $AllUsers) F
{
$Mailbox = ""+ $alias.Name +":\Inbox" $Mailb
get-mailboxfolderpermission -identity $Mailbox | Select User, FolderName, get-mailboxfolderpermission -ide
AccessRights | ft $mailbox, user, foldername, accessrights >>[ Location of the CSV file $mailbox, user, folde
]
}

$AllUsers = get-mailbox * -resultsize:unlimited $AllUsers


ForEach ($alias in $AllUsers) F
{
$Mailbox = ""+ $alias.Name +":\Calendar"
$Mailbo
get-mailboxfolderpermission -identity $Mailbox | Select User, FolderName, get-mailboxfolderpermission -ide
AccessRights | ft $mailbox, user, foldername, accessrights >>[ Location of the CSV file $mailbox, user, folde
]
}

$AllUsers = get-mailbox * -resultsize:unlimited $AllUsers


ForEach ($alias in $AllUsers) F
{
$Mailbox = ""+ $alias.Name +":\Contacts" $Mailbo
get-mailboxfolderpermission -identity $Mailbox | Select User, FolderName, get-mailboxfolderpermission -ide
AccessRights | ft $mailbox, user, foldername, accessrights >>[ Location of the CSV file $mailbox, user, folde
]
}
{
$Mailbox = ""+ $alias.Name +":\Contacts" $Mailbo
get-mailboxfolderpermission -identity $Mailbox | Select User, FolderName, get-mailboxfolderpermission -ide
AccessRights | ft $mailbox, user, foldername, accessrights >>[ Location of the CSV file $mailbox, user, folde
]
}

$UserMailboxes = Get-mailbox -Filter {(RecipientTypeDetails -eq 'UserMailbox')}


Get-User | Select-Object FirstName, LastName, WindowsEmailAddress | Export-Csv
[ Location of the CSV file ]

Get-MailboxStatistics <Mailbox Id> -Archive

Get-Mailbox -Filter {ArchiveStatus -eq "active"} | Get-MailboxStatistics -archive | ft


DisplayName,ItemCount,TotalItemSize,StorageLimitStatus -auto

Get-Mailbox | Where {$_.ForwardingAddress -ne $null} | Select Name,


ForwardingAddress, DeliverToMailboxAndForward

Get-Mailbox | Where {$_.ForwardingsmtpAddress -ne $null} | Select Name,


ForwardingAddress,ForwardingsmtpAddress, DeliverToMailboxAndForward

Get-Mailbox | Where {$_.RecipientType -eq "UserMailbox"}| Set-Mailbox Get-Mailbox | Where {


-DeliverToMailboxAndForward $true -Del
Get-Mailbox | Where {$_.RecipientType -eq "UserMailbox"}| Set-Mailbox Get-Mailbox | Where {$_.Recipie
-ForwardingAddress <Office 365 User Email Address>

Get-Mailbox | Where {$_.RecipientType -eq "UserMailbox"}| Set-Mailbox Get-Mailbox | Where {


-DeliverToMailboxAndForward $true -De
Get-Mailbox | Where {$_.RecipientType -eq "UserMailbox"}| Set-Mailbox Get-Mailbox | Where {$_.Recipient
-ForwardingSmtpAddress <Office 365 User Email Address>

Get-Mailbox | Where {$_.RecipientType -eq "UserMailbox"}| Set-Mailbox


-ForwardingAddress $null

Get-Mailbox | Where {$_.RecipientType -eq "UserMailbox"}| Set-Mailbox


-ForwardingSmtpAddress $null

Get-Mailbox <Room Name> | select ResourceType, Get-Mail


RejectMessagesFrom,RejectMessagesFromDLMembers,RejectMessagesFromSenders RejectMessagesFrom,RejectMessa
OrMembers,SendModerationNotifications ers,

Import-Csv <Path>| foreach {Add-DistributionGroupMember -Identity <Distribution Import-Csv C:\folder\file.c


Group Name> -Member $_.identity} Accounting@

Import-CSV C:\Folder\File.csv
Import-CSV <Path>| foreach {New-DistributionGroup -Name $_.name -Type $_.Type}

$UserMailboxes = Get-mailbox -Filter {(RecipientTypeDetails -eq 'UserMailbox')}


$UserMailboxes | ForEach {Start-ManagedFolderAssistant $_.Identity}

New-RetentionPolicyTag -Name Tag name -Type 'SyncIssues' -AgeLimitForRetention New-RetentionPolicyTag -Nam


days -RetentionAction 'DeleteAndAllowRecovery' -RetentionEnabled $true -RetentionAction 'Del
Get-Mailbox -ResultSize Unlimited | where {$_.name -notlike
'*DiscoverySearchMailbox*'} | select Alias, RetentionPolicy

$UserMailboxes = Get-mailbox -Filter {(RecipientTypeDetails -eq 'UserMailbox')}


$UserMailboxes | Set-Mailbox RetentionPolicy <Policy Name>
RIPTS
EXAMPLE

NA

NA
e the user named John Smith Send As permission for the Help Desk mailbox , run the
ing command: Add-RecipientPermission "Help Desk" -AccessRights SendAs -Trustee
"John Smith"
the users who have Send As permission on the Help Desk mailbox, run the following
command: Get-RecipientPermission "Help Desk"
give a user secretary@microsoft.com Send on Behalf of permission for the user
boss@microsoft.com, run the following command: Set-Mailbox -Identity
boss@microsoft.com -GrantSendOnBehalfTo secretary@microsoft.com
erify who has the Send On Behalf of permission on a user mailbox, please run the
wing command: Get-mailbox boss@microsoft.com | select GrantSendOnBehalfTo
rward email to an external account or an internal account, please run the following
ommand: Set-Mailbox -identity boss@microsoft.com -ForwardingSmtpAddress
mark@gmail.com
ward email to a forwarding account and also save a copy of the email on the source
box, please run the following command: Set-Mailbox -identity boss@microsoft.com
orwardingSmtpAddress mark@gmail.com -DeliverToMailboxAndForward:$true
verify if Email-forwarding has been set correctly on a user mailbox, please run the
following command: Get-Mailbox -identity boss@microsoft.com | select
ForwardingSmtpAddress
ant full mailbox access to a secretary on her boss' mailbox, please run the following
command: Add-MailboxPermission -identity boss@microsoft.com -user
y@microsoft.com -AccessRights FullAccess -InheritanceType All - Automapping $False

nt access to a Room Mailbox TrainingLab1 to a user who also acts as its owner, please
n the following command: Add-MailboxPermission -identity TrainingLab1 -Owner
boss@microsoft.com

rify what permissions a user mailbox has, please run the following command: Get-
MailboxPermission boss@microsoft.com | Select User, AccessRights, Deny
nt Receive As permisson to a mailbox on another mailbox, please run the following
command: Add-MailboxPermission -identity boss@microsoft.com -user
secretary@microsoft.com -AccessRights FullAccess -InheritanceType All
move Send As permission from a boss' mailbox, please run the following command:
e-RecipientPermission -identity boss@microsoft.com -AccessRights SendAs -Trustee
secretary@microsoft.com
ove forwarding set on a user mailbox, please run the following command: Set-Mailbox
boss@microsoft.com -ForwardingSmtpAddress $Null
move SendOnBehalfOf permission assigned to a mailbox, please run the following
mmand: Set-Mailbox -identity boss@microsoft.com -GrantSendonBehalfTo $Null
nge the primary smtp address for a user mailbox, please run the following command:
ilbox boss@microsoft.com -WindowsEmailAddress boss@mssupport.microsoft.com
nge the UPN boss@microsoft.com to boss@mssupport.microsoft.com, please run the
ng command: Set-MsolUserPrincipalName -UserPrincipalName boss@microsoft.com
-NewUserPrincipalName boss@mssupport.microsoft.com
a user password as Never Expire, please run the following command: Set-MsolUser
-UserPrincipalName boss@microsoft.com -PasswordNeverExpires $true
ulk user password to Never Expire, please run the following command: Get-MsolUser
| Set-MsolUser -PasswordNeverExpires $true
y the password Never Expire status, please run the following command: Get-MsolUser
| fl PasswordNeverExpires, DisplayName
ate the shared mailbox for Corporate Printing Services, run the following commands:
New-Mailbox -Name "Corporate Printing Services" -Alias corpprint -Shared

NA

all the attributes of a given mailbox boss@microsoft.com, run the following command: Get-
Mailbox boss@microsoft.com | fl
lue of ForwardingSmtpAddress is set to any external or internal email address please set the
ue to null by running the below command: Set-Mailbox Identity boss@microsoft.com
ForwardingSmtpAddress $null
disable Outlook access for a user, please run the following command: Set-CASmailbox
ruby@microsoft.com -mapienabled $false
isable ActiveSync for a user please run the following command: Set-CASMailbox -Identity
mark@contoso.com -ActiveSyncIntegrationEnabled $false
o disable OWA for a user please run the following command: Set-CASMailbox -Identity
mark@contoso.com -OWAEnabled $false
ome owner of a Distribution Group in your domain please run the following command:Set-
ributionGroup -identity Accounting@microsoft.com -ManagedBy mark@microsoft.com
BypassSecurityGroupManagerCheck
come owner of all the Distribution Groups in your domain please run the following
nd: Get-DistributionGroup | Set-DistributionGroup -ManagedBy mark@microsoft.com
BypassSecurityGroupManagerCheck

w the protocols that are enabled for client connections for a user mailbox, please run
the following command: Get-CASMailbox mark@microsoft.com

check the last logon time of all the users in the domain, please run the following
and: Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select DisplayName,
LastLogonTime | export-csv c:\nirav\lastlogintime.csv -notypeinformation
heck licensing information for all the users in the domain, please run the following
and: Get-msoluser | Select DisplayName, UserPrincipalName, islicensed | export-csv
c:\nirav\licenseinfo.csv -notypeinformation
et all the DLs for microsoft.com domain, please run the following command: Get-
tributionGroup | where {$_.EmailAddresses -match "microsoft.com"} | fl Name,
EmailAddresses
all the mailboxes for microsoft.com domain, please run the following command:Get-
ox | where {$_.EmailAddresses -match "microsoft.com} | fl Name, RecipientType,
EmailAddresses
a member to the distribution group SALES, please run the following command: Add-
DistributionGroupMember Identity SALES Member mark@microsoft.com
nt secretary@microsoft.com read permission to read boss@microsoft.com's mailbox,
run the following command: Add-MailboxPermission -Identity boss@microsoft.com
-User secretary@microsoft.com -AccessRights ReadPermission

NA
NA

nt mark@microsoft.com full access permission on all the mailboxes, please run the
wing command: Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq
Mailbox') -and (Alias -ne 'mark@microsoft.com' )} | Add-MailboxPermission -User
@microsoft.com -AccessRights fullaccess -InheritanceType all -Automapping $false
nt mark@microsoft.com full access permission on microsoft.com domain, please run
e following command: Get-Mailbox | where-Object {$_.EmailAddresses -match
crosoft.com"} | Add-MailboxPermission -user mark@microsoft.com -AccessRights
FullAccess -Automapping $false

NA

ge the password for the user mark@microsoft.com to welcome@123, please run the
wing command: Set-MsolUserPassword -UserPrincipalName mark@microsoft.com
-NewPassword welcome@123 -ForceChangePassword $false

ck john@microsoft.com from using his Office 365 account, please run the following
and: Set-MsolUser -UserPrincipalName john@microsoft.com -blockcredential $true

complete mobile device information for a user John@microsoft.com, please run the
lowing command: Get-ActiveSyncDeviceStatistics -Mailbox john@microsoft.com

NA

tionSettings = Test-MigrationServerAvailability -Exchange -Credentials (Get-Credential)


hangeServer gien1wmex001.gienowltd.lan -RPCProxyServer webmail.gienow.com

MigrationBatch -Exchange -Name TestMigrationBatch1 -ExchangeConnectionSettings


tionSettings.ConnectionSettings -MaxConcurrentMigrations 3 -TimeZone "Mountain
Standard Time"
MigrationBatch -Exchange -Name TestMigrationBatch2 -ExchangeConnectionSettings
tionSettings.ConnectionSettings -MaxConcurrentMigrations 3 -TimeZone "Mountain
Standard Time" -CSVData:([System.IO.File]::ReadAllBytes("C:\Users\v-
9nisav.MSDSWSM\Desktop\testm.csv"))
New-MigrationBatch -Imap -Name TestMigrationBatch3 -CSVData
([System.IO.File]::ReadAllBytes("C:\Users\v-9naga
op\BOOK4.csv")) -MaxConcurrentMigrations 3 -RemoteServer imap.gmail.com -Port
993 -Timezone "Central Standard Time"
the Migration batch TestMigrationBatch1, please run the following command: Start-
MigrationBatch -identity TestMigrationBatch1
o get the status of the migration batch, please run the following command: Get-
MigrationBatch -identity MigrationBatch1 OR Get-MigrationStatus -identity
TestMigrationBatch 1 -Diagnostic
mplete an existing Migration Batch, please run the following command: Complete-
Migration -identity TestMigrationBatch1
t the availability of the IMAP / Exchange server, please run the following command:
MigrationServerAvailability -Imap -Port 993 -RemoteServer imap.aol.com OR Test-
rationServerAvailability -Exchange -ExchangeServerName sixprd0610.outlook.com
-RpcProxyServer mail.office365.com

NA
NA

NA

ate a new DDL Washington Management Team, please run the following command:
DynamicDistributionGroup -Name "Washington Management Team" -RecipientFilter
entType -eq 'UserMailbox') -and (Title -like 'Director*' -or Title -like 'Manager*') -and
(StateOrProvince -eq 'WA')}
ll the recipient listed in DDL Washington Management Team, please run the following
mand: $DDG = Get-DynamicDistributionGroup "Washington Management Team"
Get-Recipient -RecipientPreviewFilter $DDG.RecipientFilter

NA

t full mailbox access on all the mailboxes to the user nick@microsoft.com, please run
the following command: $csv = get-mailbox

foreach($line in $csv)

Add-MailboxPermission $Line.identity -AccessRights FullAccess -user


niravsavla@sky2sky.co.cc AutoMapping:$false

ove full mailbox access on all the mailboxes to the user nick@microsoft.com, please
run the following command: $csv = get-mailbox

foreach($line in $csv)

Remove-MailboxPermission $Line.identity -AccessRights FullAccess -user


niravsavla@sky2sky.co.cc AutoMapping:$false

er to assign mark@microsoft.com Owner permission to all the user calenders in the


ation, please run the following command: $users = Get-mailbox
$users | ForEach-Object {Add-MailboxFolderPermission $_":\Calendar" -User
mark@microsoft.com -AccessRights Owner}

NA

NA

NA
NA

NA

eve auto-reply settings for a mailbox mark@microsoft.com, please run the following
command: Get-MailboxAutoReplyConfiguration mark@microsoft.com

ble auto-reply settings configured for a mailbox mark@microsoft.com, please run the
llowing command: Set-MailboxAutoReplyConfiguration mark@microsoft.com
AutoReplyState Disabled ExternalMessage $null InternalMessage $null
set OOF for mark@microsoft.com, please execute the following command: Set-
ilboxAutoReplyConfiguration mark@microsoft.com AutoReplyState Scheduled
me 9/1/2012 EndTime 9/15/2012 ExternalMessage Hi, I will be in training from
12 to 9/152012. So I will be resuming operations from 9/16/2012. If you are an Office
scription Holder and you need immediate assistance please contact my Tech Leads or
m Manager whose details can be found in my email signature InternalMessage Hi, I
be in training from 9/1/2012 to 9/152012. So I will be resuming operations from
9/16/2012

NA

ant full mailbox access to all the mailboxes in the domain to mark@microsoft.com,
lease run the following command: Get-Mailbox | Add-MailboxPermission -User
mark@microsoft.com -AccessRights Fullaccess -InheritanceType all
To remove full mailbox access to all the mailboxes in the domain given to
ark@microsoft.com, please run the following command: Get-Mailbox | Remove-
xPermission -User mark@microsoft.com -AccessRights Fullaccess -InheritanceType all
To modify the password expiration period and notification days for the domain
oft.com, please run the following command: Set-MsolPasswordPolicy -ValidityPeriod
1000 -NotificationDays 30 -DomainName microsoft.com
d email aliases to the distribution group accounting@microsoft.com, please run the
following command: Set-DistributionGroup accounting -EmailAddresses
SMTP:accounting@microsoft.com, bizaccount@microsoft.com
room mailbox Conference1 to show details of a meeting in its calendar, please run the
wing command: Set-MailboxFolderPermission -AccessRights LimitedDetails -Identity
Conference1:\calendar -User default
user Mark's calendar to show limited details of a meeting in his calendar, please run
owing command: Set-MailboxFolderPermission -AccessRights LimitedDetails -Identity
mark@microsoft.com:\calendar -User default
he room calendar for room mailbox conference1@microsoft.com show the 'organizer'
ubject' of the meeting, please run the following command: Set-CalendarProcessing
y Conference1@sky2sky.co.cc -AddOrganizerToSubject $true -DeleteComments $false
-DeleteSubject $false
o modify the time zone, language, date format and time format for the mailbox
microsoft.com, please run the following command: Set-MailboxRegionalConfiguration
entity mark@microsoft.com -TimeZone "Pacific Standard Time" -Language en-US
-DateFormat MM-dd-yyyy -TimeFormat HH:mm

In order to add e-mail aliases to bulk users in the new accepted domain
support.microsoft.com, please run the following command: $users = Get-Mailbox
ch ($a in $users) {$a.emailaddresses.Add("$($a.alias)@mssupport.microsoft.com")}
$users | %{Set-Mailbox $_.Identity -EmailAddresses $_.EmailAddresses}
e a user mark@microsoft.com from the GAL, please execute the following command:
MailContact -Identity mark@microsoft.com -HiddenFromAddressListsEnabled $true

NA

NA

NA

NA
NA

NA

e a user mark@microsoft.com from the GAL, please execute the following command:
Mailbox -Identity <mark@microsoft.com> -HiddenFromAddressListsEnabled $true

NA
crease the single item recovery window to 30 days for the user Mark Adam, please
execute the following command: Set-Mailbox -identity "Mark Adam"
-SingleItemRecoveryEnabled $True -RetainDeletedItemsFor 30
e all the users in the domain Send As permission over mark@microsoft.com please
e the following command: Foreach ($Mailbox in (Get-Mailbox -ResultSize Unlimited))
RecipientPermission -identity "$($Mailbox.Name) -Trustee mark@microsoft.com
AccessRights SendAs -confirm:$false}
Get-Recipient | Select-Object Name,PrimarySmtpAddress | Export-CSV -Not
C:\Nirav\recipient.csv

$AllUsers = get-mailbox * -resultsize:unlimited


ForEach ($alias in $AllUsers)
{
$Mailbox = ""+ $alias.Name +":\Inbox"
lboxfolderpermission -identity $Mailbox | Select User, FolderName, AccessRights | ft
$mailbox, user, foldername, accessrights >>C:\NIRAV\delegates.csv
}

$AllUsers = get-mailbox * -resultsize:unlimited


ForEach ($alias in $AllUsers)
{
$Mailbox = ""+ $alias.Name +":\Calendar"
lboxfolderpermission -identity $Mailbox | Select User, FolderName, AccessRights | ft
$mailbox, user, foldername, accessrights >>C:\NIRAV\delegates.csv
}

$AllUsers = get-mailbox * -resultsize:unlimited


ForEach ($alias in $AllUsers)
{
$Mailbox = ""+ $alias.Name +":\Contacts"
lboxfolderpermission -identity $Mailbox | Select User, FolderName, AccessRights | ft
$mailbox, user, foldername, accessrights >>C:\NIRAV\delegates.csv
}
NA

NA

NA

NA

NA

Get-Mailbox | Where {$_.RecipientType -eq "UserMailbox"}| Set-Mailbox


-DeliverToMailboxAndForward $true
Mailbox | Where {$_.RecipientType -eq "UserMailbox"}| Set-Mailbox -ForwardingAddress
mark@microsoft.com

Get-Mailbox | Where {$_.RecipientType -eq "UserMailbox"}| Set-Mailbox


-DeliverToMailboxAndForward $true
ilbox | Where {$_.RecipientType -eq "UserMailbox"}| Set-Mailbox -ForwardingSmtpAddress
jill@yahoo.com

NA

NA

Get-Mailbox ROOM1| select ResourceType,


essagesFrom,RejectMessagesFromDLMembers,RejectMessagesFromSendersOrMemb
ers,SendModerationNotifications

mport-Csv C:\folder\file.csv| foreach {Add-DistributionGroupMember -Identity


Accounting@microsoft.com -Member $_.identity}

ort-CSV C:\Folder\File.csv| foreach {New-DistributionGroup -Name $_.name -Type


$_.Type}

NA

w-RetentionPolicyTag -Name My Tag -Type 'SyncIssues' -AgeLimitForRetention 120


-RetentionAction 'DeleteAndAllowRecovery' -RetentionEnabled $true
NA

NA

Вам также может понравиться