Office 365 Commands (( GoOdies ))

Hvis du skal sette full access på en annen bruker eller møteroms boks, bruke følgende commando

Set-ExecutionPolicy RemoteSigned

$Cred = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUri -Credential $Cred -Authentication Basic -AllowRedirection

Import-PSSession $Session

Grant an Admin access to a single mailbox:

Add-MailboxPermission -User -AccessRights FullAccess -InheritanceType All

Grant an Admin access to all mailboxes

Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq ‘UserMailbox’) -and (Alias -ne ‘Admin’)} | Add-MailboxPermission -User -AccessRights fullaccess -InheritanceType all

Grant Send As permission

Add-RecipientPermission <identity> -AccessRights SendAs -Trustee <user>

For Example:

Add-RecipientPermission “” -AccessRights SendAs -Trustee “”

Hide from Address list

Set-Mailbox -Identity <> -HiddenFromAddressListsEnabled $true

Convert to meeting room:

set-mailbox -Type Room

changing the Calendar’ s setting from none to full detailed by running PowerShell to make everyone be able to see the detailed information about Calendar meetings.

The PowerShell command is:

set-MailboxFolderPermission ABC:\Calendar -user default -AccessRights custom

( ABC is the name for the Room Mailbox.)


Now that you’re in Exchange Online PowerShell, visit Manage TNEF Message Formatting with Remote Domains for complete instructions. To view the TNEF settings for the Default remote domain, run:

Get-RemoteDomain | Select Name,TNEFEnabled

The result for the remote domain named Default should be blank, which means to TNEF or not to TNEF is controlled by other settings also explained in the topic, like Outlook Settings or mail contact settings. In the off chance that you have other remote domains configured, the TNEFEnabled setting for those remote domains should likewise be blank (or false).



Har kunden problemer med at mail bli til Winmail.dat bruk kommando under

To disable TNEF encoding for all messages sent from your organization, run:

Set-RemoteDomain Default -TNEFEnabled $false

To disable TNEF encoding on a specific remote domain, just run the command again, but replace Default with the Name value of the other remote domain(s).

Calendar Sharing Run the following command

Open a remote PowerShell session by running the following commands and set the sharing policy


$Cred = Get-Credential $Session = New-PSSession –ConfigurationName Microsoft.Exchange –ConnectionUri -Credential $Cred –Authentication Basic -AllowRedirection


Set-SharingPolicy ‘Default Sharing Policy’ –Domains ‘*: CalendarSharingFreeBusySimple’, ‘, ContactsSharing’, ‘, ContactsSharing’

Disable Passord


Set-MsolUser -UserPrincipalName -PasswordNeverExpires $true

Note If you want to change the setting for all the users in an organization, run the following command:

Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true

Sette ny primary SMTP address

Set-Mailbox -Identity “Username” -EmailAddresses,


Create Dynamic Distribution Groups Using Customized Filters



Sette nytt passord på bruker:


Set-MsolUserPassword -UserPrincipalName -NewPassword Password1 -ForceChangePassword $false






New-DynamicDistributionGroup -Name “Alle” -Alias “Alle” -RecipientFilter {RecipientType -eq ‘UserMailbox’} -PrimarySmtpAddress


Migrating Via Powershell (Exchange 2003)


$migrationsettings = Test-MigrationServerAvailability -Exchange -Credentials (Get-Credential) -Exchangeserver -RPCProxyServer


New-MigrationBatch -Exchange -Name 2ndBatch -ExchangeConnectionSettings $Migrationsetting.ConnectionSettings -MaxConcurrentMigrations 3 -TimeZone “Central Europe Standard Time”


$migrationsetting = Test-MigrationServerAvailability -Exchange -Credentials (Get-Credential) -Exchangeserver unionsrv01.unionscene.local -RPCProxyServer


Shared Mailbox Config

$Cred = Get-Credential


$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $Cred -Authentication Basic -AllowRedirection


Import-PSSession $Session




New-Mailbox -Name “Vip24 Support” -Alias vip24 -Shared


Set-Mailbox vip24 -ProhibitSendReceiveQuota 5GB -ProhibitSendQuota 4.75GB -IssueWarningQuota 4.5GB

-Legg til alias på vip24

-Opprett distribusjonsgruppe, kalt “Vip24 Sikkerhetsgruppe”

-Legg til de som skal ha rettigheter og skjul gruppen fra adressebok



Add-MailboxPermission “Vip24 Support” -User vip24DG -AccessRights FullAccess


Add-RecipientPermission “Vip24 Support” -Trustee vip24DG -AccessRights SendAS

Add-MailboxFolderPermission\ -User -AccessRights reviewer

Add-MailboxFolderPermission\SHARED -User -AccessRights reviewer


Pasted from <>




Forwarding Email via poweshell:


Set-Mailbox -Identity Alias -DeliverToMailboxAndForward $true -ForwardingSMTPAddress forwarding@address


Share calendar with everyone in the organisation.



As I understand, you want users in your organization to share Full Details information of appointment to each other.

For this situation, you can change the value of Default Share Policy from “CalendarSharingFreeBusySimple” to “CalendarSharingFreeBusyReviewer” with the cmdlet Set-SharingPolicy. To do it, please refer to the following steps.

1. Connect the Windows powershell to Exchange Online.

2. Run the cmdlet “Get-SharingPolicy |fl” to check the current value of “Domains” in the results. The following is an example of the output.

Domains           : {Anonymous:CalendarSharingFreeBusyReviewer, *:CalendarSharingFreeBusySimple,}


3. Run the cmdlet Set-SharingPolicy and append “yourdomain:CalendarSharingFreeBusyReviewer” as the value of parameter

Domains. For example,

Set-SharingPolicy -Identity “Default Sharing Policy” -Domains ‘’, ‘Anonymous:CalendarSharingFreeBusyReviewer’, ‘*:CalendarSharingFreeBusySimple’

Note: Please ensure to change the value of Domain parameter accordingly.

For more information about the value of sharing policy action and the set-sharingpolicy cmdlet, please refer to the following article.


Pasted from <




View members of a Dynamic Distributiongroup:


Dynamic distribution groups aren’t displayed in the Exchange Control Panel. To view the members of a dynamic distribution group, you have to run the following commands:


$DDG = Get-DynamicDistributionGroup <group name>

Get-Recipient -RecipientPreviewFilter $DDG.RecipientFilter


The first command stores the dynamic distribution group object in the $DDG variable, and the second command uses the Get-Recipient cmdlet to list the recipients that match the criteria defined for the dynamic distribution group.


From <>


Problem med winmail.dat


Set-RemoteDomain Default -TNEFEnabled $false

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.