Skip to main content

Posts

Powershell Tip : How to find the IP Address of a VM from a HyperV

Today we are going to see how to fetch the IPv4 Address details of a VM from a HyperVisor console. We will be using Powershell to achieve the same with a One-Liner code.  You can modify the Command as per your need. Our requirement is to check Only the Running VM's and  get the VM Name and its corresponding IPv4 Address. So lets get started. CODE (Execute in HyperV ): Get-VM | ? State -eq "Running" | select Name, @{l="IPv4Address";e={($_.NetworkAdapters.IPAddresses -match "(?<Address >((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))")} } CODE DETAILS : 1. Get-VM : Fetches the VM List present on the HyperVisor 2. ? State -EQ "Running" : It is similar to Where-Object {$_.State -eq "Running"} , here we are using where-object to fetch only the Running VM list from the Pipeline. 3. NetworkAdapters properties of the VM Contains the IPAddresses information, we are using IPv4 address Regex to get

Disposable Phone Number website list to receive OTP Messages

Here’s the List of website from where you can get several countries disposable phone numbers which you can use to retrieve messages like OTP and so on. List of websites who provide Disposal Numbers : receivesmsonline.net receivefreesms.com freeonlinephone.org receive-sms-online.com sms-receive.net sellaite.com receive-sms-now.com receive-sms-online.info hs3x.com smsreceivefree.com receivesmsonline.com freesmsverification.com receiveasms.com Note : Don’t use this websites for any kind of illegal activity, since logs are maintained everywhere.

Powershell Tip : How to Change the Error Foreground Color in PowerShell

For one or the other reason we sometimes don’t like the "Red colored ERROR" which we used to get when we come across some error in powershell like below : So lets change this red color shown in the console, although its of no use(i.e technically speaking, it will work in the same way) but still just for learning purpose lets do it. In order to make this ERROR Foreground as any other color(over here green), write the below command in the Powershell console. $Host.PrivateData.ErrorForegroundColor = "Green" Output : Quite interesting right, Not only this you can change colors of several properties like Warning, Debug, Verbose etc. Just run  $Host.PrivateData | get-member Hope you all enjoy this Post, Do Like, Share and Comment if you have any suggestion or queries.

Plesk Tip : How to Find cron or task scheduler details of a specific Customer

Tested on : Plesk Obsidian, Windows 2012 R2 Few days back i was looking into a way to find the cron details of a customer and once its fetched remove the crons created by that user. Through GUI, it can be done in 2 ways : 1. Go to Tools & Settings > Scheduler Tasks -or- Domains > Schedule Tasks 2. Login to the server > Open Task scheduler (taskschd) and Look into the task with description. You will get the domain id there But the above mentioned process is quite cumbersome. So after digging a lot, I was able to figure it out using Powershell. To get all the cron details of a particular Customer : & "$Env:Plesk_Bin\Crontabmng.exe" get "CustomerName" To Remove all the crons of a particular Customer : & "$Env:Plesk_Bin\Crontabmng.exe" remove "CustomerName"

Powershell Tip : How to find the disk type of your System ( HDD or SSD )

Hi Friends😀 Today we are going to learn how to find the disk type of your system i.e. whether it is SSD ( Solid State Drive ) or HDD ( Hard Disk Drive ). Powershell has a cmdlet which helps to achieve the same :  Get-PhysicalDisk Get-PhysicalDisk | Select FriendlyName , MediaType , Size

How to Bypass execution policy in Powershell

Hi Geeks, Today we are going to learn the tips and tricks which can be used to bypass or run a Powershell script or command if its blocked using the below methods : 1. RemoteSigned Execution Policy 2. AllSigned Execution Policy 3. Restricted Execution Policy Steps : Source :  Netspi Blog

Unable to access Plesk Horde webmail (Windows), Table 'horde.horde_perfs' doesn't exist

I would like to share one of the incident which we faced recently on our production environment. Horde webmail stopped working for two Plesk servers with the below errors : A fatal error has occurred SQLSTATE[42S02]: Base table or view not found: 1146 Table 'horde.horde_prefs' doesn't exist Details have been logged for the administrator. Server details : Windows 2012 R2 Plesk Onyx 17.5.3 Horde version 5.x Steps to Fix it : Step 1 : This issue mostly happens if Horde database is missing or corrupt. In our case it was missing somehow ( may be deleted by some admin by mistake ) Step 2 : Once verified that database is missing from the MySQL, only option is to recreate the Database and Horde DB user by reinstalling it. Step 3 : To reinstall Horde, execute the below command : #Take a backup of PSA Database before making any DB related changes. plesk db dump PSA > C:\temp\PSA<Date>.sql #Removing the existing horde webmail setup ( In my case t