April 19, 2018

ReFS - High RAM usage

How to identify and fix high RAM usage on Windows Server 2016 due to ReFS? 

As you can see from Task Manager, 5GB is allocated in non-paged pool. This memory is used by kernel and device drivers.

This also can be checked by RamMap tool.

Use poolmon.exe tool from WDK to identify what components are using most of memory. Run "poolmon.exe -u -p" in elevated command prompt. 

Then use findstr tool to find out what device drivers are under MSb+, MSde and MStb tags. Simply run "findstr /m /l /s MSb+ *.sys". Replace Tag name for each search.

As you can see 4.5GB is allocated by ReFS component. This behavior is expected and fixed by KB4013429. More details can be found in here.

April 11, 2018

Azure - Find empty Resource Groups

How to identify empty Resource Groups in Microsoft Azure using PowerShell?
Login-AzureRmAccount
$AllRGs = (Get-AzureRmResourceGroup).ResourceGroupName
$RGsWithResources = (Get-AzureRMResource | Group-Object ResourceGroupName).Name
$AllRGs | Where-Object {$_ -notin $RGsWithResources}

Azure AD Connect - Change UPN

How to change User Principal Name attribute for synchronized user?

Set-MsolUserPrincipalName -UserPrincipalName "name@example.com" -NewUserPrincipalName "newname@example.com"

Note: “User Account Administrator” role is enough to perform this action.

Alternatively, you can enable UPN synchronization via SynchronizeUpnForManagedUsers feature:

Set-MsolDirSyncFeature -Feature SynchronizeUpnForManagedUsers -Enable $True

After activating this feature, when you change UPN on premises it will sync all the changes to the Office 365.