How To: Disable Clutter in Office365

To disable Clutter in Office365 via Powershell, simply do the following:

Connect to Office365 Powershell for your account

Then simply run this command to disable Clutter for all mailboxes:

Get-Mailbox | Set-Clutter –enable $false

That’s it! If you want to disable Clutter for a single mailbox, you can do the following:

Set-clutter -identity user@email.com-Enable $false

To do this via the Office365 Portal, just navigate to: Mail > Automatic Processing > Clutter and turn it off!

How to Find Last Logon Time for Exchange Mailbox Users

The last logon time of an Exchange 2010/2013/2016 mailbox user can easily be found by running the Get-MailboxStatistics cmdlet in the Exchange Management Shell.

 

You can further sort the info by including and running the following command:

Get-MailboxStatistics -Server EXCH | Sort LastLogonTime -Descending

And export it to a CSV by adding an Export-CSV option like below:

Get-MailboxStatistics -Server EXCH | Sort LastLogonTime -Descending | Export-CSV c:\lastlogon.csv

Using WMIC to Uninstall Multiple Versions of Java

I can’t tell you how many times I have logged in to a computer just to see five or more versions of Java installed going back multiple versions. To uninstall ALL of them in one fell swoop without being prompted, I use this command:

wmic product where "name like 'Java%%'" call uninstall /nointeractive

Editing Calendar Permissions in Office365 via Powershell

First you need to connect to Office365.

Next, simply run this commandlet:
Add-MailboxFolderPermission calendar@company.com:\Calendar User guy@company.com AccessRights Author

Your accessrights options are: Owner, PublishingEditor, Editor, PublishingAuthor, Author, NonEditingAuthor, Reviewer, Contributor, AvailabilityOnly, LimitedDetails

If you’d like to get permissions, you can simply use:
Get-MailboxFolderPermission Identity calendar@company.com:\Calendar User guy@company.com

Finally, to remove permissions:

RemoveMailboxFolderPermission Identity calendar@company:\calendar user dude@company.com

Disable the Calendar on a User or Shared Mailbox In Exchange

This works for Office365 or an internal Exchange server to disable the calendar on a Shared Mailbox or User’s Mailbox. First, you’ll have to pull up the Exchange Management Shell. Then run the following commands:

New-OwaMailboxPolicy –Name “New Policy Name”

Creates a new mailbox policy


Set-OwaMailboxPolicy –Identity “New Policy Name” –CalendarEnabled $false

Sets the calendar for all mailboxes under the policy to be off

Set-CASMailbox –Identity “shared mailbox” –OwaMailboxPolicy “newpolicy”

Applies the policy to the mailbox in question

 

Using Dell Command Configure to Enable TPM for Bitlocker

After configuring Wake On Lan via Command Configure in a previous post, I then wanted to enable Bitlocker on the Windows 8 machine. Unfortunately, the Dell laptop did not have TPM enabled in the BIOS, which allows for a secure key to be saved. Command Configure to the rescue!

There are a few commands you have to run. For some reason, Dell requires you to have a BIOS password to enable the TPM. Don’t worry, you can enable it and disable it all at once without needing to reboot the machine. Here is what you need to run:

cctk –setuppwd=biospassword        // This sets a BIOS password

cctk –tpm=on –valsetuppwd=biospassword         // This turns TPM on and provides the BIOS password you set previously

cctk –tpmactivation=activate –valsetuppwd=biospassword          // This activates TPM and provides the BIOS password you previously set

cctk –setuppwd= –valsetuppwd=biospassword          // This removes the BIOS password. Just put one space after the = sign. You need to feed the old BIOS password to make the change.

That is it! You’ll have to restart the computer and Windows will see the TPM device and be able to enable Bitlocker.

Using Dell Command Configure to Enable Wake On Lan (WOL)

I’ve been playing with Dell Command Configure recently and will be doing a few posts on my work.

First up is enabling Wake On Lan (WOL) on Dell Optiplex, Latitude, XPS, Insprion, systems. The main advantage is this can be done remotely, through Windows, and can even be scripted.

You’ll need Dell Command | Configure which you can grab from here. If you are interested in more features, you can read up on the full documentation in the Reference Guide here.

After you install it, you can open the aptly named “Command Configure Command Prompt” tool. From there, you can enter all your arguments that you want to change. To change your Wake On Lan settings, simply type in:

cctk –wakeonlan [enable, disable, enablewakeonwlan, lanorwlan]

The options above are what you can do. You can set it to wake on just wireless, or both wireless and ethernet LAN. For both wlan and lan, your command would be:

cctk –wakeonlan lanorwlan

 

Generate Mailbox Size and Usage Report using PowerShell for Exchange 2010 / 2013

An easy way to get a mailbox usage report is via the Get-Mailboxstatistics commandlet in powershell and a combination of other commands. The below script will output a mailbox usage report in HTML format:

 

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select DisplayName,
TotalItemSize,ItemCount,Database,LastLogonTime,LastLoggedOnUserAccount | Sort
TotalItemSize -Descending | ConvertTo-Html -Title "Mailbox Stats"|
Out-file "C:\MailboxStats.html"

Exchange 2010 Add Mailbox Folder Permissions including Subfolders

I was asked by a user today for access to a specific folder in an old user’s mailbox within Outlook. There were no free computers and so the easy way out of setting up Outlook with the mailbox was not an option. I fired up Google and found this handy script for use in the Exchange Console:

ForEach($folder in (Get-MailboxFolderStatistics AliasofSharer| Where { $_.FolderPath.ToLower().StartsWith(“/Invoices“) -eq $True } ) )
{
$foldername = “AliasofSharer:” + $folder.FolderPath.Replace(“/”,”\”);
Add-MailboxFolderPermission $foldername -User AliasofRequestor-AccessRights PublishingEditor
}

  1. Change the name of the folder to be shared to where Invoices is here: ‘FolderPath.ToLower().StartsWith(“/Invoices“)’
  2. Change ‘AliasofSharer’ to the alias of the user who will be sharing the folder
  3. AliasofRequestor is who will be given access to said folder
  4. In the above example I’ve used PublishingEditor but this can be changed as required.

Adding Registry Entries With Powershell

Working at an MSP, I’ve been trying to script a lot of the repetitious tasks I have to do with Powershell. One of the smaller ones is hiding a local admin account on non domain computers.

Usually, I would have to navigate into the registry to HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon and create a new key, called SpecialAccounts, and then another new key called UserList and then add a new dword value with the name of the account. That’s a lot of work!

Today, I fired up Google and Powershell ISE and came up with this simple, simple script:

New-Item -Path “HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” -Name SpecialAccounts –Force
New-Item -Path “HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts” -Name UserList –Force
New-ItemProperty “HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList” -Name “[LOCAL ACCOUNT NAME]” -Value 1 -PropertyType “DWord”

Saved it as a PS1 script file and ran it on my computer successfully.