Posts

Showing posts from December, 2024

How To Copy Secrets From KeyVault To Another KeyVault In Azure

  Introduction Azure Key Vault is a secure cloud service for managing secrets, encryption keys, and certificates. In modern multi-region deployments, ensuring that application secrets are consistently available across regions is essential for high availability and disaster recovery. However, manually copying secrets from one Key Vault to another can be tedious, error-prone, and time-consuming, especially when dealing with numerous secrets. This blog post demonstrates how to automate the process of copying secrets from one Azure Key Vault to another using a PowerShell script. By following this guide, you can efficiently replicate secrets between regions, ensuring consistency and reducing manual intervention. For full article refer : https://dotnet-helpers.com/devops/how-to-copy-secrets-from-keyvault-to-another-in-azure/
  How To Monitor a Folder changes using Powershell In our environment, large numbers of users are working on a daily basis and it very difficult to track what file they have modified and which time. To handle this scenario, my team was requested to monitor a directory for any file changes and receive alerts of those changes when they trying to update/Delete/renamed/created in a specific location inside the service and this requirement made me create this post. In this post, we will discuss how to monitor changes in the folder including sub-files, and log in to the log text file. STEP #1 To monitor a folder for new files in Windows with PowerShell, we can use a .NET class called FileSystemWatcher.  This class is in the System.IO namespace and can be created with the New-Object cmdlet. $filewatcher = New-Object System.IO.FileSystemWatcher please refer the source :  https://dotnet-helpers.com/powershell/how-to-monitor-a-folder-changes-using-powershell/ 
  How to create new DNS in Azure Private DNS using PowerShell You have a more number of options when it comes to resolving names using DNS . Microsoft Azure DNS is one of such option. In this post, we will discuss How to create new DNS in the Azure Private DNS using PowerShell To manage Azure DNS, you can configure it through Azure Portal UI or command-line tools like the Azure CLI or PowerShell. Often admins need to manage DNS at scale or automate the management of various objects. A great way to do that isn’t via a graphical method like the Azure Portal but with a scripting tool like PowerShell (as we can automate). Azure DNS is a managed DNS solution. We can use it for public DNS records (use the URL for access public) as well as for private DNS records. Using Azure private DNS, we can resolve DNS names in a virtual network. There are many benefits to using Azure private DNS. For full article, refer the source:  https://dotnet-helpers.com/powershell/how-to-create-new-dns-i...
  How to Quickly Find Hyperlinks in Excel using PowerShell I recently had the requirement to fetch out all of the hyperlinks from a Large excel worksheet to prepare  another document and its repetitive monthly task. While I could have gone the manual approach by looking through all of the cells in the worksheet and  fetching/copying all of the hyperlinks through manually, that would have been a long grueling thing to perform.  So we thought to create an Automated script to perform this action instead of Manual work, For this scenario, we have the PowerShell COM object creation to hook into Excel.  Application COM object and then open up an existing Excel document and locate all of the hyperlinks which are  in the spreadsheet. Automation will always be better than manual if allowed to use it.  Instead of giving a deep conversation, let us start implementation quickly. STEP #1: Create Excel.Application COM Object The first thing that you need to do is t...

How to Use PowerShell for DNS Record Monitoring and Troubleshooting

  DNS (Domain Name System) records are the backbone of internet connectivity for web servers, mail servers, and other networked systems. Missing or misconfigured DNS records can lead to service disruptions, causing websites to become unreachable or emails to fail. PowerShell offers a robust cmdlet,   Resolve-DnsName , that enables administrators to monitor, validate, and troubleshoot DNS configurations (PowerShell DNS record monitoring). This article introduces a PowerShell script designed to simplify the process of checking DNS resolution for multiple domains. By leveraging this script, you can automate DNS checks, verify propagation of updates, and ensure compliance with best practices for security and network reliability. The script processes a list of domain DNSLists and retrieves their resolution status, IP addresses, and any associated errors, providing a comprehensive overview in a single execution. If you’re managing web or mail servers, you know how heavily these ser...
  How to Create Log File using Start-Transcript cmdlet in PowerShell What is Start-Transcript ? As per  MSDN , The Start-Transcript cmdlet creates a record of all or part of a PowerShell session to a text file. The transcript includes all commands that the user types and all output that appears on the console. Starting in Windows PowerShell 5.0, Start-Transcript includes the hostname in the generated filename of all transcripts. When & Where to use? As system admin/DevOps, we are doing much automation inside the servers and it’s mandatory to capture all the details (maybe error or success ran) in the log to make an analysis if required. In simple, if you running PowerShell scripts automatically you need a way to log any errors or warnings that occur. Usually, we will create your own log function ( the same I did for my previous automation, please refer to my implemented method ) , but there is an easier way which I found during my team discussion and thought to share with ...

Cache Purging in Azure Front Door with Azure PowerShell and CLI

Introduction Azure Front Door is a global, scalable entry point for fast delivery of your applications. It provides load balancing, SSL offloading, and caching, among other features. One critical task for maintaining optimal performance and ensuring the delivery of up-to-date content is cache purging. This article provides a step-by-step guide to performing cache purging in Azure Front Door using Azure PowerShell and the Azure Command-Line Interface (CLI). What is AFD Cache Purging? Cache purging, also known as cache invalidation, is the process of removing cached content from a caching layer. This is essential when the content served to the end users needs to be updated or deleted. In the context of Azure Front Door, purging ensures that the latest version of your content is delivered to users instead of outdated cached versions. For more details on this topic please click here 

How to remove duplicate rows in a CSV using Powershell

 Learn below topic with below links: How to remove duplicate rows in a CSV using Powershell