PowerShell to Add a Workstation to a User’s Log On To Property

It’s easy enough to use ADUC or ADAC to change the list of computers that a user account is authorized to logon to, but sometimes (like, whenever possible!) you need to use PowerShell. Let’s start by seeing what workstations the user is allowed to logon to now… PS C:\> Get-ADUser jay.test -Properties LogonWorkstations | Format-List Name, LogonWorkstations Name : Jay Test LogonWorkstations : testpc This tells […]

Read Me Leave comment

Faster Exchange Online Message Trace via PowerShell

If you submit a message trace with a custom date via the Exchange Online admin center, you’ll see this message: From there, it can take anywhere from a few minutes to a few hours for your search results to be ready. Or… You can pop over to PowerShell and, after connecting to Exchange Online, run your trace like this: Get-MessageTrace -StartDate 3/22/2017 -EndDate 4/3/2017 -RecipientAddress email@address.com […]

Read Me Leave comment

Search Filenames in PowerShell

If you want to find all files in a particular folder with “hello” in the name, you could use the search function built into Windows Explorer, but if you want to save the list for later, or to send via email, use PowerShell instead. This cmdlet will give you every file (that you have access to list) on the C:\ drive with “hello” in the […]

Read Me Leave comment

Get a Report of All Inactive Office 365 Mailbox Users

This PowerShell script will give you a report of all of your Office 365 mailbox users who haven’t logged in for any given number of days. Once you’ve saved the script to a .ps1 file on your workstation or server, you can run it with just the script name or you can include the number of days inactive as a command-line option. the command-line option is especially […]

Read Me Leave comment

Migrating Distro Groups from Exchange to Office 365, part 4

In steps 4 and 5 of part one I wrote, 4. Delete on-premises groups. After verifying that I had all the data I needed to rebuild them in the cloud (or on-premises if necessary), I removed the original groups… 5. Rename and address online groups. I wrote a third PowerShell script (Address_DistroGroup.ps1) that renames the new online groups to the old on-premises group names and […]

Read Me Leave comment

Migrating Distro Groups from Exchange to Office 365, part 3

In step 2 of part 1, I created online versions of all my on-premises distribution groups: 2. Create groups in Exchange Online. I used the list I created in step 1 to create corresponding groups in Exchange Online, appending ” OL” to the name of each group to avoid conflicts. This is easy enough to do using a formula in Excel to create the PowerShell […]

Read Me Leave comment

Migrating Distro Groups from Exchange to Office 365, part 2

In part one (see here) I mentioned a PowerShell script (Export_DistroGroup.ps1) that I wrote to export certain settings of distribution groups in preparation for migrating them to Office 365. 1. Gather data. I exported a list of all distribution groups and their properties to a csv file. Then I wrote a PowerShell script (Export_DistroGroup.ps1) to export key details to multiple csv files for each group, […]

Read Me Leave comment