Category: Powershell

Add a Group as delegate to Room or Resource mailbox.

Just add universal mail-enabled security group to delegates … well no. Here’s the way… Set-MailboxFolderPermission -Identity “resource_mailbox:calendar” -User “group_to_add_as_delegate” -AccessRights Editor Set-CalendarProcessing -ResourceDelegates “group_to_add_as_delegate” -Identity “resource_mailbox”

Continue Reading Add a Group as delegate to Room or Resource mailbox.

Find all numbers assigned in Lync.

Hi again, This was an excellent script to find all Line Uri’s assigned in Lync for users, response groups and dialin. http://tomtalks.uk/2013/07/get-lyncnumberassignment-find-lync-usersobjects-by-phone-numberlineuri-powershell/

Continue Reading Find all numbers assigned in Lync.

Find Lync user with specific Line Uri

Quick tip of the day! Tried this one?   Get-CsUser –Filter {LineUri –eq “TEL:+3581234567”} And got error: It won’t work. Try this one. Get-CsUser | Where-Object {$_.LineUri -like “TEL:+3581234567”} | ft -property DisplayName, LineURI And all is well!

Continue Reading Find Lync user with specific Line Uri

Clear Exchange 2013 Log Files based on age.

Clear logs in a single Exchange 2013 Server: Set-Executionpolicy RemoteSigned $days=30 #You can change the number of days here $IISLogPath=”C:inetpublogsLogFiles” $ExchangeLoggingPath=”C:Program FilesMicrosoftExchange ServerV15Logging” Write-Host “Removing IIS and Exchange logs; keeping last” $days “days” Function CleanLogfiles($TargetFolder) {     if (Test-Path $TargetFolder)…

Continue Reading Clear Exchange 2013 Log Files based on age.

Add or Remove Bulk permissions to Exchange mailboxes.

Lets see How to Change Calendar Permissions in Bulk . To Restrict Free/busy or Allow Free/busy How to Get Calendar Permissions For a Specific Mailbox ? Default Calendar permissions of a Mailbox Get-MailboxFolderPermission –Identity “EmailAddress”:calendar |fl How to Change (Allow/Restrict)…

Continue Reading Add or Remove Bulk permissions to Exchange mailboxes.

Increase the maximum MAPI session limit from 32 concurrent to 5000 concurrent

Outlook 2013 works differently, but Legacy clients need modifications to server side. In Exchange 2013: Create Throttling Policy and apply it to all mailboxes:

Then add registry key (below is for 5000 concurrent connections): [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeIS\ParametersSystem]”Maximum Allowed Sessions Per User”=dword:00001388…

Continue Reading Increase the maximum MAPI session limit from 32 concurrent to 5000 concurrent

get-aduser old mail-attribute and set-aduser to a new one and keeping the old prefix.

So you have generated users in your ad that you want to move to Office 365. Before you dirsync the user to the Cloud you can change mail-attribute. But after the user in synced to Office365 you cannot do this…

Continue Reading get-aduser old mail-attribute and set-aduser to a new one and keeping the old prefix.

Export biggest mailbox users with attributes to csv!

This is how: Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select DisplayName,servername,database,StorageLimitStatus, @{name=”TotalItemSize (MB)”;expression={[math]::Round((($_.TotalItemSize.Value.ToString()).Split(“(“)[1].Split(” “)[0]. Replace(“,”,””)/1MB),2)}},@{name=”TotalDeletedItemSize (MB)”;expression={[math] ::Round((($_.TotalDeletedItemSize.Value.ToString()).Split(“(“)[1].Split(” “)[0]. Replace(“,”,””)/1MB),2)}},ItemCount,DeletedItemCount | Sort “TotalItemSize (MB)”  -Descending | Export-CSV “C:dirAll Mailboxes_120814.csv” -NoTypeInformation Love it!

Continue Reading Export biggest mailbox users with attributes to csv!

Change upn-suffix for all the users in certain OU

Get-ADUser -Filter {UserPrincipalName -like “*@domain.local”} -SearchBase “OU=whateverisright,DC=contoso,DC=com” | ForEach-Object {     $UPN = $_.UserPrincipalName.Replace(“domain.local”,”newdomain.local”)     Set-ADUser $_ -UserPrincipalName $UPN } Easy as opening a banana, right? https://www.youtube.com/watch?v=nBJV56WUDng 🙂

Continue Reading Change upn-suffix for all the users in certain OU

Find unlicensed users with powershell in Office 365 and apply a license.

If you have many users synced to Office 365. It will be more efficient to user powershell to license them. This is how: connect-msolservice and enter crendentials. Get-MsolAccountSku will display the license types. And then: $AccountSkuId = “tenantname:STANDARDWOFFPACK_STUDENT” $UsageLocation =…

Continue Reading Find unlicensed users with powershell in Office 365 and apply a license.