28 January 2019

Check license status of Office 365 Shared mailbox

Shared mailboxes don't require an Office 365 licence. But to avoid any Microsoft weirdness after migrating a Shared mailbox to Office 365, check its licensing status via MSOL PowerShell:

Get-MsolUser -UserPrincipalName jcitizen@example.com |fl *lic*

Both IsLicensed and LicenseReconciliationNeeded should be False.

If LicenseReconciliationNeeded is True, fix e.g. try assigning and removing a license, or converting mailbox to User and back to Shared. Otherwise, if LicenseReconciliationNeeded stays True for 30 days the mailbox will be removed.

Check progress of an Exchange mailbox move request

Get-MoveRequestStatistics -Identity jcitizen@example.com -IncludeReport |fl

Perform an Exchange Discovery Seach

  1. Use an account that has been assigned the Discover Management role and has its own mailbox.

  2. Create a new Discovery mailbox which will hold the results of the search (in a subfolder):

    New-Mailbox -Name MyDiscoverSearchResultsMailbox -Discovery

  3. EAC > Compliance Management > in-please eDiscovery & hold > + new search

  4. Grant access permission for the user who'll access the search results mailbox:

    Add-MailboxPermission "MyDiscoverSearchResultsMailbox" -User "John Citizen" -AccessRights FullAccess -InheritanceType all

Ta, Microsoft.

30 September 2018

20 January 2018

Fix the noisy fan in an HP mini 5102 notebook PC

The HP mini 5102's fan runs excessively, making a lot of noise even when the CPU is idling. It's possible to change the threshold so that it runs quieter and only speeds up the fan when necessary. This is done by editing the ACPI tables.

rar222 provided some excellent information about achieving this here.

7 years later, below is more detail about performing the change.

Note that these steps were done using BIOS "68PGU Ver F.60" - if using a different BIOS version, the line numbers will likely be different.

IMPORTANT: Back up your data first. Incorrect ACPI changes can prevent Windows from booting.

Do these steps from Windows on the HP mini 5102. Tested using Windows 7 Home Premium 32-bit.

  1. Back up your data.

  2. Download "iASL compiler and Windows ACPI tools" from APICA here.

    Unzip to C:\temp\iasl\

  3. Download "Microsoft ASL Compiler v4". It's linked here. But the link doesn't seem to work. So download via an archived page here.

    Run the .msi, by default it will install to C:\Program Files\Microsoft ASL Compiler v4.0\

  4. Dump the DSDT table of ACPI data:

    C:\temp\iasl\acpidump -b

    This will produce a dsdt.dat file in the same directory.

  5. Disassemble the .dat file:

    C:\temp\iasl\iasl.exe -d dsdt.dat

    This will produce a dsdt.dsl file in the same directory.

  6. Open dsdt.dsl in a text editor.

    At line 947 (the "Name (CPFS, Package (0x06)" section), change:

    0x64, 0x5A, 0x50, 0x46, 0x2D, 0x00


    0x64, 0x5A, 0x50, 0x24, 0x12, 0x00
  7. Try to compile it:

    C:\temp\iasl\iasl.exe dsdt.dsl

    There'll be 2 errors, for lines 2262 and 2269 - both "Length" entries.

    Using the values in their respective sections, the Length values need to be changed to "Range Maximum" minus "Range Minimum", plus 1.

    For 2262: 0xFEBFFFFF - 0x00000000, +1 = 0xFEC00000

    For 2269 0xFED44FFF - 0xFED40000, +1 = 0x00005000

    So change line 2262 to 0xFEC00000, and line 2269 to 0x00005000

  8. Compile it:

    C:\temp\iasl\iasl.exe dsdt.dsl

    This will produce a dsdt.aml file in the same directory.

  9. Load the .aml file (compiled table) into the registry. Open command prompt as Administrator, then:

    "C:\Program Files\Microsoft ASL Compiler v4.0\asl.exe" /loadtable "C:\temp\iasl\dsdt.aml"
  10. Restart computer to take effect.

29 October 2017

Search message tracking logs in Exchange 2013+

