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

Clatent

Technology | Fitness | Food

  • About
  • Resources
  • Contact

Entra

2.9.0 Released and Big Update

April 19, 2024 by ClaytonT Leave a Comment

I know it’s been a month, all good though! I think I may start doing monthly release, what are your thoughts? I was going to do every 2 weeks, but not sure if that is too quick.

Big update as I’m starting to make it more production environment ready, not that you can’t use it in production now, but I want to add a lot more parameters for the cmdlets. I need your help, please let me know what parameters are most important and feel free to make a contribution. I’m definitely open to PRs.

The reason for this switch is from the Microsoft Developer Tenant not accepting any new tenants, and want to help out the engineers that can’t get a test tenant, but want a way to mass add and remove objects in their 365 production tenants safely.

With that said, your feedback is even more important now as we don’t want to break anyone’s tenant 🙂

Now for the updates:

2.9.0

Updated Features

New-CT365User

  • CompanyName
  • EmployeeHireDate
  • EmplyeeId
  • EmployeeType
    • Employee, Contractor, Consultant, or Vendor.
  • FaxNumber

New-CT365DataEnvironment

  • CompanyName
  • EmployeeHireDate
  • EmplyeeId
  • EmployeeType
  • FaxNumber

Export-CT365ProdUserToExcel

  • CompanyName
  • EmployeeHireDate
  • EmplyeeId
  • EmployeeType
  • FaxNumber

365DataEnvironment.xlsx

  • CompanyName
  • EmployeeHireDate
  • EmplyeeId
  • EmployeeType
  • FaxNumber

Hope this helps you out and have a great day!

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

Tagged With: 365, 365AutomatedLab, Automation, Entra, Module Monday, PowerShell

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.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.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

Getting Started with 365AutomatedLab Part 2

October 6, 2023 by ClaytonT Leave a Comment

Adding/Removing Groups

Adding and removing groups with 365AutomatedLab is as easy as it is for adding and removing users(If you missed part one, check out Getting Started with 365AutomatedLab Part 1) It can add and remove the 4 different groups(Group, Mail Enabled Security, Distribution, and Security) that 365 has from one excel sheet. As of right now it will fill in the Display Name, Primary SMTP, and Description. I’ll be adding more parameters, but wanted to get at least these available. What are some other parameters you want to see first?

Adding Groups

Now the fun part, adding groups with one line of code. But, first we need to have a worksheet named “Groups” with the column headers

  • DisplayName
  • PrimarySMTP
  • Description
  • Type

After you have created those, you can input the data that you want in those fields. Remember for type you will use 365Group, 365MailEnabledSecurity, 365Distribution, or 365Security, which will tell 365 what type of group you want created. If you don’t have test data feel free to go to the already premade Excel workbook in the LabSources section in the repository. Below is a quick snapshot of the Excel workbook.

Data all set? Let’s run this little One-Liner to import all these groups into 365!

New-CT365Group -FilePath C:\\Scripts\\LabSources\\365DataEnvironment3.xlsx -UserPrincipalName admin@yourdomainname.onmicrosoft.com -Domain yourdomainname.onmicrosoft.com

Depending on when you last logged in, you’ll have to confirm access twice, once for Exchange Online and once for Graph. If you don’t allow these, the script will look like it froze on you. Trying to save you some of the headaches that I went through!

Your 365 Portal should now look like this

All set! That’s really how easy it is!

Removing Groups

The beauty of this setup, is now you only have to one PowerShell command, and you are all set.

Remove-CT365Group -FilePath C:\\Scripts\\LabSources\\365DataEnvironment3.xlsx -UserPrincipalName admin@yourdomainname.onmicrosoft.com

All done, now all your groups in your Excel workbook are removed!

Summary

Wasn’t it easy? Testing larger data sets will be a breeze or setting up and removing tests. You should never have to test in a production environment, as you can copy those groups to the Excel workbook and import them into your Dev tenant. I hope you found this helpful and makes your life easier as it has mine. If you have any recommendations or questions, please feel free to reach out and/or create a Github Issue.

GitHub: 365AutomatedLab

Tagged With: 365, 365AutomatedLab, Automation, AzureAD, Entra, Excel, PowerShell

  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3

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

  • New EntraFIDOFinder Module Version Release!
  • Did you know there is a Giphy rating in Teams? Custom Maester Tests save the day
  • Learning ValidateSet in PowerShell: Valid Values Only
  • Teams Chat and PowerShell – How to add value!
  • EntraFIDOFinder: New Web UI and Over 70 New Authenticators

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