Author: jetnmariano

  • Best Infrastructure as Code (IaaC) Samples with Real-World Explanations

    Introduction

    Infrastructure as Code (IaaC) has transformed how organizations deploy, configure, and manage their environments.
    Instead of manual configurations, IaaC enables repeatable, secure, and scalable deployment processes β€” using code.

    In this post, I share real-world IaaC examples that professionals can apply across cloud and on-premises environments.


    1. Azure Virtual Machine Deployment using PowerShell (ARM Templates Alternative)

    Scenario:
    Spin up a virtual machine (VM) on Azure with custom settings β€” OS type, disk size, networking β€” in a repeatable, automated way.

    Sample Command:

    powershellCopyEditNew-AzVM `
      -ResourceGroupName "ProductionRG" `
      -Name "WebServer01" `
      -Location "EastUS" `
      -VirtualNetworkName "ProdVNET" `
      -SubnetName "WebSubnet" `
      -SecurityGroupName "WebSG" `
      -PublicIpAddressName "WebPublicIP" `
      -Image "Win2022Datacenter"
    

    Explanation:
    Instead of manually clicking through Azure Portal, this script launches a new production-ready VM within seconds.
    This reduces human error and ensures configuration consistency.


    2. On-Premises VMware VM Deployment via PowerCLI

    Scenario:
    Provision a Windows Server virtual machine in a vSphere datacenter using PowerShell.

    Sample Command:

    powershellCopyEditNew-VM -Name "SQLServer02" `
      -ResourcePool "ProductionPool" `
      -Datastore "Datastore01" `
      -Template "Win2022Template" `
      -VMHost "esxi01.mydomain.local"
    

    Explanation:
    This PowerCLI script clones a preconfigured template, attaches storage, and places the VM into a production cluster β€” all in one shot.
    Perfect for disaster recovery planning or rapid server scaling.


    3. Microsoft 365 User Creation with PowerShell

    Scenario:
    Automate user onboarding in Azure Active Directory + Microsoft 365.

    Sample Command:

    powershellCopyEditNew-MsolUser `
      -UserPrincipalName "[email protected]" `
      -DisplayName "New User" `
      -FirstName "New" `
      -LastName "User" `
      -LicenseAssignment "company:ENTERPRISEPACK"
    

    Explanation:
    Instead of manually adding users through the Microsoft 365 Admin Center, this IaaC approach ensures users are created consistently β€” with proper licensing attached β€” even in bulk.


    4. Azure Resource Group + Storage Deployment with Bicep

    Scenario:
    Provision an entire Resource Group with a Storage Account using Bicep (Azure’s new declarative IaaC language).

    Sample Bicep Code:

    bicepCopyEditresource storage 'Microsoft.Storage/storageAccounts@2022-05-01' = {
      name: 'appstorage${uniqueString(resourceGroup().id)}'
      location: resourceGroup().location
      sku: {
        name: 'Standard_LRS'
      }
      kind: 'StorageV2'
    }
    

    Explanation:
    Bicep simplifies complex Azure deployments.
    You can version-control your cloud architecture like you would application code.


    5. Automating Cisco Meraki Network Device Configuration

    Scenario:
    Automate bulk configuration of Meraki MX Firewalls or APs across multiple branches.

    Sample API Call (Python):

    pythonCopyEditimport meraki
    
    dashboard = meraki.DashboardAPI(api_key='YOUR_API_KEY')
    
    response = dashboard.devices.updateDevice(
        serial='Q2XX-XXXX-XXXX',
        name='Branch1-Security-Appliance',
        tags=['branch', 'security'],
        address='123 Main St, City, State'
    )
    

    Explanation:
    Using APIs, infrastructure configuration is no longer limited to traditional servers.
    Networking devices β€” switches, firewalls, access points β€” are now part of your automated deployments.


    ✨ Conclusion

    Infrastructure as Code isn’t just for large enterprises β€” it’s for any IT professional who wants to:

    • Eliminate manual errors
    • Speed up deployments
    • Strengthen disaster recovery
    • Make infrastructure truly agile

    Starting small β€” with a few PowerShell scripts, Bicep templates, or API automations β€” leads to major efficiencies over time.

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • Infrastructure as Code (IaaC): Automate Your Cloud

    Title:
    Infrastructure as Code (IaaC): Building Cloud Systems at Scale

    Post Content:

    Infrastructure as Code (IaaC) revolutionizes how IT professionals deploy, configure, and manage infrastructure. Instead of manual setup, we automate cloud deployments using code β€” making environments consistent, scalable, and easily repeatable.

    Why IaaC Matters:
    πŸ”Ή Eliminates manual errors and configuration drift
    πŸ”Ή Accelerates deployment speed across environments
    πŸ”Ή Enables disaster recovery through codified infrastructure templates

    Common IaaC Tools and My Use Cases:

    • Azure Bicep: Streamlined Azure resource deployments (VMs, Storage, VNets)
    • Terraform: Multi-cloud infrastructure (Azure, AWS, GCP) with modular design
    • PowerShell + ARM Templates: Quick deployment of M365, networking, and security resources
    • GitHub Actions: IaaC pipelines for automated build and deployment

    My Approach:
    I apply IaaC principles to automate cloud foundation buildouts, strengthen disaster recovery plans, and accelerate proof-of-concept (POC) rollouts for critical projects.

    πŸ”— See Best Infrastructure as Code (IaaC) Samples

    πŸ”— Related: See my PowerShell Toolbox for essential automation scripts and CTS Collaboration Guide.

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • Cross-Tenant Sync (CTS): How to Securely Share Resources Across Azure Tenants

    Title:
    Learn how Cross-Tenant Synchronization (CTS) works in Azure AD to enable secure user sharing, collaboration, and productivity across organizations.

    Post Content:

    In today’s hybrid environments, collaboration often extends beyond a single organization. Cross-Tenant Synchronization (CTS) enables seamless sharing of users, groups, and resources across multiple Microsoft 365 tenants without compromising security.

    Why CTS Matters:
    πŸ”Ή Supports hybrid mergers, acquisitions, and strategic partnerships
    πŸ”Ή Reduces manual duplication of users and permissions
    πŸ”Ή Enhances Microsoft Teams B2B collaboration without exposing internal directories

    How CTS Works:
    βž” Synchronizes selected users/groups from one tenant to another (one-way or bidirectional)
    βž” Integrates with Azure AD B2B Collaboration and Conditional Access policies
    βž” Helps manage guest access more securely and systematically

    My Experience with CTS:
    I’ve implemented CTS workflows to securely connect environments during M&A transitions, partner onboarding, and hybrid workforce expansion. It strengthened collaboration while maintaining strict identity governance policies.

    πŸ”— Related: Learn more about B2B Collaboration and Infrastructure as Code (IaaC).

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • April 26, 2025 Blog: What Is SIEM? Why It Matters and How to Implement It

    Why SIEM matters:
    Security Information and Event Management (SIEM) provides centralized visibility into security alerts, system logs, and suspicious activities β€” helping organizations detect and respond to threats faster.

    What SIEM solves:

    • Detects intrusions and anomalies in real time
    • Helps meet compliance standards like HIPAA, PCI-DSS, and SOX
    • Centralizes event monitoring across hybrid cloud and on-premises environments

    How to Implement SIEM:

    • Deploy Azure Sentinel for cloud-native SIEM integration
    • Integrate Cisco Meraki logs, VMware security logs, and endpoint protection (XDR) tools like Palo Alto
    • Set up detection rules, incident response playbooks, and dashboards
    • Full SIEM Implementation Guide with PowerShell

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • Weekly IT Blog

    Weekly IT Blog

    Welcome to my personal blogβ€”a space where I share real-world IT strategies, PowerShell automation, and cloud projects alongside life reflections, spiritual insights, and personal milestones.

    From scripting fixes to soul-deep realizations, each post reflects what I’ve learned in both the server room and the quiet room. Whether you’re here for the tech or the testimony, there’s something here for you.

    βž” Check out my PowerShell Toolbox for essential automation scripts.

    Weekly Posts on IT, Life Lessons, and Inner Strength

    πŸ’» Oct 06, 2025 A 10-Command Playbook to Stop Email Impersonation

    πŸ’» Oct 04, 2025 Pulling M365 Sign-in Locations via AzureADPreview

    πŸ’» Oct 01, 2025 Restoring Delivery Safely: SCL-1 + Tenant Allow/Block List

    πŸ’» Sep 29, 2025 Beat the 99% Wall: Upgrade Windows 10 β†’ 11 the Easy Offline Way (Do This Before Oct 5, 2025)

    πŸ’» Sep 24, 2025Email Offboarding: Forward for 14 Days β†’ Then Retire the Mailbox (No Shared Mailboxes)

    πŸ’» Sep 19, 2025Cloning a VM with PowerShell and VMware PowerCLI

    πŸ’» Sep 14, 2025Fixing a β€œSender not allowed” Everyone DL

    πŸ’» Sep 9, 2025Ops Note β€” Picking the best vSAN host with one PowerCLI check

    πŸ’» Sep 4, 2025Fixing β€œSender not allowed” to an internal group (Exchange Online) β€” a quick forensic + runbook

    πŸ’» Sep 1, 2025Outlook Won’t Send, Can’t Search, or Stuck on β€œUpdating”? A One-Page Fix (for Everyone)

    πŸ’» Aug 31, 2025 When a β€œMicrosoft” alert hijacks your screen after a spoofed Facebook call

    πŸ’» Aug 25, 2025 PC Suddenly Slow? Here’s a 60 seconds triage before calling IT

    πŸ’» Aug 21, 2025 – Secure Azure setup with Entra ID, Bastion, and private VM

    πŸ’» Aug 18, 2025 β€” Hot-cloning a Running Windows 11 VM in vSphere

    πŸ’» Aug 14, 2025 β€” The Cloud Above Us AWS, Azure, GCP

    πŸ’» Aug 10, 2025 Blog: Secure Automation with PowerShell SecretManagement: Simplifying Credential Management for IT Pros

    πŸ’» Aug 5, 2025 Blog:Migrating Azure AD Scripts to Microsoft Graph PowerShell: A Practical Guide for IT Administrators

    πŸ’» July 29, 2025 Blog:Fixing Disabled Azure AD Accounts: PowerShell vs Portal

    πŸ’» July 25, 2025 Blog:How to Bypass Spam Filtering for Internal Senders Using PowerShell

    πŸ’» July 20, 2025 Blog:Because I Have Been Given Much, I Too Must Give

    πŸ’» July 16, 2025 Blog:Ransomware: What It Is and How I Survived Multiple Attacks

    πŸ’» July 12, 2025 Blog:From IIS Logs to Iron Discipline: How My Son and I Share the Same Grit in Fitness and IT

    πŸ’» July 8, 2025 Blog: Where I Leave the Past, and Meet Myself Again

    πŸ’» July 4, 2025 Blog:I Am Grateful to Be in the Land of the Free and Home of the Brave

    πŸ’» June 27, 2025 Blog:When the Strong Get Tired: Finding Strength in the Silence

    πŸ’» June 22, 2025 Blog:Please Wait: When the Helper Needs Help

    πŸ’» June 15, 2025 Blog:A Father’s Day Flashback – Pancakes, Peter Pan, and a Heart Full of Memories

    πŸ’» June 8, 2025 Blog:Why I Still Use PowerShell Every Week

    πŸ’» June 1, 2025 Blog: The Ultimate IT Troubleshooting Framework

    πŸ’» May 25, 2025 Blog: 5 Essential Cloud Solutions for IT Admins

    πŸ’» May 18, 2025, 2025 Blog:Strength Is Survival

    πŸ’» May 10, 2025, 2025 Blog:How I Deployed and Cleaned Up a Windows Server VM in Azure with PowerShell

    πŸ’» May 2, 2025, 2025 Blog:The Price of Gaining Respect in the IT World
    πŸ’» April 26, 2025 Blog: What Is SIEM? Why it matters, what it solves, and how to implement it effectively.

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • Track Domain-Joined Devices by Join Date Using PowerShell

    When you’re managing hundreds of devices in an Active Directory environment, tracking when a machine joins the domain can help in everything from license compliance to forensic investigations.

    Recently, I needed to identify a laptop that joined our domain on a specific date to verify a SolidWorks license assignment β€” and these two PowerShell commands did the job flawlessly.


    πŸ”Ή 1. Get the Most Recently Joined Computer

    Use this command to find the latest computer object added to Active Directory:

    powershellCopyEditImport-Module ActiveDirectory
    
    Get-ADComputer -Filter * -Property whenCreated |
    Sort-Object whenCreated -Descending |
    Select-Object Name, whenCreated -First 1
    

    Why this matters:
    This is especially useful when onboarding new machines or auditing join activity after reimaging.


    πŸ”Ή 2. Find Devices Joined on a Specific Date

    To find any computer joined on a specific day β€” for example, April 25, 2025 β€” use:

    powershellCopyEdit$startDate = Get-Date "04/25/2025 00:00:00"
    $endDate = Get-Date "04/26/2025 00:00:00"
    
    Get-ADComputer -Filter * -Property whenCreated |
    Where-Object { $_.whenCreated -ge $startDate -and $_.whenCreated -lt $endDate } |
    Select-Object Name, whenCreated |
    Sort-Object whenCreated
    

    Why this helps:
    Perfect for license verification, asset tracking, or validating compliance windows. You can adapt the date range to capture entire weeks, weekends, or even off-hours join attempts.


    πŸ” Final Thought

    Even a simple attribute like whenCreated becomes a powerful audit tool when combined with the right script. These commands now live in my PowerShell toolbox β€” and they just helped solve a license tracking challenge without any guesswork.


    βœ… Add these to your script collection.
    βœ… Automate the insight.
    βœ… Stay ahead of the curve.

  • PHP + SQL Demo: Simple Form with Database Insert

    Welcome to Projects
    This demo showcases a simple PHP + SQL form that inserts user data into a database. Whether you’re just starting out in development or refreshing your backend skills, this lab will help you understand the fundamentals of handling form data securely and efficiently.

    Let’s dive into the code and see how the magic happens!

    <!-- index.php -->
    <form method="post" action="insert.php">
      <label for="name">Name:</label><br>
      <input type="text" id="name" name="name" required><br><br>
      
      <label for="email">Email:</label><br>
      <input type="email" id="email" name="email" required><br><br>
      
      <input type="submit" value="Submit">
    </form>
    
    <!-- insert.php -->
    <?php
    $servername = "localhost";
    $username = "root"; // change as needed
    $password = ""; // change as needed
    $dbname = "demo_db"; // make sure this DB exists

    // Create connection
    $conn = new mysqli($servername, $username, $password, $dbname);

    // Check connection
    if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
    }

    // Sanitize inputs
    $name = htmlspecialchars($_POST['name']);
    $email = htmlspecialchars($_POST['email']);

    // Prepare and bind
    $stmt = $conn->prepare("INSERT INTO users (name, email) VALUES (?, ?)");
    $stmt->bind_param("ss", $name, $email);

    if ($stmt->execute()) {
    echo "New record created successfully.";
    } else {
    echo "Error: " . $stmt->error;
    }

    $stmt->close();
    $conn->close();
    ?>


    Stay tunedβ€”next time we’ll connect this form to a hosted SQL database and sanitize inputs using prepared statements. This is just the beginning of your full-stack journey!

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • PowerCLI: Cloning and Deleting VMs

    In addition to monitoring, managing VMs is a key task for administrators. Below are simple PowerCLI commands for cloning and deleting VMs.

    Cloning a VM

    $sourceVM = Get-VM -Name "template-vm"
    $targetHost = Get-VMHost -Name "esxi-host-01"
    $datastore = Get-Datastore -VMHost $targetHost | Where-Object {$_.Name -like "vsanDatastore"}
    
    New-VM -Name "cloned-vm" `
           -VM $sourceVM `
           -VMHost $targetHost `
           -Datastore $datastore `
           -ResourcePool ($targetHost | Get-ResourcePool)

    Deleting a VM

    Get-VM -Name "cloned-vm" | Remove-VM -DeletePermanently -Confirm:$false

    These commands are especially useful for lab environments or when automating template-based VM provisioning.


    Conclusion Use this PowerShell command as part of your regular cluster health checks. When combined with vCenter’s vSAN resync and health dashboards, it gives you the full picture to maintain optimal performance and avoid storage imbalances.

    Stay tuned for a follow-up post on triggering manual rebalancing using RVC (Ruby vSphere Console).

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • Monitoring vSAN Host Resource Usage with PowerShell

    Introduction: Keeping your vSAN environment healthy and balanced is critical to maintaining performance and avoiding bottlenecks. One of the best ways to stay ahead of potential issues is by proactively monitoring your ESXi host’s CPU and memory usage using PowerShell and PowerCLI. In this post, we’ll walk through a script that provides a quick overview of resource usage across your vSAN cluster β€” a valuable step before deciding whether to initiate a manual rebalance.


    PowerShell Script to Monitor vSAN Host Resource Usage

    Get-VMHost | Select Name, `
        @{N="CPU Usage MHz"; E={($_.CpuUsageMhz)}}, `
        @{N="Total CPU MHz"; E={($_.CpuTotalMhz)}}, `
        @{N="Memory Usage GB"; E={[math]::Round($_.MemoryUsageGB, 2)}}, `
        @{N="Total Memory GB"; E={[math]::Round($_.MemoryTotalGB, 2)}}

    Sample Output

    Host NameCPU Usage MHzTotal CPU MHzMemory Usage GBTotal Memory GB
    esxi-host-016,405115,168151.94511.71
    esxi-host-027,148115,168199.02511.71
    esxi-host-032,089115,168124.49511.71

    What This Tells You

    • CPU Load: In the sample output, CPU usage is consistently low (<10%), meaning the compute load is healthy.
    • Memory Load: Memory usage ranges from ~24% to ~39%, suggesting room for optimization or upcoming load balancing.

    When to Rebalance

    If you see disproportionate usage β€” for example, one host consistently nearing 80%+ memory while others are underutilized β€” it may be time to initiate a vSAN rebalance.

    This script gives you the confidence to proceed with rebalance safely during production hours, especially when CPU usage is low and no resync activities are ongoing.


    Conclusion Use this PowerShell command as part of your regular cluster health checks. When combined with vCenter’s vSAN resync and health dashboards, it gives you the full picture to maintain optimal performance and avoid storage imbalances.

    Stay tuned for a follow-up post on triggering manual rebalancing using RVC (Ruby vSphere Console).

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • The Importance of SIEM, APM, and Privileged Access Management in Modern IT Security

    Introduction

    In today’s digital landscape, cybersecurity is more than just antivirus software and firewallsβ€”it’s about layered security across endpoints, networks, identities, and applications. With cyber threats evolving daily, businesses must adopt proactive monitoring and defense mechanisms. This is where Security Information and Event Management (SIEM), Application Performance Monitoring (APM), and Privileged Access Management (PAM) come into play.

    This guide will cover the importance of these tools, best practices, and how to integrate them with enterprise-grade security solutions like Cisco MX, Cisco Umbrella, CyberArk, and DUO.


    1. Security Information and Event Management (SIEM)

    SIEM solutions aggregate, analyze, and correlate security data from multiple sources, providing real-time visibility into potential threats.

    Why SIEM Matters:

    • Centralized Log Management: Collects logs from firewalls, servers, endpoints, and applications.
    • Threat Detection: Uses AI and correlation rules to identify anomalies.
    • Incident Response: Sends alerts when suspicious activity is detected.
    • Compliance: Helps meet PCI-DSS, HIPAA, SOX, and Hi-Trust requirements.

    Recommended SIEM Solutions:

    βœ… Splunk – Enterprise-level security analytics.
    βœ… Microsoft Sentinel – Cloud-native SIEM for Microsoft ecosystems.
    βœ… DataDog – Lightweight SIEM with cloud integrations.
    βœ… Elastic SIEM – Open-source alternative.


    2. Application Performance Monitoring (APM)

    APM tools monitor application behavior, uptime, and response times to ensure optimal performance and detect security anomalies.

    Why APM Matters:

    • Proactive Threat Identification: Detects application-layer attacks.
    • Performance Optimization: Reduces downtime and enhances user experience.
    • Integration with SIEM: Provides deeper insights into suspicious activity.

    Recommended APM Tools:

    βœ… Datadog APM – Cloud monitoring with SIEM integration.
    βœ… Dynatrace – AI-powered full-stack monitoring.
    βœ… AppDynamics – Deep visibility into application health.
    βœ… SolarWinds APM – Cost-effective solution for IT teams.


    3. Privileged Access Management (PAM) & Multi-Factor Authentication (MFA)

    Privileged accounts are the biggest attack targets. Implementing PAM with MFA ensures that admin accounts are secure.

    Why PAM & MFA Matter:

    • Least Privilege Enforcement: Restricts admin access to critical systems.
    • Prevents Credential Theft: Limits exposure to compromised passwords.
    • Logs & Audits: Tracks administrative actions for compliance.

    Best Practices:

    βœ… Use CyberArk for managing privileged accounts.
    βœ… Require MFA (DUO, Microsoft Authenticator, YubiKey).
    βœ… Separate Personal & Admin Accounts:

    • Personal Account β†’ No admin rights.
    • Admin Account β†’ Requires 15-min auto MFA renewal (best practice in enterprises like PIMCO & CNB).

    4. Endpoint Protection with XDR

    Extended Detection & Response (XDR) provides real-time protection across endpoints, emails, and cloud workloads.

    Why XDR Matters:

    • AI-powered Threat Detection: Blocks malware, ransomware, and phishing attempts.
    • Zero Trust Security: Ensures only verified endpoints can access corporate networks.
    • SIEM Integration: Sends endpoint logs for analysis.

    Recommended XDR Solutions:

    βœ… Microsoft Defender XDR – Built-in for Microsoft environments.
    βœ… CrowdStrike Falcon – AI-driven endpoint security.
    βœ… SentinelOne XDR – Autonomous threat response.


    5. Network Perimeter Security: Cisco MX & Cisco Umbrella

    Firewalls alone are not enough. Organizations need cloud-based DNS security & perimeter defense.

    Why Cisco MX & Umbrella Matter:

    • Protects Against DNS-layer Attacks (e.g., phishing & malware sites).
    • Prevents Data Exfiltration (blocks malicious domains before connections happen).
    • Works with SIEM & XDR (for full security visibility).

    Best Practices:

    βœ… Deploy Cisco MX for firewall + SD-WAN security.
    βœ… Use Cisco Umbrella to block malicious internet traffic.
    βœ… Segment Networks to isolate critical resources.


    Conclusion: Security Requires Layered Defense

    Cybersecurity isn’t just about one toolβ€”it’s about a layered approach:

    1. SIEM for centralized monitoring.
    2. APM for app performance & security insights.
    3. PAM & MFA for privileged access control.
    4. XDR for endpoint protection.
    5. Cisco MX & Umbrella for perimeter security.

    Implementing these tools reduces risk, improves compliance, and protects IT infrastructure from modern threats.


    Next Steps:

    βœ… Read our Step-by-Step Guides for each tool (coming soon).
    βœ… Explore PowerShell automation for security hardening.
    βœ… Contact us for enterprise security consulting (if applicable).

    πŸ”— Stay tuned for more guides on securing your IT infrastructure!


    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • The Importance of SIEM and Best Practices in Enterprise Security

    Introduction

    In today’s cybersecurity landscape, Security Information and Event Management (SIEM) plays a crucial role in protecting organizations from threats. A robust SIEM system centralizes security monitoring, aggregates logs, detects anomalies, and helps security teams respond to incidents in real time. However, SIEM is only one piece of a comprehensive security framework. To maximize its effectiveness, it should be integrated with other advanced security solutions such as APM tools, privileged access management (CyberArk), multi-factor authentication (Duo), and endpoint detection and response (XDR).

    The Role of SIEM in Security

    A SIEM system provides the following key functions:

    • Centralized Log Management: Aggregates and normalizes logs from different sources.
    • Real-Time Threat Detection: Uses correlation rules and AI-driven analytics to detect anomalies.
    • Incident Response: Helps security teams investigate alerts and mitigate threats.
    • Compliance & Auditing: Meets regulatory requirements for PCI-DSS, HIPAA, SOX, and Hi-Trust.

    Recommended SIEM Solutions:

    1. Splunk – Market leader in log analysis and threat detection.
    2. IBM QRadar – Integrates well with enterprise IT infrastructure.
    3. Microsoft Sentinel – Cloud-based SIEM with strong integration into Microsoft’s security ecosystem.
    4. LogRhythm – Offers automation and advanced analytics.

    Integrating APM Tools for Security & Performance Monitoring

    APM (Application Performance Monitoring) tools work alongside SIEM to ensure application security and performance. APM tools help in:

    • Detecting performance bottlenecks before they become security vulnerabilities.
    • Correlating security events with application behavior.
    • Enhancing log visibility for forensic analysis.

    Recommended APM Tools:

    1. Datadog – Offers monitoring for applications, logs, and security events.
    2. Dynatrace – AI-powered analytics for anomaly detection.
    3. New Relic – Provides application telemetry and distributed tracing.
    4. AppDynamics – Deep visibility into application performance.
    5. SolarWinds – A cost-effective alternative with performance monitoring capabilities.

    The Importance of CyberArk for Privileged Access Management

    Why Privileged Access Management (PAM) Matters? Privileged accounts are the highest-value targets for cybercriminals. CyberArk provides:

    • Credential Vaulting – Securely stores and rotates privileged credentials.
    • Session Isolation – Prevents direct access to critical systems.
    • Least Privilege Enforcement – Ensures users only have access to what they need.
    • Audit Logging – Records privileged activity for compliance.

    Best Practices: Personal vs. Admin Accounts with Duo MFA

    Many enterprises make the mistake of using a single account for both personal and administrative tasks, increasing security risks. Best practices recommend:

    • Personal Account for Day-to-Day Use:
      • No elevated privileges.
      • Limited access to sensitive data.
      • MFA enforced for login.
    • Admin Account for Privileged Tasks:
      • Protected by Duo MFA with time-based authentication every 15 minutes.
      • Password resets automatically every 15 minutes (e.g., CyberArk enforcement).
      • No direct internet access (restricted browsing and email access).

    Endpoint Protection with XDR

    Endpoints are the most vulnerable attack surface. Extended Detection and Response (XDR) solutions provide:

    • Advanced Threat Detection: AI-driven monitoring for malware, ransomware, and behavioral anomalies.
    • Automated Response: Blocks and isolates compromised endpoints.
    • Integration with SIEM & SOAR: Security teams can automate investigations and threat responses.

    Recommended XDR Solutions:

    1. Microsoft Defender XDR – Natively integrates with Microsoft’s security suite.
    2. CrowdStrike Falcon XDR – Lightweight agent with cloud-native capabilities.
    3. SentinelOne – AI-driven threat hunting.
    4. Palo Alto Cortex XDR – Strong perimeter and endpoint defense.

    Perimeter Security: Cisco MX & Cisco Umbrella

    Perimeter Security & Zero Trust Architecture A properly configured perimeter ensures that malicious traffic is blocked before it reaches endpoints or internal servers.

    • Cisco Meraki MX – Next-generation firewall with content filtering, VPN, and IPS/IDS.
    • Cisco Umbrella – Cloud-delivered security that blocks malicious domains and phishing attempts at the DNS level.

    Conclusion

    An effective security framework requires a layered defense strategy that integrates SIEM, APM, PAM, MFA, XDR, and Perimeter Security.

    By implementing these solutions, organizations ensure: βœ” Proactive threat detection and response βœ” Regulatory compliance (PCI-DSS, HIPAA, SOX, Hi-Trust) βœ” Minimized attack surface βœ” Reduced impact of security breaches

    Cybersecurity is not just about having toolsβ€”it’s about implementing the right tools, enforcing best practices, and continuously monitoring for evolving threats. The Force is always within you, but having the right technology stack ensures that you are always prepared for battle.

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • PowerShell Script: Managing Shared Mailbox Access

    Overview

    This guide provides PowerShell commands to remove user access from shared mailboxes and verify access removal in Microsoft Exchange Online.

    Prerequisites

    • Administrator privileges in Exchange Online.
    • PowerShell module for Exchange Online installed.
    • Proper authentication to Exchange Online.

    Step 1: Connect to Exchange Online

    Connect-ExchangeOnline -UserPrincipalName [email protected]

    Step 2: Remove User Access from Shared Mailboxes

    $User = "[email protected]"
    $SharedMailboxes = @("[email protected]", "[email protected]")
    
    foreach ($Mailbox in $SharedMailboxes) {
        Remove-MailboxPermission -Identity $Mailbox -User $User -AccessRights FullAccess -Confirm:$false
        Remove-RecipientPermission -Identity $Mailbox -Trustee $User -AccessRights SendAs -Confirm:$false
    }

    Step 3: Verify Access Removal

    foreach ($Mailbox in $SharedMailboxes) {
        Get-MailboxPermission -Identity $Mailbox | Where-Object { $_.User -like "$User" }
        Get-RecipientPermission -Identity $Mailbox | Where-Object { $_.Trustee -like "$User" }
    }

    If no results are returned, the user no longer has access.

    Step 4: Disconnect from Exchange Online

    Disconnect-ExchangeOnline -Confirm:$false

    Notes

    Additional Considerations

    • If users report still having access, check cached credentials or ensure changes have propagated.
    • If access needs to be reinstated, use Add-MailboxPermission and Add-RecipientPermission commands.

    This script helps maintain security and manage mailbox access efficiently within Exchange Online.

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • Automating User Offboarding in Microsoft 365 using PowerShell

    When a team member leaves your organization, it’s critical to offboard them securely and efficiently. Here’s a step-by-step PowerShell-based offboarding process that covers:

    βœ… Disabling the user in Local Active Directory
    βœ… Disabling the Azure AD account
    βœ… Removing all licenses
    βœ… Disabling MFA
    βœ… Converting the mailbox to a shared mailbox
    βœ… Granting full mailbox access to the supervisor


    Step 1 – Disable the User in Local Active Directory

    powershellCopyEditDisable-ADAccount -Identity jdoe
    

    Step 2 – Disable Azure AD User Account

    powershellCopyEditConnect-AzAccount
    Set-AzureADUser -ObjectId [email protected] -AccountEnabled $false
    

    Step 3 – Remove Microsoft 365 Licenses

    powershellCopyEditConnect-MgGraph -Scopes "User.ReadWrite.All", "Directory.ReadWrite.All"
    $UserId = (Get-MgUser -UserId [email protected]).Id
    Set-MgUserLicense -UserId $UserId -AddLicenses @() -RemoveLicenses @("tenant:licenseGUID")
    

    πŸ“ Replace tenant:licenseGUID with the appropriate license GUID assigned to your tenant.


    Step 4 – Disable MFA

    powershellCopyEditConnect-MsolService
    Set-MsolUser -UserPrincipalName [email protected] -StrongAuthenticationRequirements @()
    

    Step 5 – Convert Mailbox to Shared

    powershellCopyEditConnect-ExchangeOnline
    Set-Mailbox -Identity [email protected] -Type Shared
    

    Step 6 – Grant Supervisor Full Access to the Shared Mailbox

    powershellCopyEditAdd-MailboxPermission -Identity [email protected] -User [email protected] -AccessRights FullAccess -InheritanceType All
    

    Summary

    Using PowerShell for offboarding saves time and ensures consistency. Always document changes and communicate them to HR or management for final closure.

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • 10 Essential PowerShell Commands for IT Administrators

    πŸ’» PowerShell is an IT Admin’s best friendβ€”whether you’re managing Active Directory, troubleshooting network issues, or automating daily tasks. These essential commands will help you work smarter, not harder.


    πŸ”Ή 1. Find All Locked-Out Users in Active Directory

    πŸ›‘ Identify locked-out accounts instantly.

    powershellCopyEditSearch-ADAccount -LockedOut | Select-Object Name, SamAccountName, LockedOut
    

    βœ… Use Case: Quickly locate and assist locked-out users.


    πŸ”Ή 2. Unlock a User’s Account in Active Directory

    πŸ”“ Unlock a user’s account without using the GUI.

    powershellCopyEditUnlock-ADAccount -Identity jdoe
    

    βœ… Use Case: Enables IT admins to resolve lockouts in seconds.


    πŸ”Ή 3. Force a Password Reset for a User

    πŸ”„ Require a user to change their password at next login.

    powershellCopyEditSet-ADUser -Identity jdoe -PasswordNeverExpires $false -ChangePasswordAtLogon $true
    

    βœ… Use Case: Ensures security compliance without manual resets.


    πŸ”Ή 4. Retrieve System Boot Time

    πŸ–₯️ Check how long a system has been running.

    powershellCopyEdit(Get-Date) - (gcim Win32_OperatingSystem).LastBootUpTime
    

    βœ… Use Case: Displays uptime in days, hours, and minutes.


    πŸ”Ή 5. List Running Services with “Stopped” Status

    πŸš€ Check which services aren’t running.

    powershellCopyEditGet-Service | Where-Object { $_.Status -eq 'Stopped' } | Select-Object Name, DisplayName
    

    βœ… Use Case: Helps identify critical services that need restarting.


    πŸ”Ή 6. Test Internet Connectivity

    🌐 Check if a machine has an active internet connection.

    powershellCopyEditTest-NetConnection -ComputerName google.com -InformationLevel Detailed
    

    βœ… Use Case: Quick and easy network diagnostics.


    πŸ”Ή 7. Find the Last 10 Failed Login Attempts

    🚫 Track failed login attempts for security auditing.

    powershellCopyEditGet-EventLog -LogName Security -InstanceId 4625 -Newest 10
    

    βœ… Use Case: Detects brute-force attacks and failed password attempts.


    πŸ”Ή 8. Get a List of Users with Expired Passwords

    πŸ”‘ Find all users with expired passwords in Active Directory.

    powershellCopyEditSearch-ADAccount -PasswordExpired | Select-Object Name, SamAccountName
    

    βœ… Use Case: Prevents user lockouts and ensures password updates.


    πŸ”Ή 9. Get Disk Space Usage on a Server

    πŸ’Ύ Check available disk space across all drives.

    powershellCopyEditGet-PSDrive | Where-Object {$_.Provider -like "Microsoft.PowerShell.Core\FileSystem"} | 
    Select-Object Name, Used, Free
    

    βœ… Use Case: Helps avoid storage-related downtime before it happens.


    πŸ”Ή 10. List & Stop Running Processes

    ⚑ View active processes and terminate any misbehaving ones.

    powershellCopyEditGet-Process | Select-Object ProcessName, Id, CPU | Format-Table -AutoSize
    Stop-Process -Name "notepad" -Force
    

    βœ… Use Case: Quickly terminate resource-hogging processes without Task Manager.


    πŸš€ Conclusion: Work Smarter, Automate More!

    πŸ’‘ PowerShell is a game-changer for IT admins, allowing faster troubleshooting, better automation, and enhanced security monitoring. Whether you’re managing user accounts, securing systems, or optimizing network performance, these commands will save time and effort.

    πŸ–₯️ Next Steps?
    πŸ“Œ Bookmark this page and check back for more advanced PowerShell scripts!
    πŸ”— Need more automation tips? Visit the PowerShell Hub for deeper insights.

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • 10 Must-Have PowerShell Scripts for IT Troubleshooting

    PowerShell is a powerful tool for IT professionals, allowing automation, troubleshooting, and system management.
    Whether you’re handling system cleanup, retrieving Wi-Fi passwords, or managing processes, these PowerShell commands can be lifesavers.
    Here are five must-know PowerShell scripts to add to your IT arsenal.


    1. Extract All Installed Applications (For Inventory & Troubleshooting)

    Need to check what software is installed on a system? This script pulls a list of all installed applications along with their version, publisher, and installation date.

    Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* |
    Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
    Sort-Object DisplayName |
    Format-Table -AutoSize

    πŸ”Ή Bonus: Export the list to a CSV file for documentation:

    Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* |
    Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
    Export-Csv -Path "C:\InstalledApps.csv" -NoTypeInformation

    2. Find and Kill Stubborn Processes

    Have an unresponsive application? Use this script to forcefully close any running process by name.

    $processName = "Teams" # Change this to the process you want to kill
    Get-Process -Name $processName -ErrorAction SilentlyContinue | Stop-Process -Force

    πŸ”Ή Bonus: Convert it into a user-friendly GUI:

    Add-Type -TypeDefinition @"
    using System;
    using System.Windows.Forms;
    public class KillProcess {
        public static void Main() {
            string processName = Microsoft.VisualBasic.Interaction.InputBox("Enter process name to kill:", "Kill Process", "Teams");
            if (!string.IsNullOrEmpty(processName)) {
                System.Diagnostics.Process[] procs = System.Diagnostics.Process.GetProcessesByName(processName);
                foreach (var proc in procs) {
                    proc.Kill();
                }
            }
        }
    }
    "@ -Language CSharp
    
    [KillProcess]::Main()

    3. Automate System Cleanup (Cache, Temp Files, Event Logs)

    Over time, systems accumulate temporary files that can slow them down. This command clears temporary files, cache, and event logs:

    Write-Host "Clearing Temp Files, Cache, and Event Logs..." -ForegroundColor Green
    Remove-Item -Path "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue
    Remove-Item -Path "C:\Windows\Temp\*" -Recurse -Force -ErrorAction SilentlyContinue
    Clear-EventLog -LogName Application, System, Security
    Write-Host "Cleanup Completed!" -ForegroundColor Cyan

    πŸ”Ή Bonus: Automate this cleanup by scheduling it in Task Scheduler.


    4. Retrieve Wi-Fi Passwords Saved on a PC

    Need to recover a saved Wi-Fi password? This script extracts the stored credentials for all previously connected networks:

    (netsh wlan show profile) | Select-String "\:(.+)$" | ForEach-Object { 
        $network = $_.Matches.Groups[1].Value.Trim()
        $password = (netsh wlan show profile name="$network" key=clear) | Select-String "Key Content\W+\:(.+)$"
        if ($password) { 
            Write-Host "Wi-Fi: $network | Password: $($password.Matches.Groups[1].Value.Trim())" -ForegroundColor Green 
        }
    }

    πŸ”Ή Use Case: If you’re connected to a Wi-Fi network but forgot the password, this script retrieves it instantly.


    5. Scan for Suspicious File Modifications (Forensic Command)

    This script performs a recursive scan on a target machine to find recently modified files with specific extensions and flag any that contain high-risk keywords. Ideal for forensic scenarios.

    $target = "RemoteComputerName"  # Replace with computer name or IP
    $extensions = @("*.ps1", "*.sql", "*.dll", "*.cs", "*.sln", "*.vbproj")
    $keywords = 'drop', 'truncate', 'remove', 'shutdown'
    
    $session = New-PSSession -ComputerName $target -ErrorAction SilentlyContinue
    if ($session) {
        Invoke-Command -Session $session -ScriptBlock {
            param($exts, $keywords)
            Get-ChildItem -Path "C:\" -Recurse -Include $exts -ErrorAction SilentlyContinue |
            Where-Object {
                $_.LastWriteTime -gt (Get-Date).AddDays(-90) -and
                ($_ | Select-String -Pattern ($keywords -join '|') -SimpleMatch -Quiet)
            } |
            Select-Object FullName, LastWriteTime, Length
        } -ArgumentList $extensions, $keywords | Export-Csv -Path "$env:USERPROFILE\Desktop\forensic-scan.csv" -NoTypeInformation
    
        Remove-PSSession $session
    } else {
        Write-Host "Unable to connect to $target"
    }
    

    Why it matters: This script was used during a forensic investigation while I was serving on a local government IT forensic team. Its purpose was to detect whether sensitive scripts or source code had been created, modified, or concealed on a colleague’s machine. By targeting specific file types and high-risk keywords (e.g., drop, truncate, remove, shutdown), the script helps identify signs of unauthorized automation, code tampering, or mismanagement of critical systems. It supported an internal review when key files were missing and operational stability was in question.


    6. Quick System Resource Snapshot

    # Display top 10 processes by CPU usage
    Get-Process | Sort CPU -Descending | Select -First 10
    
    # Show current CPU usage
    Get-Counter '\Processor(_Total)\% Processor Time'
    
    # Show available memory
    Get-Counter '\Memory\Available MBytes'
    
    # Summarize total, free, and used memory
    Get-WmiObject -Class Win32_OperatingSystem |
    Select-Object TotalVisibleMemorySize, FreePhysicalMemory |
    ForEach-Object {
        [PSCustomObject]@{
            'TotalMemoryMB' = [math]::Round($_.TotalVisibleMemorySize / 1024, 2)
            'FreeMemoryMB'  = [math]::Round($_.FreePhysicalMemory / 1024, 2)
            'UsedMemoryMB'  = [math]::Round(($_.TotalVisibleMemorySize - $_.FreePhysicalMemory) / 1024, 2)
        }
    }
    

    Why it matters: This comprehensive snapshot is a go-to tool for on-the-fly diagnostics. Whether you’re troubleshooting performance issues, memory leaks, or high CPU usage, this command instantly reveals which processes are draining resourcesβ€”without launching Task Manager or Performance Monitor. Ideal for quick triage during server slowdowns or SQL bottlenecks.

    7. Check System Uptime

    $uptime = (Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
    Write-Host "System Uptime: $($uptime.Days) Days, $($uptime.Hours) Hours, $($uptime.Minutes) Minutes" -ForegroundColor Cyan
    

    Why it matters: Quickly see how long the system has been runningβ€”helpful in determining recent reboots or crashes.

    8. Check Disk Space

    Get-PSDrive -PSProvider FileSystem | Select-Object Name, Used, Free, @{Name="Free(GB)";Expression={"{0:N2}" -f ($_.Free / 1GB)}}
    

    Why it matters: Instantly assess available drive space and avoid unexpected application or SQL failures due to low disk capacity.

    9. Review Event Logs (System Errors Only)

    Get-EventLog -LogName System -EntryType Error -Newest 20 | Format-Table TimeGenerated, Source, EventID, Message -AutoSize
    

    Why it matters: Check for hardware, driver, or system errors logged in the last eventsβ€”critical when troubleshooting.

    10. Forensic Script Scan – Local Machine Analysis

    This script performs a forensic scan of the local machine, identifying recently modified files with common scripting and development extensions. It’s ideal for monitoring changes or performing audits.

    $targetPath = "C:\"
    $extensions = '*.ps1', '*.php', '*.sql', '*.bat', '*.cmd', '*.vbs', '*.js', '*.dll', '*.config', '*.json'
    $outputPath = "C:\Temp\ScriptAuditReport.csv"
    
    Get-ChildItem -Path $targetPath -Include $extensions -Recurse -ErrorAction SilentlyContinue |
    Where-Object { $_.LastWriteTime -gt (Get-Date).AddDays(-90) } |
    Sort-Object LastWriteTime -Descending |
    Select-Object FullName, LastWriteTime |
    Export-Csv $outputPath -NoTypeInformation
    
    

    Why it matters: Use this script when you suspect undocumented code changes, malicious automation, or hidden activity on a machine. It pinpoints recently altered files with extensions commonly used for scripting or system manipulation. Ideal for incident response or auditing newly repurposed systems.

    Final Thoughts

    PowerShell is a must-have tool for IT professionals. These scripts help automate tasks, troubleshoot issues, and improve system efficiency. Which of these commands do you find most useful? Let me know in the comments!

    πŸš€ Stay tuned for more PowerShell tips and tricks!

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • How to Create and Manage a Shared Mailbox in Microsoft 365 Using PowerShell

    Introduction

    A shared mailbox allows multiple users to send and receive emails from a common address, making collaboration easier for teams. This guide walks you through creating a shared mailbox, assigning permissions, and verifying settings using PowerShell.

    Using PowerShell provides faster and more efficient management, especially when handling multiple mailboxes.


    πŸ”Ή Step 1: Connect to Microsoft 365 PowerShell

    Before creating the shared mailbox, connect to Exchange Online.

    Run the following command:

    powershellCopyEditConnect-ExchangeOnline -UserPrincipalName [email protected]
    

    πŸ“Œ Replace [email protected] with your admin account email.


    πŸ”Ή Step 2: Create the Shared Mailbox

    Use this PowerShell command to create a shared mailbox:

    powershellCopyEditNew-Mailbox -Shared -Name "TeamMailbox" -DisplayName "Team Shared Mailbox" -PrimarySmtpAddress "[email protected]"
    

    πŸ“Œ Replace "TeamMailbox" and "[email protected]" with your preferred mailbox name and email address.


    πŸ”Ή Step 3: Assign Permissions

    Once the mailbox is created, grant access to specific users.

    Grant Full Access (Allows users to manage the mailbox)

    powershellCopyEditAdd-MailboxPermission -Identity "[email protected]" -User "[email protected]" -AccessRights FullAccess -InheritanceType All
    

    Grant Send As Permission (Allows users to send emails from the shared mailbox)

    powershellCopyEditAdd-RecipientPermission -Identity "[email protected]" -Trustee "[email protected]" -AccessRights SendAs -Confirm:$false
    

    πŸ“Œ Replace "[email protected]" with the email of the user who needs access.


    πŸ”Ή Step 4: Verify the Shared Mailbox and Permissions

    Once configured, verify that the mailbox exists and has the correct settings.

    Check Mailbox Details

    powershellCopyEditGet-Mailbox -Identity "[email protected]" | Format-List DisplayName,PrimarySmtpAddress,RecipientTypeDetails
    

    List Users with Full Access

    powershellCopyEditGet-MailboxPermission -Identity "[email protected]" | Where-Object { $_.AccessRights -eq "FullAccess" -and $_.User -notlike "NT AUTHORITY\SELF" } | Select-Object User,AccessRights
    

    List Users with Send As Permission

    powershellCopyEditGet-RecipientPermission -Identity "[email protected]" | Where-Object { $_.AccessRights -eq "SendAs" } | Select-Object Trustee,AccessRights
    

    πŸ”Ή Step 5: Confirm the Shared Mailbox in Microsoft 365

    You can also check the mailbox in Microsoft 365 Admin Center:

    1️⃣ Sign in to Microsoft Admin Center.
    2️⃣ Go to Exchange Admin Center β†’ Recipients β†’ Shared.
    3️⃣ Locate the mailbox and confirm the settings.


    πŸš€ Conclusion

    By following these steps, you can create, manage, and verify a shared mailbox using PowerShell.

    βœ” No license required
    βœ” Centralized team email management
    βœ” Easier collaboration

    πŸ’¬ How do you manage shared mailboxes in your organization? Share your best practices in the comments below! ⬇️

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • Managing VMware with PowerCLI: Essential PowerShell Commands

    Introduction VMware PowerCLI is a powerful tool that allows administrators to manage VMware environments using PowerShell. Whether you need to create virtual machines, check resource usage, or troubleshoot storage capacity, PowerCLI provides a streamlined approach to VMware management. Below is a guide to setting up PowerCLI and using essential commands for day-to-day VMware administration.


    Step 1: Install and Import VMware PowerCLI

    Before running VMware-related PowerShell commands, ensure that VMware PowerCLI is installed on your system.

    Install-Module -Name VMware.PowerCLI -Scope CurrentUser -Force

    After installation, import the module:

    Import-Module VMware.PowerCLI

    If you encounter SSL/TLS certificate warnings while connecting, configure PowerCLI to ignore invalid certificates:

    Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

    Step 2: Connect to vCenter Server

    To manage your VMware environment, you need to authenticate with vCenter:

    Connect-VIServer -Server <Your-VCenter-Server> -User <Your-Admin-User> -Password '<Your-Password>'

    Once connected, you can retrieve information about your virtual infrastructure.


    Step 3: List VMware Hosts

    To view all available VMware hosts:

    Get-VMHost

    This provides a list of all ESXi hosts, their connection status, and available resources.


    Step 4: Retrieve Virtual Machines

    To get a list of all VMs in the environment:

    Get-VM

    For details of a specific VM:

    Get-VM -Name <VM-Name>

    Step 5: Checking vSAN Datastore Usage

    One common challenge in VMware environments is monitoring vSAN datastore usage. To check storage space:

    Get-VsanSpaceUsage -Cluster <Your-Cluster-Name>

    To calculate the percentage of used space, run:

    $vsanUsage = Get-VsanSpaceUsage -Cluster <Your-Cluster-Name>
    $usedPercentage = 100 - (($vsanUsage.FreeSpaceGB / $vsanUsage.CapacityGB) * 100)
    "vSAN Datastore is currently {0:N2}% full" -f $usedPercentage

    Step 6: Creating a New Virtual Machine

    If you need to create a new VM:

    New-VM -Name <VM-Name> -VMHost <Host-Name> -Datastore <Datastore-Name> -DiskGB 50 -MemoryGB 4 -NumCPU 2

    This command creates a VM with 50GB disk, 4GB RAM, and 2 CPUs.


    Step 7: Cloning an Existing Virtual Machine

    To create a clone of an existing VM:

    New-VM -Name <New-VM-Name> -VM <Source-VM-Name> -Datastore <Datastore-Name> -VMHost <Target-Host>

    Step 8: Managing VM Power States

    To power on a VM:

    Start-VM -VM <VM-Name>

    To shut down a VM:

    Stop-VM -VM <VM-Name> -Confirm:$false

    To restart a VM:

    Restart-VM -VM <VM-Name> -Confirm:$false

    Step 9: Deleting a Virtual Machine

    If a VM is no longer needed, you can remove it permanently:

    Remove-VM -VM <VM-Name> -DeletePermanently -Confirm:$false

    Step 10: Checking for Leftover Files in vSAN

    Even after deleting a VM, some files may remain in the datastore. You can check for orphaned files:

    Get-Datastore -Name <Datastore-Name> | Get-ChildItem -Recurse | Where-Object { $_.Name -like "*<VM-Name>*" }

    To manually remove leftover files:

    Remove-Item -Path "vmstore:\<Datastore-Name>\FolderName\<VM-Name>.vmdk" -Confirm:$false

    Final Thoughts

    Using PowerCLI to manage VMware environments improves efficiency and automation. Whether you need to monitor vSAN usage, create new VMs, or automate backups, PowerCLI provides a flexible solution. Keep this guide handy for reference as you work with VMware environments.

    Have any useful PowerCLI commands that you frequently use? Share them in the comments below! πŸš€

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • How to Investigate and Secure a Compromised Microsoft 365 Account After a Phishing Attack

    Introduction

    Phishing attacks are one of the most common cybersecurity threats that IT administrators face. A single click on a malicious email link can lead to credential theft, data exfiltration, or malware infections.

    This guide provides a step-by-step approach to investigating and securing a potentially compromised account in Microsoft 365 using PowerShell and the Microsoft Security Portal.


    πŸ”Ή Immediate Response: Disconnect & Secure the Affected Computer

    Before investigating, act fast to prevent further damage:

    1️⃣ Shut down the compromised computer immediately.
    2️⃣ Disconnect from the network (unplug Ethernet, disable Wi-Fi).
    3️⃣ Reset the password for the affected user.
    4️⃣ Revoke all active sessions to log out any potential attacker.

    PowerShell Command to Revoke Sessions:

    powershellCopyEditRevoke-AzureADUserAllRefreshToken -ObjectId "[email protected]"
    

    Reset MFA to Prevent Unauthorized Re-Login:

    powershellCopyEditReset-MsolStrongAuthenticationMethodByUpn -UserPrincipalName "[email protected]"
    

    πŸ”Ή Step 1: Check for Unauthorized Sign-ins in Azure AD

    Use Azure AD Sign-in Logs to check for suspicious login attempts.

    PowerShell Command to Retrieve Sign-in Logs:

    powershellCopyEditConnect-AzureAD
    Get-AzureADAuditSignInLogs -Filter "status/errorCode ne '0'"
    

    βœ… Alternative:

    πŸ” Red Flags:

    🚩 Logins from unexpected locations or devices
    🚩 Multiple failed MFA attempts
    🚩 Impossible travel scenarios (e.g., two logins from different continents within minutes)


    πŸ”Ή Step 2: Investigate Phishing Emails Across the Organization

    If an attacker sent phishing emails to multiple employees, run a Compliance Search to identify all affected mailboxes.

    PowerShell Command to Search All Mailboxes for Suspicious Emails:

    powershellCopyEditNew-ComplianceSearch -Name "CompanyPhishingScan" -ExchangeLocation All -ContentMatchQuery 'has:attachment OR has:link'
    Start-ComplianceSearch -Identity "CompanyPhishingScan"
    

    Check Results:

    powershellCopyEditGet-ComplianceSearch -Name "CompanyPhishingScan" | Select Name, Status, Items
    

    If Phishing Emails Are Found, Remove Them:

    powershellCopyEditNew-ComplianceSearchAction -SearchName "CompanyPhishingScan" -Purge -PurgeType SoftDelete
    

    🚨 Use HardDelete only if emails must be permanently removed.


    πŸ”Ή Step 3: Check & Remove Hidden Forwarding Rules

    Attackers often set up automatic forwarding to steal emails.

    Check for Forwarding Rules:

    powershellCopyEditGet-Mailbox -Identity "[email protected]" | Select ForwardingAddress, ForwardingSmtpAddress
    

    Disable Auto-Forwarding if Found:

    powershellCopyEditSet-Mailbox -Identity "[email protected]" -ForwardingAddress $null -ForwardingSmtpAddress $null
    

    πŸ”Ή Step 4: Scan the Compromised Computer Before Reconnecting

    Since a phishing link was clicked, scan the system for malware before reconnecting to the network.

    Offline Windows Defender Scan:

    powershellCopyEditStart-MpScan -ScanType FullScan
    

    If Threats Are Found, Remove Them:

    powershellCopyEditRemove-MpThreat -AllThreats
    

    For a Deep Rootkit Scan, Use Windows Defender Offline:

    powershellCopyEditStart-MpWDOScan
    

    βœ… This will restart the system and scan before Windows boots.


    πŸ”Ή Step 5: Implement Long-Term Protection Measures

    βœ… Enable Safe Links & Safe Attachments in Microsoft Defender

    • Safe Links: Blocks phishing links before users click them.
    • Safe Attachments: Scans email attachments for malware before delivery.

    Enable Safe Links Policy:

    powershellCopyEditSet-SafeLinksPolicy -Identity "Default" -EnableSafeLinks $true -TrackClicks $true
    

    Enable Safe Attachments Policy:

    powershellCopyEditSet-MalwareFilterPolicy -Identity "Default" -EnableSafeAttachmentsForMail $true
    

    βœ… Educate Users on Phishing Awareness

    πŸ”Ή Enable the “Report Message” button in Outlook so employees can easily flag suspicious emails.
    πŸ”Ή Train employees to recognize phishing emails:
    βœ” Unexpected links
    βœ” Urgent language
    βœ” Sender impersonation


    πŸš€ Final Wrap-Up: Is the Account and System Secure?

    βœ” Account fully secured: No unauthorized logins, MFA reset, all active sessions revoked.
    βœ” Email threats removed: No phishing emails remain in any mailbox.
    βœ” PC scanned and clean: No malware detected before reconnecting.
    βœ” Long-term protections enabled: Safe Links, Safe Attachments, user education.

    βœ… By following these steps, IT admins can quickly contain and prevent phishing incidents in Microsoft 365! πŸš€


    πŸ’¬ What’s Next?

    How does your organization handle phishing attacks? Share your best practices in the comments below! ⬇️

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • How to Prevent Windows 10 Updates and Manage Remote Sessions Without Rebooting

    Introduction
    In many enterprise environments, automatic Windows 10 updates can disrupt critical applications. This guide provides step-by-step instructions on preventing updates, forcefully logging off users without rebooting, and managing remote machines efficiently using PowerShell, Command Prompt, and PsExec.


    Step 1: Prevent Windows 10 from Installing Updates

    Option 1: Disable Windows Update Service (Quick & Easy)

    1. Open Run (Win + R), type services.msc, and press Enter.
    2. Locate Windows Update in the list.
    3. Right-click and select Properties.
    4. Set Startup type to Disabled.
    5. Click Stop, then Apply and OK.

    πŸ’‘ This prevents Windows from automatically downloading and installing updates.

    Option 2: Use Group Policy to Block Updates

    1. Open Run (Win + R), type gpedit.msc, and press Enter.
    2. Navigate to:Computer Configuration β†’ Administrative Templates β†’ Windows Components β†’ Windows Update
    3. Double-click Configure Automatic Updates.
    4. Select Disabled, then click Apply and OK.

    Option 3: Delete Pending Updates Using PowerShell

    If Windows updates are already downloaded and pending installation:

    Stop-Service wuauserv -Force
    Stop-Service bits -Force
    Remove-Item -Path "C:\Windows\SoftwareDistribution\Download\*" -Recurse -Force
    Start-Service wuauserv
    Start-Service bits

    πŸ’‘ This clears pending updates, preventing them from being installed.


    Step 2: Completely Cancel Pending Updates and Remove Notification

    Option 1: Clear the Update Queue from Windows Update

    If stopping services alone doesn’t remove pending updates, run this in PowerShell:

    Remove-Item -Path "C:\Windows\WinSxS\pending.xml" -Force -ErrorAction SilentlyContinue
    Remove-Item -Path "C:\Windows\SoftwareDistribution\*" -Recurse -Force

    πŸ’‘ This removes Windows’ record of pending updates.

    Option 2: Flush Update Status from Windows Registry

    If the notification persists, remove any registry traces of pending updates:

    Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" -Name "RebootRequired" -ErrorAction SilentlyContinue
    Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Services\Pending" -ErrorAction SilentlyContinue

    πŸ’‘ This tells Windows that no updates are waiting for a reboot.

    Option 3: Reset Windows Update Components

    Run the following commands in CMD (Admin):

    net stop wuauserv
    net stop cryptsvc
    net stop bits
    net stop msiserver
    ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
    ren C:\Windows\System32\catroot2 Catroot2.old
    net start wuauserv
    net start cryptsvc
    net start bits
    net start msiserver

    πŸ’‘ This resets Windows Update components so the system forgets pending updates.

    Force Windows to Acknowledge No Updates Are Pending

    Run:

    wuauclt.exe /resetauthorization /detectnow

    or

    gpupdate /force

    πŸ’‘ This forces Windows to recheck update policies and clear any pending update flags.

    Reboot Without Installing Updates

    To make sure Windows doesn’t install the update after a reboot, run:

    shutdown /r /t 0

    πŸ’‘ This reboots without triggering pending updates.


    Step 3: Remotely Log Off a User Without Rebooting

    Option 1: Using PowerShell (Requires Admin Privileges)

    1. Open PowerShell as Administrator.
    2. Run:query user /server:RemotePCName
    3. Identify the Session ID of the user you want to log off.
    4. Log them off with:logoff <SessionID> /server:RemotePCName

    πŸ’‘ This logs off the user without shutting down the VM.

    Option 2: Using PsExec (If PowerShell Remoting is Blocked)

    1. Download PsExec.
    2. Extract it to C:\PSEXEC.
    3. Open Command Prompt as Administrator.
    4. Navigate to the PsExec folder:cd C:\PSEXEC
    5. Check who is logged in:psexec \RemotePCName -u Administrator -p YourPassword query session
    6. Log off the user:psexec \RemotePCName -u Administrator -p YourPassword logoff <SessionID>

    πŸ’‘ This method works even if WinRM and RPC are blocked.

    Option 3: Using Command Prompt (WMI-Based Logoff)

    If PsExec fails, try using WMI:

    wmic /node:RemotePCName /user:Administrator /password:YourPassword computersystem where name="RemotePCName" call Win32Shutdown 4

    πŸ’‘ This forces all logged-in users to log off without rebooting! πŸš€


    Step 4: Ensure Remote Management Works for Future Use

    Once you regain access, run this on the remote VM to prevent future lockouts:

    Enable-PSRemoting -Force
    Set-Service -Name RemoteRegistry -StartupType Automatic
    New-NetFirewallRule -DisplayName "Allow RDP and RPC" -Direction Inbound -Protocol TCP -LocalPort 135,3389 -Action Allow

    πŸ’‘ This allows future remote PowerShell and PsExec commands to execute successfully.


    Conclusion

    By following this guide, you can prevent Windows 10 from automatically updating, remotely log off users without rebooting, and ensure seamless remote access to your systems. This is critical for IT environments where stability is a priority.

    Let me know if you need additional troubleshooting steps!

    Β© 2012–2025 Jet Mariano. All rights reserved.
    For usage terms, please see the Legal Disclaimer.

  • Why Azure Cloud Shell is Better?

    If you’re an IT professional or cloud enthusiast, you’ve likely used PowerShell to manage Azure resources. But did you know there’s a better way? Azure Cloud Shell offers a streamlined, cloud-based command-line experience that makes managing Azure easier than ever.


    πŸš€ What is Azure Cloud Shell?

    Azure Cloud Shell is a browser-based command-line tool that lets you manage Azure resources without the need to install or configure anything on your local machine. It supports both PowerShell and Bash, giving you flexibility depending on your workflow.


    πŸ”₯ Why Use Azure Cloud Shell Over Local PowerShell?

    βœ… Pre-installed Azure Modules – No need to manually install or update Az PowerShell modules. βœ… Persistent Environment – Your session and files persist across devices. βœ… Works on Any OS – Since it’s browser-based, you can use it on Windows, Mac, or Linux. βœ… Built-in Authentication – No need to repeatedly sign in to Azure. βœ… Seamless Access to Azure Resources – Direct integration with your Azure subscriptions. βœ… Supports Both Bash & PowerShell – Choose the scripting environment that works best for you.


    πŸ”Ž How to Access Azure Cloud Shell

    1. Go to the Azure Portal: Open portal.azure.com.
    2. Locate the Cloud Shell Icon: Look for the PowerShell logo (or the Bash icon) at the top-right of the screen.
    3. Click to Launch: This will open a terminal at the bottom of the Azure Portal.
    4. Sign In with Your Credentials: If prompted, sign in to Azure.
    5. Authenticate: If needed, go to Microsoft Device Login and enter the code displayed.

    πŸ”§ Basic Azure Cloud Shell Commands to Get Started

    πŸ”Ή Check Your Active Subscription

    Get-AzContext  # Displays your current subscription

    πŸ”Ή List All Azure Subscriptions

    Get-AzSubscription  # Shows all available subscriptions

    πŸ”Ή List All Resource Groups

    Get-AzResourceGroup  # Displays all resource groups in your active subscription

    πŸ”Ή List All Virtual Machines

    Get-AzVM  # Lists all VMs in your subscription

    πŸ”Ή Check Azure AD Users

    Get-AzADUser -First 10  # Retrieves the first 10 users in Azure AD

    πŸ”Ή Manage Storage Accounts

    Get-AzStorageAccount  # Lists all storage accounts in your subscription

    ⚑ Why IT Admins Love Azure Cloud Shell

    Azure Cloud Shell makes it easier to manage Azure environments without worrying about PowerShell version mismatches or module updates. It’s accessible from anywhere, even on a mobile device, making it a go-to tool for IT admins who need quick access to their cloud resources.


    πŸ’‘ Final Thoughts

    If you’re still using local PowerShell to manage Azure, it’s time to upgrade your workflow. Azure Cloud Shell offers convenience, security, and efficiencyβ€”all without the hassle of local configurations.

    Try it today and take your Azure management to the next level! πŸš€

error: Content is protected !!