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

Solving “Access is Denied, Unable to Remove Device”

I recently got stuck trying to remove a printer from a computer with the error “Access is Denied, Unable to Remove Device”. Here is how I fixed it:

First, stop the print spooler by opening an elevated command prompt and entering “net stop spooler” and press enter. Leave the window open.

Then head into the registry to: HKEY_CURRENT_USER\Printers\Connections and delete the offending printer

Next, go back to the command prompt and enter “net start spooler” and press enter.

That should do it!

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

Install Disk Cleanup without Rebooting Server

If you’re on Server 2008R2 and want to install Disk Cleanup, Microsoft tells you to install an update or two, enable a Windows feature, and reboot the server.

What they don’t tell you, but hide on a small TechNet article is that you can “install” disk cleanup yourself by copying two files. Basically, you’ll need to find these two bad boys if you’re running 64-bit Windows:

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe

C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui

The cleanmgr.exe goes in Windows\System32 and the cleanmgr.exe.mui goes into Windows\System32\en-us folder. That’s it!

TechNet article here.

TrashBox on Buffalo Terastation

A client’s backup stopped working and started throwing a bunch of errors. Being Acronis, the errors were extremely not helpful. Finally, I found that the Buffalo Terastation had a little feature where files that were deleted (by Acronis when cleaning up old backups) were not really deleted. They were put in a TrashBox folder.

I found this document here, which highlighted this. http://sg.faq.buffalo-global.com/app/answers/detail/a_id/14207/p/31,32,515,518

If you want to turn this feature off, you can do the following:

Log into the TeraStation’s settings, navigate to Shared Folders – Shared Folder Name, and disable Recycle Bin.

FIX for “There was a problem sending the command to the program”

I encountered this error the other day and hadn’t seen it before:

When starting any office program by opening a file, the user saw: “There was a problem sending the command to the program.” Then when dragging the file to Excel, the file opened fine. What the heck?!

Turns out you have to turn off something called DDE (Dynamic Data Exchange) in the settings. This Microsoft KB article details the problem.

Go to the Office app in question and go to the Options. From there, click on Advanced and make sure “”Ignore other applications that use Dynamic Data Exchange (DDE)” is UNCHECKED like below in my version of Excel 2016.

dde

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

 

Enabling SMB1 or CIFS on Windows Server 2012

Ran into this this week. Even though I hate doing it and definitely don’t recommend it, I had to enable CIFS on a Server 2012 instance. To do this, you first have to install the “SMB 1.0/CIFS File Sharing Support” Feature, and then do the following:

Open the Registry Editor, go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer and change the value of DependOnService from SamSS Srv2 to SamSS Srv.

Reboot the server and that’s it! Enjoy your legacy application / device!