Показаны сообщения с ярлыком Office 365. Показать все сообщения
Показаны сообщения с ярлыком Office 365. Показать все сообщения

понедельник, 9 января 2017 г.

Connect to Exchange Online with Powershell

Step-by-step guide


  1. Install MSOnline Sign-In Assistant for Windows Powershell http://go.microsoft.com/fwlink/?LinkID=286152
  2. Install Azure Active Directory Module for Windows Powershell   http://go.microsoft.com/fwlink/p/?linkid=236297
  3. Open Azure Active Directory Module for Windows Powershell   
  4. Connect to MSOnline services:  
    $msolcred = get-credential
    connect-msolservice -credential $msolcred
  5. Enjoy!

Share meeting room with shared organization


1. $UserCredential = Get-Credential
2.  $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
3.  Import-PSSession $Session
4.  Set-CalendarProcessing –Identity calendar@mydomain.com -ProcessExternalMeetingMessages $true
5.  Enjoy!

Manage Distribution Groups




Create Distribution Group


Syntax:

New-DistributionGroup -Name "<Distribution Group Name>" 
Example:
New-DistributionGroup -Name new-group 



Create Distribution Group with settings:


Syntax:

New-DistributionGroup -Name <DL name> -DisplayName <DL display name> -Alias <Alias> -PrimarySmtpAddress <Email Address>
Example:
New-DistributionGroup -Name new-group -DisplayName new-group -Alias new-group  -PrimarySmtpAddress new-group@mydomain.com




Add Users to Distribution Group:



Syntax:

Add-DistributionGroupMember "new-group" -Member vpupkin -BypassSecurityGroupManagerCheck

Example:

Add-DistributionGroupMember "new-group" -Member vpupkin -BypassSecurityGroupManagerCheck


Set Owner of Dustribution Group:


Syntax:

Set-DistributionGroup -Identity "<Distribution Group Name>" ManagedBy <Identity> -BypassSecurityGroupManagerCheck

Example:

Set-DistributionGroup -Identity new-group ManagedBy vpupkin  -BypassSecurityGroupManagerCheck



Remove Distribution Group:


Syntax:

Remove-DistributionGroup "<Distribution Group Name>"
Example:
Remove-DistributionGroup new-group


Add Email Aliases for Distribution Group:


Syntax:

Set-DistributionGroup "<Distribution Group Name>" -EmailAddresses SMTP:<Primary Email>,<Alias Email>
Example:

Set-DistributionGroup new-group-EmailAddresses SMTP:new-group@mydomain.com,achtung@mydomain.com


Hide Distribution Group from GAL (Global Address List):


Syntax:

Set-DistributionGroup "<Distribution Group Name>" -HiddenFromAddressListsEnabled $True
Example:
Set-DistributionGroup new-group -HiddenFromAddressListsEnabled $True



Get Information about Distribution Group members:



Syntax:

Get-DistributionGroupMember "Group Name>"

Example:

Get-DistributionGroupMember new-group

Get List of Distribution Groups:

Get-DistributionGroup  




Enjoy!

Useful cmdlets for Sharepoint Online

1) Before start working with SPO's powershell cmdlest you have to download those cmdlets. You can do it here: click me
2) Once installed open the SharePoint Online Management Shell by clicking Start > All Programs > SharePoint Online Management Shell > SharePoint Online Management Shell (As Administrator)
3) Getting Connected:  

Connect-SPOService -Url https:mydomain.sharepoint.com -Credential vasyapupkin@mydomain.com

SPO Cmdlets

Site Groups:

  • Get-SPOSiteGroup – Get a Site Collection Site Group.
  • New-SPOSiteGroup – Create a new Site Collection Site Group.
  • Remove-SPOSiteGroup – Remove an existing Site Collection Site Group.
  • Set-SPOSiteGroup – Set the permission level and/or owner of an existing Site Collection Site Group.

Users:

  • Add-SPOUser – Add a user to an existing Site Collection Site Group.
  • Get-SPOUser – Get an existing user.
  • Remove-SPOUser – Remove an existing user from the Site Collection or from an existing Site Collection Group.
  • Set-SPOUser – Set whether an existing Site Collection user is a Site Collection administrator or not.
  • Get-SPOExternalUser – Returns external users from the tenant’s folder.
  • Remove-SPOExternalUser - Removes a collection of external users from the tenancy's folder.

Site Collections:

  • Get-SPOSite – Retrieve an existing Site Collection.
  • New-SPOSite – Create a new Site Collection.
  • Remove-SPOSite – Move an existing Site Collection to the recycle bin.
  • Repair-SPOSite – If any failed Site Collection scoped health check rules can perform an automatic repair then initiate the repair.
  • Set-SPOSite – Set the Owner, Title, Storage Quota, Storage Quota Warning Level, Resource Quota, Resource Quota Warning Level, Locale ID, and/or whether the Site Collection allows Self Service Upgrade.
  • Test-SPOSite – Run all Site Collection health check rules against the specified Site Collection.
  • Upgrade-SPOSite – Upgrade the Site Collection. This can do a build-to-build (e.g., RTM to SP1) upgrade or a version-to-version (e.g., 2010 to 2013) upgrade. Use the -VersionUpgrade parameter for a version-to-version upgrade.
  • Get-SPODeletedSite – Get a Site Collection from the recycle bin.
  • Remove-SPODeletedSite – Remove a Site Collection from the recycle bin (permanently deletes it).
  • Restore-SPODeletedSite – Restores an item from the recycle bin.
  • Request-SPOUpgradeEvaluationSite - Creates a copy of the specified Site Collection and performs an upgrade on that copy.
  • Get-SPOWebTemplate – Get a list of all available web templates.

