How to fetch ESX config with SSH

If you cant connect to ESX with SSH
If you can, you can scroll down to ” SSH to EXS host login with the root”


Login to Vcenter with Vmwarevsphere web client
Pick Esx, pick Manage to the left, then you will have a menu called Settings.
Then you go to the Security Profile.

ESX config with SSH 1


Now you can click on Edit (not sure if it’s necessary to mark SSH?)

ESX config with SSH 2


Mark SSH and click on Start or Stop depending on what you want to do

ESX config with SSH 3


SSH to EXS host login with root

Run this command: vim-cmd hostsvc/firmware/backup_config
Bundle can be downloaded at : http://*/downloads/random.url/configBundle-localhost.tgz
Replace * with IP for that ESX host.
Surf to that URL and you can download the config file

And you’re done.


Don’t forget to turn off SSH to EXS if that you want

Powershell SMB

Windows Server 2012 R2 & 2016: PowerShell methods

Detect: SMB v1
Get-WindowsFeature FS-SMB1

Disable:
Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol

Enable:
Enable-WindowsOptionalFeature -Online -FeatureName smb1protocol

Detect: SMB v2/v3
Get-SmbServerConfiguration | Select EnableSMB2Protocol

Disable:
Set-SmbServerConfiguration -EnableSMB2Protocol $false

Enable:
Set-SmbServerConfiguration -EnableSMB2Protocol $true

Windows 8.1 and Windows 10: PowerShell method

Detect: SMB v1 Protocol
Get-WindowsOptionalFeature –Online –FeatureName SMB1Protocol

Disable:
Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol

Enable:
Enable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol

Detect: SMB v2/v3 Protocol
Get-SmbServerConfiguration | Select EnableSMB2Protocol

Disable:
Set-SmbServerConfiguration –EnableSMB2Protocol $false

Enable:
Set-SmbServerConfiguration –EnableSMB2Protocol $true

Read more about at Microsoft

HP Switch Commands


SwitchNameNo = replaced with the name of the real switch name, you will see when you log in on the switch, with Putty for example.


SwitchNameNo# show interfaces brief    =    This command will show all port if they are active or not example below

  Port  Type      | Alert     Enabled Status Mode       Mode  Ctrl  Limit

  —– ——— + ——— ——- —— ———- —– —– ——

  4     100/1000T | No        Yes     Up     1000FDx    MDI   off   0 Activity

  5     100/1000T | No        Yes     Down   1000FDx    MDIX  off    No Activity



SwithNameNo # conf t  =  Enter config

SwitchNameNameNo (config)# vlan 999   =  You will enter vlan 999

SwitchNameNo (vlan-999)# untagged 6   =  Remove vlan tag on port in the vlan 999

SwitchNamehNo (vlan-999)# tagged Trk3   =  Tag vlan 999 to a Trunk

SwitchNameNo (vlan-999)# tagged 6   =  Tag a port to a specific vlan

SwitchNameNo (vlan-205)# show run   =  Show information about all port on the switch

SwitchNameNo (config)# wr mem  =  “publish your change to the Switch”

SwitchNameNo (config)# write memory   =  “publish your change to the Switch”

SwitchNameNo (vlan-201)# exit   =  Exit specific location you are, you repeat that you will finally logout.


Note: if you do not for example run wr mem when you are done,
all the change will be gone, if something happens to the switch that force it to reboot or lose power.

Scheduled task as SYSTEM

For Windows Server 2008 (probably works very similar to later versions as well) this is how to change to use the SYSTEM user account when executing a scheduled task:

  1. Go to Start > Administrative Tools > Task Scheduler
  2. In the Task Scheduler window click “Create Task” on the right-hand bar under the “Actions” pane
  3. In the “Create Task” dialog click the “Change User or Group” button
  4. Make sure “From this location” is set to the local machine name (to change click “Locations” button and select the local computer name)
  5. Type “SYSTEM” in the text box and press ok. Under “When running the task, use the following user account:” you should see “NT AUTHORITY\SYSTEM“.

Powershell mount drive

How to mount a drive in Powershell



$url = hostname
$folder = specific folder
$port = port nr
$username = account name
$pass = password

 

$connectTestResult = Test-NetConnection -ComputerName $url -Port $port
if ($connectTestResult.TcpTestSucceeded) {
    # Save the password so the drive will persist on reboot
    cmd.exe /C "cmdkey /add:`"$url`" /user:`"$username`" /pass:`$pass`""
    # Mount the drive
    New-PSDrive -Name Z -PSProvider FileSystem -Root "$folder"-Persist
} else {
    Write-Error -Message "Unable to reach the $url storage account via port $port. Check to make sure your organization or ISP is not blocking port $port"

}

Microsoft end of extended support

Keep track of Support that will soon expire

Windows 7 Support Ends January 14, 2020
This End of Life means no more bug-fixes, security patches or new functionality, making any user – personal or enterprise – significantly more susceptible to malware attacks.


Seven editions of Windows Server 2008 R2 were released: Foundation, Standard, Enterprise, Datacenter, Web, HPC Server, and Itanium, as well as Windows Storage Server 2008 R2, and the end of Extended Support 2020-01-14.


Windows Home Server 2011 is the last Windows Home Server release, Windows Small Business Server 2011, Windows MultiPoint Server 2011, Windows Home Server 2011 and Windows MultiPoint Server 2010, and the end of Extended Support 2020-01-14.


Windows 8.1 falls under the same lifecycle policy as Windows 8 and will reach the end of Mainstream Support on January 9, 2018, and end of Extended Support on January 10, 2023.


Windows Server 2012 has four editions: Foundation, Essentials, Standard and Datacenter, and the end of Extended Support 2023-10-10.

Import CSV file Excel

Do you have a CSV, that you want to have more readable?
That’s easy to import it to Excel and transform it into a more readable file.
Just follow these steps.
Good luck.

How to import CSV file into Excel

You have Excel file that you want to be more readable in Excel
Open clean excel sheet (blank)

Under tab Data, you can find

New windows are just to click ok then you are done.

Convert to PFX with OpenSSL

Are you in need of PFX file, or as some people will say a P12 (pkcs12).
What do you need to do to perform this convert?
First off you need Openssl. Then you need crt file and the key file.

After that is just run this command below to convert to PFX with OpenSSL

openssl pkcs12 -export -out application-company-domain.pfx -inkey application-company-domain.key -in application-company-domain.crt


If you are not sure about the password to the key file, to test the key is valid with a password you have, try this command.

openssl rsa -in application-company-domain.key


There you have some other post about OpenSSL