Menu

Virtual Geek

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

Blog posts : "powershell"

Resolved PowerShell Visual studio code stuck with 'Starting up PowerShell' in status bar

On one of the my colleagues new laptop we were setting up Visual Studio Code environment. After installing Microsoft PowerShell extension on VSCode when executing PowerShell ps1 script, it was getting stuck/freeze/hang with message "Starting up PowerShell" at the bottom-right side, and it was showin…

Read more

Resovled issue with PowerShell - Trust relationship Rejoin computers in domain without restart

While working with The trust relationship between this workstation and the primary domain failed issue on Windows Servers, I used PowerShell cmdlet Test-ComputerSecureChannel and cmd command netdom to resolve the broken AD computer account trust relationship without reboot. Apart from these com…

Read more

PowerShell fix repair The trust relationship between this workstation and the primary domain failed

This is the issue I have always seen with Windows Server Administrator. They face below issue a lot in their day to day activities while logging with their domain account. When they login with local account it was successful. The cause of this issue is simple, whenever computer joins into domain the…

Read more

PowerShell save export data to XML file

I wanted to create XML file using PowerShell and PowerShell offers different ways to create XML file in different formats, with PowerShell you can create and generate different types of XML format. One of the simple way I shown in this article PowerShell Create XML document with XmlWriter .net obj…

Read more

PowerShell Create XML document with XmlWriter .net object

XML stands for eXtensible Markup Language it was designed to store and transport data and to be both human- and machine-readable. I wanted to create a simple readable XML files using PowerShell for few of the projects. There are native cmdlets (Export-CliXML and ConvertTo-XML) available in the Po…

Read more

Powershell Create new file if not exist, if exist Rename file

This small PowerShell script helps to create a new file inside the folder if file does not exist, if file exists rename it with the date and times. This logic I always use in my scripts when I want to implement logs system for my script. When the file is renamed (While creating new file) it adds dat…

Read more

PowerShell XML OperationStopped: No coercion operator is defined between types 'System.Object&' and 'System.Object'

While working with XML files using Powershell, I imported XML file and started exploring data inside XML. On the left hand side I have opened XML file in notepad. XML has nested objects. While accessing the nested data (Address) inside XML table I was receiving error OperationStopped: No coercion o…

Read more

PowerShell Encode or Decode an WebURL

While working few web scrapping project, I was able to get the table data, but few of the data had few special characters in the table, which was in http encoded format. Related article is a Powershell web scrapping extract table from html. The encoded http data was not readable. This data can be …

Read more

PowerShell convert string to base64 value

Base-64 encoding is a way of taking binary data and turning it into text so that it's more easily transmitted in things like e-mail and HTML form data. I had few requirement to convert / encode text string to Base64 string and vice versa, From encoded Base64 string to convert/decode to normal string…

Read more

Create an interactive HTML report with PowerShell data

Basically I wrote this project as an fun/poc, but it went very well. I wanted to show the HTML + PowerShell capabilities to my (Asset collection team) colleagues as there are endless possibilities what you can build using HTML + Powershell. After launching the html file in the chromium browser the w…

Read more

Resolved - Install RSAT Tools on Windows Installer encountered an error 0x8024001d

While working on few Active Directory automation tasks I wanted RSAT tools to be installed on one of the VDI to test and write few scripts. From https://www.microsoft.com/en-in/download/details.aspx?id=45520 I downloaded installation files.

Microsoft Powershell windowsth rsat tools windos 2h2 remote server administration tools for windows 10 download powershell module server administration.png

While installation I was keep receiving this error…

Read more

Create a custom TCPIP stack on ESXi server - VMware PowerCLI GUI

While working with my VMware team we had to audit and create or delete TCP/IP network stack, Here on the ESXi server under Networking >> TCP/IP Configuration you cannot create new custom stack using vSphere client. I was able to automate almost all infrastructure using PowerCLI scripts, but few…

Read more

Install Ansible AWX on Microsoft Windows OS

I was working on upgrading my Ansible AWX server in my lab, while upgrading/installing fresh Ansible AWX Tower server I found the step by step instructions I tried long back Install Ansible AWX Tower on Ubuntu Linux are absolutes now and no longer working as Ansible AWX team made few changes to it.…

Read more

VMware PowerCLI Connect-VIServer Object reference not set to an instance of an object

While connecting to ESXi server with VMware PowerCLI from one of my server I was keep receiving below error. I wasn't able to connect to ESXi server directly from PowerCLI module. 

@SERVER01 ~ Connect-VIServer ironman.vcloud-lab.com
Connect-VIServer :  Object reference not set to an instanc…

Read more

Automate Many-to-One client certificate mappings for IIS hardening using PowerShell

Recently while talking to one of my colleage from another department, he wanted help on PowerShell scripts to automate few IIS Webserver (Internet Information Services) advanced configuration where he was struggling setting few IIS settings of manyToOneMappings for hardning purpose, other setting…

Read more

Configure a Azure VM with Desired State Configuration in Automation Account

While working on one of the Azure Automation Accounts project I had to test and provide a demo of Desired State Configuration (DSC) on the Azure Virtual Machine, how it can be useful. There was a client requirment to not to use Group Policy for hardening, but the configuration must be done through D…

Read more

Powershell GUI VMware ESXi custom patch bundle builder

Every time VMware releases ESXi patches, and I need to patch them on different projects with few modifications to patch bundle, by trimming down few driver VIBs packages or add third party driver vibs zip files packages. I do everything with PowerCLI commands. But as I wanted my colleage to perform …

Read more

Create an Azure Automation account on using Portal PowerShell and AzureCLI

Azure Automation Account is Azure resource allows you to automate tasks against services and resources in Azure, on-premises and with other cloud providers such as Amazon Web Services (AWS). You can write and use runbooks to automate your tasks, or a Hybrid Runbook Worker if you have business or ope…

Read more

Azure Powershell : Operation returned an invalid status code 'BadRequest'

While working on few Azure Powershell scripts I was keep receiving an error 'BadRequest' whenever I was trying to create a new resource in Azure. I kept on trying to resolve an error but didn't find any proper solution to it. Initially the message was not much friendly so to dig down further I went …

Read more

Export certificates from Azure Key Vault using PowerShell

While working with Azure Key Vault Certificate Create Azure Key Vault Certificates on Azure Portal and Powershell, Next requirement was to download those certificates from Key Vault. On the Azure Portal choose the SSL Certificate you want to export. Click buttons Download in CER format or Download…

Read more

20 blog posts

Blog Search

Page Views

9280178

Follow me on Blogarama