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

Clatent

Technology | Fitness | Food

  • About
  • Resources
  • Contact

Reporting

One-Liner Wednesday January 18, 2023

January 18, 2023 by ClaytonT 2 Comments

Do you use 365? Ever needed a quick list of all your users and their mailbox size? What about having it nicely formatted? Or do you only want to see a certain size mailbox? This quick one-liner is a good starting point.

Get-EXOMailbox -ResultSize Unlimited | Get-EXOMailboxStatistics | Select DisplayName, ItemCount, TotalItemSize | Sort-Object TotalItemSize -Descending | Export-Excel -Path C:\scripts\MailboxSizes.xlsx -AutoSize

What this does is uses the current way to get a 365 mailbox(Get-mailbox is deprecated), grabs all the mailboxes, selects only the Display name, amount of emails, and total size of their mailbox. It will then put the largest mailbox at the top and smallest at the bottom. After all of that, it exports it to an excel file that you can manipulate how you like. If you haven’t already used Doug Finke’s ImportExcel module, I’d recommend it to get creative with your formatting without ever opening Excel to format. You could add it so all mailboxes over a certain size are a certain color.

Hope this helps let me know if you expand on this even if its not a one liner, I’d love to see!

Tagged With: 365, Exchange, One Liner Wednesday, PowerShell, Reporting

Read-Only Friday December 30, 2022

December 30, 2022 by ClaytonT Leave a Comment

Last Read-Only Friday of the year! I’m hoping you have enjoyed these, One Liner Wednesday, and Module Monday this year. I’ve enjoyed creating them and hearing how helpful they have been for you this year. Don’t worry they will be coming back for 2023. I may be making some changes a bit, but only for the better. Are there any topics, concepts, and/or modules you’d like me to cover in 2023? I’ve already started a list, but would love your input on things you’d like to see, as I know it would help others as well.

And for today’s Read-Only Friday?? If you don’t have any deadlines you need to get done by today… just relax. Look over some documentation, check on all your systems, ensure everything is working. If everything is… take screen shots and take photos where necessary so you have a last known working configuration of each. These can save you hours of time if someone bumps a wire by accident or if a vendor moves something they shouldn’t have, you can match up to these photos/screenshots/configs and see what has changed. Other than that, enjoy your day and have a great and safe weekend!

Tagged With: Automation, PowerShell, Reporting

One-Liner Wednesday December 28, 2022

December 28, 2022 by ClaytonT Leave a Comment

Today’s one-liner Wednesday will be great for system admins that need to see when and which updates were installed on a single server or multiple servers. It’s a quick and dirty way to do it, and I’m going to look around and see if there is a one with better formatting, but this gets the job done for now.

If you only need updates on one computer for the month of September 2022, this is all you need to do.

Export-InstalledPatchTOPDF -ComputerName localhost -month 9 -Year 2022

If you need multiple computers and want for a whole year, you would write this.

Export-InstalledPatchTOPDF -ComputerName localhost, server01, server02, server03 -Year 2022

And that’s it. As mentioned the output formatting could be a little better, but the functionality is great, and will reach out to him to see if he will be fixing it. If not, I’ll definitely be looking for another option.

PowerShell Gallery:
ExportInstalledPatchToPDFUpdated

Blog:
Prakash78

Tagged With: Automation, One Liner Wednesday, PowerShell, Reporting, Windows Server

Module Monday December 19, 2022

December 19, 2022 by ClaytonT Leave a Comment

Today’s Module Monday may be targeted towards a certain vendor, but I know there are comparable modules out there for other vendors. I’ll admit I haven’t used this one, but it looks like a great module to use and if you find any issues to let the creator know on their GitHub. Always make sure to open issues on GitHub, no matter how small. The creator probably doesn’t even know there is an issue and will be thankful for you bringing it up and even more if you can tell them how to fix it.

With all that said, I guess you want to know the module? The module is LSUClient. What it does is it allows you automate driver, BIOS/UEFI, firmware and utility software updates for Lenovo computers. Best part is it can be done silently and unattended to remote computers with only the files they need. If you have a bunch of non internet computers, you can save them to a repository on your network that they can reach or even USB drive.

Think the next time you have to update drivers how much easier it will be to grab and push them. You can even run this in SCCM, MDT, PDQ, or any other remote deployment software. Let PowerShell do the heavy lifting of these kind of tasks to give you more time in the day to work on more important projects.

PowerShell Gallery:
LSUClient/1.5.0

GitHub:
LSUClient

Tagged With: BIOS, Firmware, Lenovo, PowerShell, Reporting

Read-Only Friday November 25, 2022

November 25, 2022 by ClaytonT Leave a Comment

I know a lot of US workers have off today, but still wanted to post something as I know there are still many working and others who may have a little extra free time for learning. For today’s ROF, it really is a module or should I say modules, but the solution from these modules could be so helpful, I didn’t want someone to miss it.

The creator is called AsBuiltReport, which they have designed As Built Reports for different software and systems which you can customize what you want to see on the report and what thresholds should be for pass/fail.

Another way I could see using this to do to monthly/weekly/daily checks on your systems, and see if anything has been changed, but not only that, for certain(or all) systems it automatically changes back to the standard settings that it should be.

GitHub:

https://github.com/AsBuiltReport

Tagged With: AD, Fortinet, Nutanix, PowerShell, Read-Only Friday, Reporting, VMWare, Windows Server

One-Liner Wednesday November 23, 2022

November 23, 2022 by ClaytonT Leave a Comment

As we are approaching the holiday season  at the end of the year, dates are very important. Everything from counting down the days to the new year to creating those end of the year reports.

With that said, how many times have you had to create a report for the previous month, but it’s  parameters are only StartDate and EndDate? Now, you have to remember how many days are in that month and consider if it’s a leap year or not. And sometimes the first of the month is on a weekend, Holiday, or a day you took PTO so you have to make sure your code doesn’t just go back 30 days as then it may or may not get the whole previous month.  And let’s say for reasons you can’t control,  you can’t have it as a scheduled task to always run on the first of the month?

This one liner(technically 2 one for StartDate and one for EndDate), is the solution you need. It will check which month your in, go to the previous month then find the first and last day of that month. That’s it!

$StartDate = (Get-Date -Day 1).AddMonths(-1).ToString("yyyy-MM-dd")

$EndDate = (Get-Date -Day 1).AddDays(-1).ToString("yyyy-MM-dd")

If you wanted the past 6 months you could change the -1 to -6 in Start Date. Now you don’t have to manually enter the month date range every time you need a report for the previous month. You could set this as the default parameter, but give yourself the option to change it if you need a different date range.

Documentation:

Get-Date:
Microsoft Learn

Tagged With: Get-Date, One Liner Wednesday, PowerShell, Reporting

  • Go to page 1
  • Go to page 2
  • 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

  • One-Liner Wednesday January 25, 2023
  • Module Monday January 23, 2023
  • One-Liner Wednesday January 18, 2023
  • Module Monday January 16, 2023
  • Read-Only Friday January 13, 2023

Categories

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

© 2023 Clatent