Tenants:

  • Get-SPOTenant – Retrieves information about the subscription tenant. This includes the Storage Quota size, Storage Quota Allocated (used), Resource Quota size, Resource Quota Allocated (used), Compatibility Range (14-14, 14-15, or 15-15), whether External Services are enabled, and the No Access Redirect URL.
  • Get-SPOTenantLogEntry – Retrieves company logs (as of B2 only BCS logs are available).
  • Get-SPOTenantLogLastAvailableTimeInUtc – Returns the time when the logs are collected.
  • Set-SPOTenant – Sets the Minimum and Maximum Compatibility Level, whether External Services are enabled, and the No Access Redirect URL.

Apps:

  • Get-SPOAppErrors – Returns application errors.
  • Get-SPOAppInfo – Returns all installed applications.

Connections:

  • Connect-SPOService – Establishes a connection to a SharePoint Online Tenant Administration Site.
  • Disconnect-SPOService – Clears an existing connection.

Enjoy!

Deleted Exchange Calendar item keeps coming back


  1. Connect to Office365 with Powershell
  2. Disable Callendar Repair Assistant with command:    Set-Mailbox vasya@yourdomain.com -CalendarRepairDisabled $true



The Calendar Repair Assistant performs the following functions:
  • Detects inconsistencies
  • Determines if inconsistencies were intentional
  • Corrects inconsistencies 
  • Sends a calendar repair update message if a correction was made
       3. Search and Delete required meeting in calendars:    Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'from:"vasya@yourdomain.com" AND kind:meetings AND SUBJECT:"Type your subject"' -DeleteContent -Force
       4. Just for case if you are looking for another content removal:

–SearchQuery kind:contacts
–SearchQuery kind:notes
–SearchQuery kind:tasks
–SearchQuery kind:im
–SearchQuery kind:email


      5. Enjoy!

Connect to Office365 with Powershell


Step-by-step guide

  1. Run Windows Powershell as Administrator
  2. Login to Office365 with your admin account with command:  
    $LiveCred = Get-Credential



         3.  Import session for Office365 manage:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection



понедельник, 29 августа 2016 г.

Set Calendar permissions in Office365

You can add permissions on a specific mailbox, or you can add it onto a security group.


Step-by-step guide

  1. Run Windows Powershell as Administrator
  2. Login to Office365 with your admin account with command:  
    $LiveCred = Get-Credential


    1. Import session for Office365 manage:
      $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection

    2. Provide permissions:
      Add-MailboxFolderPermission -Identity user1@domain.com:\calendar -user user2@domain.com -AccessRights Editor

      1

      The AccessRights parameter also specifies the permissions for the user with the following roles, which are a combination of the rights listed previously:

      • None – FolderVisible
      • Owner – CreateItems, ReadItems, CreateSubfolders, FolderOwner, FolderContact, FolderVisible, EditOwnedItems, EditAllItems, DeleteOwnedItems, DeleteAllItems
      • PublishingEditor – CreateItems, ReadItems, CreateSubfolders, FolderVisible, EditOwnedItems, EditAllItems, DeleteOwnedItems, DeleteAllItems
      • Editor – CreateItems, ReadItems, FolderVisible, EditOwnedItems, EditAllItems, DeleteOwnedItems, DeleteAllItems
      • PublishingAuthor – CreateItems, ReadItems, CreateSubfolders, FolderVisible, EditOwnedItems, DeleteOwnedItems
      • Author – CreateItems, ReadItems, FolderVisible, EditOwnedItems, DeleteOwnedItems
      • NonEditingAuthor – CreateItems, ReadItems, FolderVisible
      • Reviewer – ReadItems, FolderVisible
      • Contributor – CreateItems, FolderVisible


вторник, 12 июля 2016 г.

Using ADSIedit to Add or Remove E-mail aliases on on-Premises Active Directory


If you are synchronising your Office 365 account with your on-premises exchange/Active Directory, you will know that you cannot edit exchange user properties using the Office 365 administrator portal.
If you try, you will come across this error or a similar one:
The operation on mailbox “employee-mailbox” failed because it’s out of the current user’s write scope. The action ‘Set-Mailbox’, ‘EmailAddresses’, can’t be performed on the object ‘employee-mailbox’ because the object is being synchronized from your on-premises organization. This action should be performed on the object in your on-premises organization.

In this article, you can know how to add e-mail aliases using the Active Directory Service Interfaces Editor (adsiedit).

Step-by-step guide

  1. Go to Start > Run and type adsiedit.msc
  2. Now, find the unit where your AD user’s reside (for example: Fabricam - Office-RU-SPB)
  3. Right click the user you want to edit and click Properties.
  4. Find the variable proxyAddresses – this is the one you want to edit. 
    When you add new e-mail aliases, you need to make sure that your primary e-mail address will start with upper-case SMTP. Your aliases -  secondary addresses should be lower-case smtp. For example: 
    In the proxyAddresses attribute, you need put:
    SMTP:firstnamelastname@domain.com - Primary address
    smtp:firstnamelastname@domain.com  - alias, aka secondary address