[Tips and Tricks][carousel][6]

Wednesday, 6 May 2020

Wednesday, 18 December 2019

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

7:39 pm
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 the horde site is webmail , it may differ in your case )
plesk installer --select-release-current --remove-component webmail

#Installing Horde again with the latest version
plesk installer --select-release-current --install-component webmail


Post that it got Fixed.

Powershell interview questions

2:48 pm

1. Which is not a built-in variable out of this
        a) $Args
b) $Hostname
c) $Pid
d) $?

2. Which one will override the default alias in Powershell

a) Set-Alias -Name ls -Value hostname -Scope Local -Force
b) Set-Alias -Name ls -Value hostname -Force
c) Set-Alias -Name ls -Value hostname -Option AllScope
d) None of the above, we can't override the default aliases

3. Out of the below which command won't work ( Renaming directory )

a) Rename-Item "C:\`[Test File`]\" "Test"
b) Rename-Item "C:\``[Test File``]\" "Test"
c) Rename-Item -LiteralPath "C:\`[Test File`]\" "Test"
d) Rename-Item -LiteralPath "C:\[Test File]\" "Test"

4. What is the default execution policy in Powershell
 
  a) Bypass
b) Restricted
c) UnRestricted
d) RemoteSigned

5. What will be the output of $Result
   
     $Result = Write-Host "This is my First script" ; $Result

a) Null
b) This is my First script
c) 0
d) None of the above

6. What will be the Output :

    $value = "Apple.Orange.Pineapple"
    $Orange, $Pineapple = $value.Split(".")
    Write-Host "$Orange ; $Pineapple ; $Apple"

a) Apple ; Orange Pineapple ;
b) Orange ; Pineapple ; Apple
c) Apple ; Orange ; Pineapple
d) None of the above

7. What will be the Output :

     $Value = "Global-Scope"
     function abc {
                  $Value = "Local-Scope"
                  Write-Host $global:Value
                  Write-Host $local:Value
                  Write-Host $Value
     }

    abc
    Write-Host $local:Value
    Write-Host $Value

a) Local-Scope Global-Scope Local-Scope Local-Scope Global-Scope
b) Global-Scope Local-Scope Local-Scope Global-Scope Global-Scope
c) Global-Scope Local-Scope Global-Scope Local-Scope Global-Scope
d) Global-Scope Local-Scope Local-Scope Local-Scope Global-Scope

8. Which below cmdlet is wrong, To Remove a variable ($Var) from Memory

        a) Remove-Variable -Name var
b) rv var
c) Remove-Item Variable:\Var
d) rv $var

9. What will be the Output :

    $output1 = 4 + "2" ;
    $output2 = "4" + 2 ;
    Write-Output $output1 , $output2

a) 6 42
b) 42 42
c) 6 6
d) None of the above

10. Which port is used by default for Powershell remoting ( HTTP Listener )

       a) 5986
b) 5985
c) 5984
d) 5987

11. Print your name 10 times, Example :

     John Doe
     John Doe
     John Doe
     John Doe
     John Doe
     John Doe
     John Doe
     John Doe
     John Doe
     John Doe

Solution : PS C:\> 1..10 | %{write-host "John Doe"}

12. Create a Function to accept a parameter and then reverse it

Example :
Reverse-String -Phrase "Powershell"
Output : llehsrewoP

Solution :

Tuesday, 3 April 2018

How to fix Filezilla DELE 500 command not allowed issue

4:33 pm
Hey how's going? Today i am going to discuss regarding an issue which i faced recently while connecting to a FTP Server using FileZilla. I tried to delete a file and it gave me the below error :

Command:  DELE testing123.txt
Response:  500 Command not allowed.












I tried to troubleshoot it as below :

1. Checked permission of the ftp user on the server's directory path and it was all good. User was having Read and Write permission.
2. Was able to create a new file and edit it.
3. Checked for any FTP Error logs but in vain.
4. Restarted the FTP Service as i was clueless.
5. Error clearly defines that DELE Command was requested for the file testing123.txt but the Server responded with 500 i.e command not allowed. That means the Server doesn't accept the DELE Command which was quite clear. But where this command is getting blocked ??

