Task scheduler – create new task in PowerShell

Task scheduler – create new task in PowerShell
Today, I would like to discuss the topic of creating new tasks in the Windows Task Scheduler, which involves scheduling the execution of specific scripts or programs at a designated time or under certain conditions. In this article, I will demonstrate how to create new tasks in the scheduler using PowerShell, covering both basic and advanced versions.…

Check local administrators – PowerShell

Check local administrators – PowerShell
Often in companies, we encounter a situation where many individuals have local administrator privileges. This results in numerous applications being present on computers that should never be there, significantly increasing the risk of computer infections. I have prepared a simple script that can be included in a GPO (Group Policy Object) to run, for instance, during computer…

Restart in task scheduler – Global Policy Object configuration

Often, when dealing with Windows devices in production, such as terminals on the factory floor, there may be a need for periodic restarts, such as nightly or weekly. The simplest way is to create a scheduled task that will restart the computer at a specified time. But what if we have a large number of computers? You…

Search and remove mails in exchange accounts

Search and remove mails in exchange accounts
In this post, I will show you how to, in the case of receiving a spam message that has been sent to all accounts within our tenant, search for that message and remove it from the mailboxes. As I mentioned in the previous post, we first need to import the ExchangeOnline module and log in to PowerShell…

Search for ExchangeOnline mail rules – PowerShell

Search for ExchangeOnline mail rules – PowerShell
Today's post was inspired by a recent incident where a user clicked on a malicious link, logged in, and as a result, their login credentials were compromised. The attacker, upon gaining access to the mailbox (most likely through automation), creates rules that either delete specific emails, typically those from the IT department or the sender of the…

How to create and configure linux service

How to create and configure linux service
In the previous post, we wrote an HTTP server script that has one drawback - it doesn't start automatically and doesn't work as a service. Here are the steps to configure it as a service in Linux. Script: We already have a startup script named web-server.py. Save it in the directory where it will be permanently stored.…

Simple HTTP server with 208 redirect in Python

Simple HTTP server with 208 redirect in Python
In today's post, I will show you how to start a simple web server that will be accessible within your network, and when users enter its address, they will be redirected to an external address. I created my web server on Debian, and it's written in Python. I used the Flask framework. The server will perform a…

Uptime report – PowerShell

Uptime report – PowerShell
Following the post about the Defender status report in PowerShell, I decided to create a script that will generate a list of servers based on Active Directory data, just like in the previous case, and gather information about the current UpTime and last boot time. In the first step, we need to retrieve a list of computers…

Status report of Defender – Powershell

Status report of Defender – Powershell
Today, I will present you with a script that will retrieve a list of servers from a specified OU in AD and display the status of individual protection options in Defender for them. In the first step, we need to fetch the list of computers or servers. If we have this list in a file, we can…

Exchange Online – report of mailboxes size – PowerShell

Having a large number of test mailboxes can benefit from a report that shows the size of all mailboxes. If you want to check an individual mailbox, you can do it with a single command. [crayon-69e1e9c5d8dc1145175871/] The result of this command will be: What if we have many mailboxes? I've written a script that allows checking the…