Category: Powershell

O365 hybrid mailbox move, largeitem skipped warnings

When migrating mailboxes to O365 exchange online, maximum item size is limited to 150 MB. To move these items, you can export these to pst -file and you can import these back after mailbox is migrated. With this script to find users / mailboxes…

Continue Reading O365 hybrid mailbox move, largeitem skipped warnings

Add Calendar permissions to mailboxes in Hybrid environments.

Hi again, Below script will add Reviewer permissons for DefaultCalendarShare group. This is needed for Hybrid environments and Cross-Premises calendar sharing. $allmailbox = Get-Mailbox -Resultsize Unlimited | where { $_.IsShared -eq $False -and $_.ArbitrationMailbox -eq $Null } $Logfile = “C:TempLogsadd-calendarPerm.log”…

Continue Reading Add Calendar permissions to mailboxes in Hybrid environments.

Export All Mailboxes Calendar permisson to CSV

Below is a script that will export calendar permissions to utf8-formatted csv-file. Works with Onpremise Exchange as well as Exchange Online.

Continue Reading Export All Mailboxes Calendar permisson to CSV

Assign Permissions to all mailboxes using Mail Enabled Security Group.

Hi, Add all users that need the following rights to a Mail Enabled Security Group. Then add permissions to calendars with this script: $allmailbox = Get-Mailbox -Resultsize Unlimited -Filter {RecipientTypeDetails -eq ‘usermailbox’} Foreach ($Mailbox in $allmailbox) {     $path =…

Continue Reading Assign Permissions to all mailboxes using Mail Enabled Security Group.

Find a User with certain SID.

Hi, Powershell is the way. Open powershell and type: import-module activedirectory  Then. $strSID=”Enter SID Here” $uSid = [ADSI]”LDAP://<SID=$strSID>” echo $uSid Have a nice one,

Continue Reading Find a User with certain SID.

How to find computers with a name starting with something and add them to a security group.

Dou, that was a long sentence 🙂 But here is how. $computers = get-adcomputer -ldapfilter “(name=name*)” $computers | foreach {Add-ADGroupMember -id name_of_the_group -MEMBERS $computers.samaccountname} Happy powershelling!

Continue Reading How to find computers with a name starting with something and add them to a security group.

Get all user lisences from Office 365 to csv.

Hi, Today I had to get a list from Office 365 with UserPrincipalName and MsolAccountSku. So here is the trick-script. $ReportPath = “c:userlist.csv” Add-Content -value (“UserPrincipalName”+”,”+”IsLicensed”+”,”+ “Licenses”) -Path $ReportPath $AllUsers = Get-MsolUser -All foreach ($User in $AllUsers) {  $UserPrincipalName =…

Continue Reading Get all user lisences from Office 365 to csv.

Add all licensed users to a Mail Enabled Security Group and then assign permissions to RecipientType.

Yesterday I had to add all licensed users to a Mail Enabled Security Group and then add that group to Room, Equipment and user mailboxes with desired permissions. To add all Licensed users to a group: $users = Get-MsolUser |…

Continue Reading Add all licensed users to a Mail Enabled Security Group and then assign permissions to RecipientType.

Force Full Password Sync with AAD Connect.

I think this was easier with Dirsync, but that product is history. Open Powershell as Administrator and modify this Powershell script: $Local = “Domain.local” $Remote = “tenant.onmicrosoft.com – AAD” #Import Azure Directory Sync Module to Powershell Import-Module AdSync $OnPremConnector =…

Continue Reading Force Full Password Sync with AAD Connect.

Remove SMTP address for a specific domain from all mailboxes.

Here is a handy script to remove obsolete proxyaddresses from all mailboxes. foreach($i in Get-Mailbox -ResultSize Unlimited) {   $i.EmailAddresses |     ?{$_.AddressString -like ‘*@domain.com’} | %{       Set-Mailbox $i -EmailAddresses @{remove=$_}     } } Just replace the domain.com with…

Continue Reading Remove SMTP address for a specific domain from all mailboxes.