Reconfigure diagnostic partition using Get-EsxCli -V2

The following powershell snippet is going to unconfigure the diagnostic coredump partition using the esxcli version 2 cmdlet. The second part will reconfigure the diagnostic partition with the ‘smart’ option so that an accessible partition is chosen.

If you want to configure a new diagnostic partition the you will find the necessary information in the following VMware knowledge base article: Configuring a diagnostic coredump partition on an ESXi 5.x/6.x host (2004299). There will be additional steps to supply the partition id.

First we connect to the esxi host directly and insert the connection details in the variable $srv:

Then we create a esxcli object $esxcli using the variable $srv we created previously:

Now we create a variable $arg to store the arguments we will provide later:

Setting the $arg property ‘unconfigure’ to true will deactivate the diagnostic partition:

The invoke command will invoke the command remotely on the esxi host. After execution the diagnostic partition is deactivated:

The second part starts with creating a new set of arguments:

Reactivate the coredump, because we deactivated it before:

Enable the coredump partition:

The ‘smart’ property will try to use an accessible partition:

The last argument will configure the diagnostic partition using the supplied parameters:

List registered SPNs in Active Directory: pimped

List all registered SPNs in Active Directory: pimped

This will go and poll all your registered SPNs in Active Directory and write them to a file. It accepts Debug, Log_Dir and Log_FileName as parameters.

Source: http://social.technet.microsoft.com/wiki/contents/articles/18996.list-all-spns-used-in-your-active-directory.aspx

 

Powershell Test AlwaysOn

Powershell Test AlwaysOn

This script checks which node is the primary in the SQL AlwaysOn cluster. A test database has been added to see if that database is writable. All actions are logged to a log file.

This script is not to be run in a production environment. The purpose of this script is to see if the SQL AlwaysOn Availability Group has done a failover. It also checks if a database within this AG is writable and if not how long it has been offline.
The part to check which node is the primary has been found on a blog, which I would have given the credits if I remembered where I found it.