• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Clatent

Technology | Fitness | Food

  • About
  • Resources
  • Contact

365

Why did I get this email?

March 25, 2024 by ClaytonT Leave a Comment

Here’s the scenario…

An executive forwards an email to your ticketing system and asks why they are receiving it. Then sends another from the day before. There is a Microsoft 365 distribution list(DL) in both emails, but not one they would be on. What do you do?

Check and see if there are any tickets for that DL, and you see there haven’t been any tickets for that DL or even that person. You then check the DL, and indeed see they are in it…. but how?

PowerShell to the rescue! Have you ever used “Search-UnifiedAuditLog” which is a cmdlet for Exchange Online PowerShell? It is a great for one off investigations in 365, but here we will use it to find any admin activity for that user in the past week. Full disclosure, I’ve used it a handful of times and had never really dug into which was a mistake on my part. Knowing more of what it can do now would have saved me so much time on other resolutions where I had gone through the 365 portal. Don’t be me, start using this now and create your own functions as well Purview to save you time and headaches. Enable it now, as it can’t be backdated.

# See if you have it enabled
Get-AdminAuditLogConfig | Format-List UnifiedAuditLogIngestionEnabled

# If not enabled, run this
Enable-OrganizationCustomization

# Enable Audit logs - this can take up to 60 mins
Set-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $true

Hopefully you already have it enabled, or you enabled it right now and can wait for it to start ingesting the logs so when you do need it, it is available.

Back to our executive incident. How do we find out what happened. The quick way is to run:

# Check for all admin activity for named user
Search-UnifiedAuditLog -StartDate 2/1/2024 -EndDate 3/16/2024 -ObjectIds execuser@domain.com

And this is the way I originally did it to get the answer I needed. That’s it! Then you will see in “AuditData” which groups they were added/removed from and any operations that happened with the groups they are in. This broad search will show even more, but only mentioning parts related to this task. At the end of this post I’ll have a list of great resources on how to get granular on your searches.

Now you can see that another engineer accidentally added them(after confirming with engineer), and you can just remove them from the list. This is best case scenario, as if I hadn’t looked and just removed the executive without searching and asking the engineer, they could have been added by a compromised account seeing what kind of privileges they had.

There is a way clean up the audit data so it is easier to view, but that will be in a longer blog post coming soon. Again, I’ll have some links at the end to give you a head start. Honestly, this was only supposed to be a quick one liner post, that definitely grew, and I’ve spent more time than I would like to admit researching it. It has given me more ideas on how to use it and I’ll put together functions in a repository or possibly a module of most useful commands.

One function I’ll be creating is one to check to see if a user has changed their password recently, has multiple failed attempts, and/or if they have locked themself out. How nice would that be for you or your help desk if the function sees who submitted the ticket, runs the function then gives you that feedback? To go one step farther, if they aren’t blocked out, automatically send them the password reset portal to reset their password?

If you already use this, what scripts/functions have you created? I’d love to hear about them, and I can create a repository for us to keep them in one spot.

Useful Links:

Search-UnifiedAuditLog – Microsoft Learn Cmdlet
How it works – Services that support auditing
Detailed info – Detailed Microsoft Script

Hope this helps saving you from headaches and can’t wait to hear how you use it! Have a great day!

Tagged With: 365, AuditLog, Automation, Entra, PowerShell, Reporting, Security

365AutomatedLab V2.8.0 is released and 365 Dev Tenant Announcement Feelings

March 18, 2024 by ClaytonT Leave a Comment

I know it’s been a bit, but life has been a bit hectic. Also a bit saddened about the Microsoft announcement that you can no longer create new Free 365 Dev Tenants. I’m really hoping they revert that decision, or make the Dev Tenant even better. I honestly don’t think it’s a money grab, but more for security. If it is toot easy to create a temp tenant it is a great tool for bad actors. I’ll leave it at that for now, and will probably do a bigger blog post on it in the future.

365AutomatedLab is still here to stay though, as I want to make it quick as possible for you to test any situations you need to, especially if you have to pay for it. As always, you can use these in a production environment for your normal activities, but please test first. If you run into any issues, please create an issue so we can resolve and let others know for their environment.

With that said, you can now add a owner for a group, and if you don’t it will default to the User Principal Name you named in the parameters. It is only for a single owner for now, would you want to have it for multiple owners?

Hope you have a great day 🙂

GitHub: https://github.com/DevClate/365AutomatedLab/tree/main

PowerShell Gallery: https://www.powershellgallery.com/packages/365AutomatedLab/2.8.0

Tagged With: 365, 365AutomatedLab, Automation, PowerShell

365Automatedlab V2.5.0 Released!

January 29, 2024 by ClaytonT Leave a Comment

I wanted to let everyone know that the 365Automatedlab has had a slight update on the validation of parameters. Nothing too crazy, but made sure that it only allowed xlsx files, and that the folder path was correct. Also for some function it will ask you if you want to create that folder path if it doesn’t exist. Would love any feedback!

Updated Features

New-CT365DataEnvironment

  • Will now only allow .xlsx files, and will confirm that the path of where you want to save it is correct.

New-CT365User

  • Will now only allow .xlsx files first, then check if the path is correct

New-CT365Group

  • Will now only allow .xlsx files first, then check if the path is correct

New-CT365GroupByUserRole

  • Will now only allow .xlsx files first, then check if the path is correct

New-CT365SharePointSite

  • Will now only allow .xlsx files first, then check if the path is correct

New-CT365Teams

  • Will now only allow .xlsx files first, then check if the path is correct