Voila !! Got it



After making strenuous efforts, finally i figured it out by looking into the web server i.e IIS FTP Settings. IIS > Sites > Your_FTP_Site > FTP Request Filtering > Commands , DELE Command was not allowed.














Hence removed the command by doing Right click on the command > Remove ( No need to restart any FTP or IIS Service after doing it ) , post which it was fixed. Hope you learned something new today, do like and share for more.

Monday, 18 December 2017

Powershell Tip: where does recovered file get stored in Powershell ?

7:49 pm
Hey Geeks,

Hope you are having a great day. Lets come to one of our interesting section i.e Powershell >_ Tip of the Day.

Ever wondered if you have some unsaved data in Powershell ISE and ISE process get stopped suddenly either it is through system shutdown or any other means.

WHAT HAPPENS TO YOUR UNSAVED DATA??

Once you open ISE you might see that old unsaved data as (untitled*.ps1(Recovered)), But from where did it came.

So the answer is here, its the same way Sticky notes saves the unsaved data.

Powershell stores it in the below path :

$env:USERPROFILE\AppData\Local\Microsoft_Corporation\PowerShell_ISE.exe_StrongName_lw2v3wmtzzpebq33gybmeoxukb04w\3.0.0.0\AutoSaveFiles\



If you already knew this then its great, if not hope you learned something new!
Share your thoughts by commenting below. :)




Wednesday, 4 October 2017

How to get the list of WiFi Passwords stored on your computer using Powershell

12:29 pm
Hi Geeks,

Today we are going to see how to fetch the list of SSID passwords which are stored on your computer. Although through GUI, we can view the same by checking Wireless Network Properties --> Network Security Key.




But today we are going to see how to fetch all the list at once using Powershell instead of checking them individually one by one.

So let's get Started :


1. Copy the below Powershell script


2. Execute the powershell Function Get-WiFiPass



























Hope you all liked this post, do share and comment for any queries.

Script Credits : https://github.com/ajackal/ideal-alligator

Saturday, 9 September 2017

How to use git in windows

4:17 pm








1. Download GIT package for windows .Click Here
2. Once downloaded install the package as given below :















































3. Once installation is complete, you can open git by using Git cmd, Powershell or Command Prompt.


















4. Now we have to Clone our Git Repo from git bucket, github, gitlab etc. I have my repo in github so lets see how to clone it from github.

5. Login to your github account, you will see the clone url to clone the git repo. It would be something like : https://github.com/<Username>/<Repository Name>.git


6 Once you got the URL.Open git cmd or powershell, and give the command as shown below :

git clone https://github.com/<Username>/<Repository Name>.git














7. Now you can see that Git Folder got created on the specified directory. so we are done, now simply put you scripts and push them to the Central git repository.



8. Some useful git commands :

git status
git add
git pull
git commit
git push
git remote
git log

Any queries comment below. Happie Learning!

Monday, 4 September 2017

How to get SID of all Domain Users using PowerShell

3:22 pm
Hey All,

Today we are going to cover an interesting topic to fetch SID of all domain users.


What is SID ?

SID (Security Identifier ) is an unique id or value assigned to each and every domain object. Each domain object whether its a Group, User account , Computer , OU is assigned with an unique id in order to get identified by a Domain controller. All these SID's are stored in a Security Database. It looks like S-1-5-32-545 etc.

NOTE :  Domain Controller identifies object with their SID and not with the name. In order to understand this concept, open any box which is in Domain and go to any Folder properties , in Security tab you will observe it will show SID something like S-1-5-32-545 and then it tries to convert it to name.

So Lets Begin

There are several ways to find the list of SSID's , I will be covering the easiest ones.

1. To get the list of all the domain users and their SSID

Get-WmiObject win32_account | Select FullName,Name,SID,Description | ft -autosize | Out-File D:\Data.txt






2. To get SSID for a particular domain
[wmi]"win32_userAccount.Domain='<DomainName>',Name='Username'"


There are many other methods, which can be found here : Click Here
Happie Learning!

Contact us

Name

Email *

Message *

Recent

recentposts

Random

randomposts