Where am I logged into and as Whom?

Applies to: Windows

What are the quickest ways to determine the computer you are logged into, and with which credentials?

1. Determine Computer Name

In Command prompt:

hostname

hostname-cmd

This works equally well in PowerShell.

hostname-ps

2. Determine Logged-In User

whoami

whoami-cmd

Same for PowerShell.

whoami-ps

Display/Remove Full Mailbox Access Permissions

Applies to: Exchange Server 2007

This script displays all the mailboxes within the Exchange Organization where accounts with “admin” in the name have full mailbox access to (change as required):

Get-Mailbox -resultsize unlimited | where {$_.RecipientTypeDetails -eq “UserMailbox”} | get-mailboxpermission | where {$_.User -like “*admin*”} | select Identity, User

To remove the permissions from above command, run the following script:

Get-Mailbox -resultsize unlimited | where {$_.RecipientTypeDetails -eq “UserMailbox”} | get-mailboxpermission | where {$_.User -like “*admin*”} | select Identity, User |

Command to Verify the PowerShell Version

The following command gets you the PowerShell version.

(Get-Host).Version

Get-PowerShell-Version

Upgrade Windows Server 2012 Standard Edition to Datacenter Edition

Do I need to reinstall Windows if I want to upgrade my existing Windows Server 2012 Standard Edition to Datacenter Edition?

The answer is: No. You don’t have to reinstall.

All you need is a licensing change. I’m assuming you have purchased the datacenter license or you have volume licensing.

Step 1 – Determine Upgradability

DISM /online /Get-TargetEditions

Step 2 – Provide Datacenter License Key

DISM /Online /Set-Edition:ServerDatacenter /AcceptEula /ProductKey: (put your datacenter key here)

Step 3 – Reboot
Restart, and you’ll have a successfully upgraded machine.