Remove-CT365Group

  • Will now only allow .xlsx files first, then check if the path is correct

Remove-CT365GroupByUserRole

  • Will now only allow .xlsx files first, then check if the path is correct

Remove-CT365SharePointSite

  • Will now only allow .xlsx files first, then check if the path is correct

Remove-CT365Teams

  • Will now only allow .xlsx files first, then check if the path is correct

Remove-CT365User

  • Will now only allow .xlsx files first, then check if the path is correct

Export-CT365ProdUserToExcel

  • Will now only allow .xlsx files first, then check if the path is correct

Export-CT365ProdTeamsToExcel

  • Will now only allow .xlsx files first, then check if path is correct

PowerShell Gallery: 365AutomatedLab
GitHub: 365AutomatedLab

Have a great day!

Tagged With: 365, 365AutomatedLab, Automation, Entra, PowerShell, Testing

365Automatedlab V2.4.0 Released!

January 20, 2024 by ClaytonT Leave a Comment

Sorry I haven’t posted much, things have been a bit hectic, and I wish I could say a lot of behind the scene things for 365Automatedlab were because of it, but sadly it isn’t. Overall things are good, and glad to put out v2.4.0 which I’ve added a function to delete all “deleted” SharePoint sites the recycle bin. The reason for it is you can’t mass delete SharePoint sites from the GUI and sometimes you create SharePoint sites that aren’t in your Excel workbook and this just makes it easier.

Also wanted to post that in a few weeks, I’ll be speaking about 365AutomatedLab virtually and once I have all the info, I’ll post it up! Anything in particular you want to see?

PowerShell Gallery: 365AutomatedLab
GitHub: 365AutomatedLab

Have a great day!

Tagged With: 365, 365AutomatedLab, Automation, PowerShell, Sharepoint

365Automatedlab V2.3.0 Released!

December 30, 2023 by ClaytonT Leave a Comment

I had planned to publish an update sooner, but things got a bit crazy. Then I started prepping for my first PowerShell talk and ended up finding things to clean up and improve. I didn’t get much done on my presentation, but at least the module will run better. Hope you enjoy and please leave any feedback!

New Features

Export-CT365ProdUserToExcel

  • Default now includes Developer License
    • Use -NoLicense to remove

Export-CT365ProdTeamsToExcel

  • Exports Channel Type now
  • Exports Channel Descriptions now

Fixes

  • Updated function name for New-CT365DataEnvironment within ps1 file
  • Updated headers in New-CT365DataEnvironment to include Sites and Channels description.
  • Updated formatting of README

PowerShell Gallery: https://www.powershellgallery.com/packages/365AutomatedLab/2.3.0
GitHub: https://github.com/DevClate/365AutomatedLab

Tagged With: 365, 365AutomatedLab, Automation, Entra, PowerShell, Sharepoint, Teams

365Automatedlab V2.2.0 Released!

December 18, 2023 by ClaytonT Leave a Comment

Happy to announce the release of V2.2.0. Going forward I’ll post release updates here as well as on GitHub.

New Features:
New-CT365Teams: Updated to include Teams, Channels, and their owners. Currently it is set for the same owner for all, but will be updating it in the future. If you would like to see that sooner than later, please open an issue on GitHub.

Verify-CT365TeamsCreation: this is a private function to confirm that the Teams team was created successfully.

Breaking Changes:
None – There are no breaking changes in this update

How to use:

New-CT365Teams -FilePath “C:\Scripts\TeamsData.xlsx” -AdminUrl “testenv.sharepoint.com” -DefaultOwnerUPN “admin@testenv.com

This will create all Teams, Teams’ Channels, and set the owner to admin@testenv.com in the TeamsData.xlsx file under the worksheet name “Teams”. You can add more channels if needed if you follow the template and increase the channel number. For example, to add a Third channel, you would add 3 new columns, the first Channel3Name, the second Channel3Description, and the third Channel3Type with there correct value.

How to install:

# Run first if you need to set Execution Policy
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

# Install 365AutomatedLab
Install-Module -Name 365AutomatedLab -Scope CurrentUser

Check out the GitHub Repo: 365AutomatedLab

If you have any questions, concerns, or feature requests, feel free to reach out to me and/or create a GitHub issue. I’m always looking for feedback on how I can improve this module to make it even more useful for you.

Tagged With: 365, 365AutomatedLab, 365Groups, Automation, PowerShell, Sharepoint, Teams

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 4
  • Page 5
  • Page 6
  • Page 7
  • Page 8
  • Page 9
  • Go to Next Page »

Primary Sidebar

Clayton Tyger

Tech enthusiast dad who has lost 100lbs and now sometimes has crazy running/biking ideas. Read More…

Find Me On

  • Email
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter

Recent Posts

  • Learning ValidateSet in PowerShell: Valid Values Only
  • Teams Chat and PowerShell – How to add value!
  • EntraFIDOFinder: New Web UI and Over 70 New Authenticators
  • January 19, 2026 Updates to EntraFIDOFinder
  • v0.0.20 EntraFIDOFinder is out

Categories

  • 365
  • Active Directory
  • AI
  • AzureAD
  • BlueSky
  • Cim
  • Dashboards
  • Documentation
  • Entra
  • Get-WMI
  • Learning
  • Module Monday
  • Nutanix
  • One Liner Wednesday
  • Passwords
  • PDF
  • Planner
  • PowerShell
  • Read-Only Friday
  • Reporting
  • Security
  • Uncategorized
  • Windows
  • WSUS

© 2026 Clatent