Category: Powershell

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.

Exchange 2010 – Purge Deleted Items before retention limit kicks in.

Get all users Deleted Items size: Get-MailBox | Get-MailboxStatistics | select DisplayName,TotalDeletedItemSize Get a specific users Deleted Items Size: Get-MailboxStatistics <alias> | select DisplayName,TotalDeletedItemSize Purge All Users Deleted Items: get-mailbox | Search-mailbox -SearchDumpsterOnly -DeleteContent Purge a specific users Deleted Items:…

Continue Reading Exchange 2010 – Purge Deleted Items before retention limit kicks in.

Add SIP address to all users in certain OU

This situation may come true if you have Onpremises Exchange and Online tenant Lync. Then you need to add a SIP address with the same name as the user is in the Online tenant. And here’s the script: $mailboxes =…

Continue Reading Add SIP address to all users in certain OU

Removing the Temporary Attribute from Multiple Files with Powershell

I found this one very helpful in debugging DFS replication with Autodesk generated files. Autodesk products stamp a temporary mark to files it generates. And this causes DFS to stop replicating them. Run this powershell oneliner to clear out the…

Continue Reading Removing the Temporary Attribute from Multiple Files with Powershell

Remote powershell to Lync 2010 / 2013 FE

Connet session: $cred = Get-Credential domainusername $session = New-PSSession -ConnectionURI “https://LYNCFE.FQDN/OcsPowershell” -Credential $cred Import-PsSession $session Disconnect session: Get-PSSession | Remove-PSSession

Continue Reading Remote powershell to Lync 2010 / 2013 FE