msExchRecipientTypeDetails

Object Type RecipientTypeDetails (Decimal Value) User Mailbox 1 Linked Mailbox 2 Shared Mailbox 4 Legacy Mailbox 8 Room Mailbox 16 Equipment Mailbox 32 Mail Contact 64 Mail-enabled User 128 Mail-enabled Universal Distribution Group 256 Mail-enabled non-Universal Distribution Group 512 Mail-enabled Universal Security Group 1024 Dynamic Distribution Group 2048 Mail-enabled Public Folder 4096 System Attendant Mailbox…

7

msExchRemoteRecipientType

When dealing with attributes synced to O365 via FIM \ DirSync \ AAD Sync, you will frequently encounter the msExchRemoteRecipient type attribute, previously empty in on-prem Exchange (only msExchRecipientTypeDetails and msExchRecipientDisplayType had values) the msExchRemoteRecipientType will have the following values depending on the object type and how the mailbox and archive were enabled \ moved…

5

Auto-Licensing script for Office 365

You can use the following script with task scheduler to connect to your tenant via powershell, check for any unlicensed users and apply a license. It will alert via email when the number of free licenses in your tenant falls below a certain number. The script stores the credential password encrypted in a file, so…

5

Group Nesting Powershell report using Quest Activeroles

  I was recently asked to provide a report on the number (and depth) of nested groups in AD. Getting a list of the groups inside a group is pretty simple using get-qadgroupmember <groupname> -type group, however getting the groups inside that group (inside that group) requires some iteration, and can be a bit tricky…

5

DN value in AAD Sync AAD Connect – the NEW format

DirSync \ FIM used to use the Immutable ID value in the Azure connector space, making it somewhat straightforward to search for objects in the Azure CS using the ImmutableID (either copied from MSOL powershell or from the onprem AD ObjectGUID value converted to a Base64 string), however in AAD Sync and AAD Connect the…

4

Powershell Remote User Logoff / Reboot

When patching servers, any disconnected user sessions typically prevent the post-patch auto reboot. To remedy this you could use the following Powershell script :   foreach ($_ in get-content servers.txt) {(gwmi win32_operatingsystem -ComputerName $_).Win32Shutdown(4)}   The script uses an input file named servers.txt populated with the names of all the servers targeted by auto-patching GPOs to…

3

Zipping files older than X days

  Recently I was working with a firewall that wrote some tremendously large log files and was eating disk at an alarming rate, so to remedy this, and sharpen my Powershell pencil, I decided to write a script that could be setup with task scheduler to zip up older logfiles….   The script requires the…

3

Powershell, The Clipboard, and re-living the past …

One of my favorite Powershell features is the ability to export the output of pretty much anything to the clipboard using | clip I've found that piping to clip is much easier than trying to export output to a TXT or CSV file, then finding and opening the file… For those of you who are…

2

AD Attributes that are changed when a mailbox moves to Office 365

There’s not a lot of great documentation available on what values change when an on-prem mailbox moves to the cloud.   The full list is below, but it’s important to note the following values since they are most often missed \ overlooked.   msExchRemoteRecipientType, previously null, will be set to 4   msExchRecipientTypeDetails gets changed from…

2

Fattening up an Exchange mailbox

Sometimes when doing mailbox testing it's necessary to actually bloat a mailbox for the purposes of benchmarking the speed of a mailbox move to Office 365, rather than risk sending sensitive data, or wasting time trying to wrangle up enough PDF or other files, you can use the following PowerShell function and one-liner to create…

1