Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

Blog posts : "Powershell"

Broadcom PowerCLI: Building a GUI to Check VMware HA Admission Control Compliance

This PowerCLI GUI script I have written to audit VMware ESXi clusters high availability (HA) inside vCenter Server. This script validates below ideal configuration is defined on the cluster and tells me whether configuration is correct with green tick and non-compliant with red cross.

Note: …

Read more

The PowerShell Sorting Trap: Why 10 Always Comes Before 2 in Your CSV Data

When sorting CSV data with PowerShell, I observed unexpected results, as shown in the screenshot below. The initial command, Import-Csv C:\Temp\Numberings.csv, shows that the numbers in the CSV are out of sequence. To sort these numbers, I used the simple pipeline command Sort-Object specifying the

Read more

Terraform String Encoding and Decoding with PowerShell

This is another script I have written to encode and decode string for Terraform using PowerShell GUI. These scripts helps me in the live demonstrations and PowerPoint to client about infrastructure as a code. Once script is executed in PowerShell GUI, it looks like below, It helps to Base64 Encode g…

Read more

Self-Signed Certificates Made Easy with PowerShell GUI

I was delivering few demos for Azure Application Gateway client side, I got information, there will be very limited Internet and only specific things will work in the given environment. In one of the demo I wanted to created few Self Signed SSL Certificates for Azure Application Gateway. In the de…

Read more

How to create byte array in PowerShell

To create a byte array in PowerShell, you can use several methods, depending on whether you want to initialize it with values, specify a size, or convert data like a string or file. The simplest method is to cast an array to the [byte[]] type.

1. Create a byte array with pre-defined values

T…

Read more

Streamlining Intune MDM Device Management with Microsoft Graph and PowerShell

As an IT administrator, managing devices in your organization can be a daunting task. With the help of Microsoft Graph and PowerShell, you can automate device management tasks and streamline your workflow. In this article, You can explore how to use PowerShell to connect to Microsoft Graph, retrieve…

Read more

PowerShell & Microsoft Graph API: Automate Full Intune Devices Sync more than 1000 Pagination

This PowerShell script leverages the Microsoft Graph API to synchronize Intune MDM devices. A previous iteration of the script was limited to fetching and syncing only the first 1000 devices due to pagination. To overcome this, the updated script iterates through the @odata.nextLink property, allow…

Read more

Automate Intune MDM Device Sync: A PowerShell Script for Microsoft Graph API

This PowerShell script demonstrates automated management and synchronization of devices with Microsoft Intune via Microsoft Graph API. Using client credentials to authenticate against Azure AD, it retrieves an OAuth 2.0 token and lists all managed devices in the environment for reporting purpose. 

Read more

PowerShell Create and Export Self-Signed RSA Certificates (PFX, CER, PEM)

This script helps creating SSL Self Signed Certificates and Private/Public key using PowerShell. PowerShell has inbuilt cmdlet command New-SelfSignedCertificate which is used to create proper SSL certificate which doesn't require third party applications such as OpenSSL or similar. There are multip…

Read more

Monitoring Dell Server Health Using RACADM CLI: Sensor Info from iDRAC

The racadm cli command with getsensorinfo subcommand fetches real-time live hardware sensor data such as temperature, voltage, and power, memory, processor status and other hardware information from a Dell server's iDRAC system. This is very useful to system administrators for monitoring server hea…

Read more

Turn Your PowerShell Into a Web Server: Instantly Share Local HTML & Files!

While working on some project I wanted a quick web server for testing. Instead of deploying and using full fledged production web servers such as IIS, Apache, HTTPD, NGINX etc. I created very lightweight web server using PowerShell which serve the purpose to use it for just quick web testing purpose…

Read more

From Manual to Automated - Managing Dell iDRAC Power via Redfish API and PowerShell

Managing server power states manually is time-consuming, especially in large-scale environments or remote setups. For IT administrators overseeing Dell PowerEdge servers, automation is key to efficiency. Enter iDRAC (Integrated Dell Remote Access Controller) and the Redfish API—a modern RESTful st…

Read more

OpenSSH Server configuration for Windows

I had a requirement to test configuring OpenSSH server on Microsoft Windows and connect it through OpenSSH client. Using given below steps in this article we can setup OpenSSH server on Windows server and connect through Linux SSH client.

First go to Settings >> Apps & features >> Optional featu…

Read more

Get Nutanix virtual machine details using PowerShell

This article is demonstration on how to connect to Nutanix using PowerShell and fetch virtual machine inventory. This is the view of Nutanix prism central portal and on the dashboard I can see all the information related to Nutanix objects.

nutanix AHV powershell automation configuration inventory aos hypervisor virtualization.png

In this prism central I can see virtual machines. My…

Read more

Create PowerShell array of object in different way

When working with arrays and PSObject in PowerShell, there are several efficient methods for creating and managing array elements. Below are examples that highlight both the creation of arrays and the addition of elements in different ways. 

To create an empty array in PowerShell, you have two m…

Read more

Configure SNMP Service on HPE ILO Redfish Rest API using PowerShell

In our team, a colleague was tasked with configuring SNMP settings on multiple HPE ILO portals. To streamline this process and avoid manual labor, they sought my expertise in automation. I leveraged the HPE ILO Redfish REST API with PowerShell to automate the task, utilizing the comprehensive API do…

Read more

Reboot remote Linux server from PHP PowerShell web server for privileged users

This HTML tool enables users to restart Linux servers remotely from their web browser, providing a convenient and efficient way to manage server operations. Built using HTML, PHP, and PowerShell, this project is designed to be hosted on a Windows XAMPP server only. 

For added security and author…

Read more

Generate GUID using PowerShell GUI tool

This PowerShell script provides a graphical user interface (GUI) for generating new GUIDs. Each time the "Generate" button is clicked, a new GUID is created using the [guid]::NewGuid() command. The interface is built using Windows Forms, offering a user-friendly way to quickly generate and view uniq…

Read more

Create storage account and Service Principal using PowerShell for Terraform Azure Backend

While working on earlier article Configure Azure Storage Account Blob as Terraform backend to store tfstate file, I wanted to test terraform backend configuration with Azure Service Principal (App registrations) account. To configure initial resources on Azure for backend, I have automated all the …

Read more

Automate chrome browser with PowerShell using selenium

Working with deprecated Internet Explorer using PowerShell to automate it was very easy earlier. To automated clicks or auto type on Internet Explorer, I was just using native .net com objects, which was a very simple and comprehensive. But since Internet Explorer is deprecated, I switched to Google…

Read more

20 blog posts

Blog Search

Page Views

13509487

Follow me on Blogarama