Menu

Virtual Geek

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

Blog posts : "powershell"

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

Thi…

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, allowi…

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 multipl…

Read more

Get VMware vCenter Appliance Version using Broadcom PowerCLI VCSA REST API

This PowerShell script uses VMware vCenter Server Rest API and shows VCSA (vCenter Server Appliance) version through the command line. Keeping track of your vCenter Server Appliance (VCSA) version is crucial for effective management and update. Simply provide your vCenter credentials, and the script…

Read more

Install VMware VCSA Patch Upgrade using PowerCLI vCenter REST API

This is the main script in the series and does major task of Installing the latest patch update on VCSA (VMware vCenter Server Appliance).

Screenshot of Install Broadcom VMware VCSA Patch Upgrade using PowerCLI vCenter server REST API

While running this script you will need to provide vCenter Server, User, Password, Version (Optional), Patch URL parameter information in the script, as g…

Read more

Check VCSA Upgrade Staging Progress using PowerShell vCenter REST API

While staging patches update on the VCSA (vCenter Server Appliance), it takes some time to download updates on vCenter Server from remote source. Using this script I can track whether staging is completed or not. It simply shows value true or false for Staging Completed in the given output. I found …

Read more

Leveraging PowerShell to Stage VCSA Updates via vCenter REST API

Staging in VMware VCSA (vCenter Server Appliance) allows you to upload/download patches and updates, In the staging process it does not directly install or apply the patches/updates immediately but just copies patch updates on VCSA appliance. Which allows for a faster remediation process during upda…

Read more

Retrieve VCSA vCenter Version with PowerShell REST API

This PowerShell helps to fetch the current version of  VCSA (VMware vCenter Server Appliance). This information is useful while automating VCSA upgrade, It is fetched used from VCSA REST API.

Screenshot of a PowerShell console running 'Show-VCSACurrentVersion.ps1'. The output shows 'Appliance Update Status:', 'Latest Query Time: 08/04/2025 16:00:56', 'Current State: UP_TO_DATE', and 'Installed Version: 8.0.0.300400'.

In the vCenter Server Management portal you can see the Version in the update.

Screenshot of the vCenter Server Management interface, 'Update' tab. It shows 'Current version details' as 8.0.0.400. Below 'Available updates', an update for version 8.0.0.500 is listed as 'Staged', with 'Type: Fix', 'Release Date: Apr 10, 2025', 'Reboot required: Yes', and 'Severity: Critical'.

You can downloa…

Read more

PowerShell & VCSA: Checking for Pending & Latest Updates via REST API

This script helps me to get the latest available pending updates for VCSA in vCenter Server Appliance Management portal before stage and install. It shows all in dept information of pending update from local web repo website url. Which will be helpful to automate installation further with correct ve…

Read more

Automating vCenter Server Appliance Backups with PowerShell On Demand

It is a best practice to take backup before doing any update or patching of VCSA (VMware vCenter Server Appliance) or keeping regular backups of VCSA make it makes reliable incase of vCenter server failures. They can be restored easily from backup if required anytime. 

Note you will required VMwa…

Read more

How to Resize Azure Virtual Machines using PowerShell Script

This PowerShell script automates resizing Azure VMs. First use Get-AzVMSize command as shown in the below screenshot to check supported and available VM sizes in the given Resource Group. From the generated list of the Virtual Machine Size names, Use selected one in the parameter and execute the mai…

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 heal…

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

Mastering Terraform Import: Seamlessly Integrate Existing Azure Resources

Why Importing Matters in Infrastructure-as-Code
When adopting Terraform for existing cloud environments, you'll inevitably face a critical challenge: How to bring existing infrastructure under Terraform management? This is where resource importing becomes essential. Without proper imports, Terrafor…

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 stan…

Read more

Key based passwordless authentication to Microsoft Windows OpenSSH Server

This is a second part of  OpenSSH Server configuration for Windows. In this part I am generating private and public keys, which will be used to login into Windows OpenSSH server. When using key based authentication on OpenSSH, you don't need to provide a password to connect Windows Server over OpenS…

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 featur…

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

20 blog posts

Blog Search

Page Views

1 5 1 4 6 0 3 2

Archive

Follow me on Blogarama