Because having a GUI would be too easy, use the EMC to search message logs in recent versions of Exchange.

An example of searching for emails from bill@microsoft.com, from 25 Oct 2016 to 27 Oct 2016, outputting to a file:

Get-MessageTrackingLog -ResultSize Unlimited -Start "10/25/2016" -End "10/27/2016" -Sender "bill@microsoft.com" | Select-Object Timestamp,SourceContext,Source,EventId,MessageSubject,Sender,{$_Recipients} | Export-CSV C:\temp\MessageLogResults.txt

(Note that sometimes Microsoft ignores your regional settings and forces you to use the United States date notation.)

It's also the only want to search using a wildcard in older versions of Exchange.

Check for Windows Updates using PowerShell

Windows 10 seems to hide the GUI option to check for updates if it found updates last time. Tell it to recheck using PowerShell:

(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()

Get list of AD users with no lastLogonTimestamp value

Retrieve a list of AD users that don't have a 'last logon' timestamp attribute value:

Get-ADUser -f {-not ( lastlogontimestamp -like "*") -and (enabled -eq $true)} |ft Name, DistinguishedName

17 August 2017

View and remove Where From file metadata on Mac

When downloading a file on macOS, metadata may be added to the file that specifies where the file was downloaded from. This can be seen in the file's Info window:

It can also be viewed from Terminal with:

xattr -lp com.apple.metadata:kMDItemWhereFroms nameoffile.dmg

You can also use the following command to list files in a directory that have various metadata:

ls -l@

To remove the metadata, run the following in Terminal:

xattr -d com.apple.metadata:kMDItemWhereFroms nameoffile.dmg

Ta, robmathers.

31 December 2016

Set ImmutableID for Office 365 user

From the Azure Active Directory command line:

Set-MsolUser -UserPrincipalName "joe@bloggs.com" -ImmutableId "123xyz"

Set to null:

Set-MsolUser -UserPrincipalName "joe@bloggs.com" -ImmutableId "$null"

24 March 2016

If you expect an answer, Microsoft, ask a fucking question.

20 March 2016

List Exchange users that are (or have) delegates

Use this command:

ldifde -f delegates.txt -d "ou=Users,dc=domain,dc=com" -l name,publicDelegates,publicDelegatesBL -r "(|(publicDelegates=*)(publicDelegatesBL=*))"

Cheers, William Lefkovics.

Check progress of PST imports in Office 365

First, get the RequestGUID for the import request (because the ImportRequest name is different from the RequestGUID, even though they look similar):

Get-MailboxImportRequest | ft Mailbox,RequestGUID

Then get the detailed report on that import:

Get-MailboxImportRequestStatistics -Id (The RequestGUID) -IncludeReport |fl

Empty Recycle Bin for all users

From an elevated command prompt:

rd /s c:\$Recycle.Bin

Enable remote administration access from the command line

For tools that use WMI/RPC/DCOM.

netsh advfirewall firewall set rule group="Windows Remote Management" new enable=yes

Remotely log off users

Check the sessions on a remote server:

qwinsta /server:myservername

Kill the session with ID "4":

rwinsta 4 /server:myservername

Access the Exchange Admin Center for Office 365 Small Business

Because Microsoft couldn't be bothered putting a link to it in the Small Business GUI:


19 March 2016

Set Windows proxy settings at the system level

Check the current proxy settings:

netsh winhttp show proxy

Set the proxy settings (bypassing local addresses):

netsh winhttp set proxy myproxyserver:8080 "<local>"

Reset/remove the proxy settings:

netsh winhttp reset proxy

Change SID of Server 2012 R2 machine

If you've cloned a Windows Server 2012 R2 machine, you may need to change its SID:

  1. C:\Windows\System32\Syprep\sysprep.exe - Run As Administrator.
  2. Select "Enter System Out-of-Box Experience (OOBE)", tick "Gereralize", select "Reboot", click OK. The server will restart.
  3. After reboot, follow the Settings wizard.
  4. Set the server's static IP address again, if necessary.

Ta, M Hamizi.