vSphere: Get ESX Server Serial Numbers

KB ID 0001670

Problem

A few weeks ago I needed to sort out some extended warranty for a customers servers. To do that  I needed the serial numbers of those servers, (a mixture of IBM/Lenovo and Dell Servers).

As I didn’t fancy a drive to two different datacenters, I wanted to try and get them programatically.

Solution

After some searching I came across a post by one of my old EE buddies LucD with exactly what I needed. I’m assuming you have PowerCLI setup before beginning.

Connect to your Virtual infrastructure;

[box]

Connect-VIServer {vCenter-server-FQDN}

[/box]

Then, (assuming you have a folder called C:\Temp that you can write to).

[box]

Get-VMHost | Select Name, @{N='Serial';E={(Get-EsxCli -VMHost $_).hardware.platform.get().SerialNumber}} | Export-Csv c:\temp\serial.csv -NoTypeInformation -UseCulture

[/box]

Then  open your C:\Temp\SerialNumber.csv file, and there’s your serial numbers.

 

Related Articles, References, Credits, or External Links

NA

Brocade Switches Getting the Serial Number

KB ID 0001665

Problem

If you have fiber channel switches, (regardless of the vendor,) scratch the surface and underneath it’s probably a Brocade. (Unless it’s a Cisco Nexus then you are in the wrong place my friend, move along!) e.g an HP StorageWorks 8/8 SAN Switch (Yeah it’s a Brocade 6505), or an IBM SAN24B-4 Express Fabric Switch (you guessed it, Brocade).

If you need to get the serial number for them, here’s how.

Solution

SSH into the switch, and issue the following command;

[box]chassisshow[/box]

I need the Brocades Vendor Serial Number!

For ‘re-badged’ Brocades, some vendors, (HP for example), have a ‘Suppler Serial Number‘ also, you need to GUI into the switch manager to get that, (that means using a browser and having Java installed!) Warning: You will need to enter the switches IP or FQDN into the the ‘Safe’ list in the Java settings in the Control Panel or this will fail. Typically you then browse to http://{IP-Address}/switchExplorer_installed.html to then get access.

Go here;

1: Is the Brocade Serial Number.

2. Is the Supplier (Vendor) Serial Number.

Related Articles, References, Credits, or External Links

Brocade 300 SAN Switch – Setup and Configure

IBM Storwize: Get The Serial Number

KB ID 0001663

Problem

I’ve got a client that has a couple of Storwize V5000 storage arrays. I needed to get the serial numbers for them today, but I could not find them in the GUI?

Solution

As usual things are much simpler at command line, SSH into the storage array and simply use the following command;

[box]lsenclosure[/box]

Note: As you can see, I’ve got one Controller (with the cans in it,) and one expansion shelf. The first part of the serial denotes the model e.g. 2078-24C denotes v5000 Series controller, so in this case the serial number would be 2078-24C / 78A3381 and I’ve got an Expansion Shelf 2078-24E / 78D2CTT.

Related Articles, References, Credits, or External Links

IBM Storwize 3700 Recover Lost IP Address

Getting a Servers Serial Number (Remotely)

KB ID 0001493

Problem

If you have an iLO/iDRAC/EMM, then logging into these will give you the servers serial number, but what if they are not setup/connected, or you don’t know username or password?

Then you can use WMI to discover the serial number.

Solution

From PowerShell;

[box]

Get-Ciminstance -classname win32_bios -computername {Server-Name} | format-list serialnumber

[/box]

 

Or if you have RDP/Console access , then from an administrative command window, execute the following command;

[box]

wmic /node:%computername% bios get serialnumber

[/box]

Nice and simple!

Related Articles, References, Credits, or External Links

NA

Exchange 2019 / 2016 Manage Remotely via PowerShell

KB ID 0001465

Problem

Since Exchange 2013 we have been able to manage Exchange remotely through the Exchange Admin Center, but what if you want to use the Exchange Management Shell remotely?

Install Exchange Management Tools

This is not just the Management Shell, this will also install the Toolbox and additional help.

There are few prerequisites, but to install from a normal PowerShell prompt;

[box]

Enable-WindowsOptionalFeature -Online -FeatureName IIS-ManagementScriptingTools,IIS-ManagementScriptingTools,IIS-IIS6ManagementCompatibility,IIS-LegacySnapIn,IIS-ManagementConsole,IIS-Metabase,IIS-WebServerManagementTools,IIS-WebServerRole

./Setup.exe /Role:ManagementTools /IAcceptExchangeServerLicenseTerms

[/box]

Once Installed, You can launch the Shell itself, or you can add the Exchange PowerShell commandlets to a normal Powershell session, with the following command;

[box]

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn;

[/box]

For older versions of Exchange, the commands are slightly different;

  • Exchange 2010: Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010;
  • Exchange 2007 :Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin;

Connect to Exchange Remotely (via PowerShell)

It’s a Windows server after all, so you can bring up a remote session, first give it an account with some Exchange administrative privileges;

[box]

$UserCredential = Get-Credential

[/box]

Then connect the the Exchange Server;

[box]

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://Server-Name/PowerShell/ -Authentication Kerberos -Credential $UserCredential

Import-PSSession $Session -DisableNameChecking

[/box]

Note: As above, don’t forget to disconnect the session the you have finished.

[box]

Remove-PSSession $Session

[/box]

Related Articles, References, Credits, or External Links

NA

Remotely Log Users Off From CLI / PowerShell

KB ID 0001401

Problem

I’ve not had to do this since the days we got “The terminal server has exceeded the maximum number of allowed connections” errors. Now thankfully Windows Server tells us who is logged on so we can ‘ask politely’ before we boot them off!

Today though, my user session got all messed up, and I needed to kick ‘myself’ off remotely, (and have a fresh session.)

Solution

From a remote machine run the following command, to see who is logged on and, (more importantly get the session number for that user);

[box]QUser /SERVER:{Hostname}[/box]

Above the ID of ‘1’ denotes the session number, select the one that corresponds with the user you want to log off. Then issue the following command;

[box]Logoff /SERVER:{Hostname} /{Session} /V[/box]

Job done, that was easy!

Related Articles, References, Credits, or External Links

NA

The Remote Computer Requires Network Level Authentication (NLA)

KB ID 0001375

Problem

Seen when attempting to connect to a remote machine via Remote Desktop;

The remote computer that you are trying to connect to requires network level authentication (NLA), but your windows domain controller cannot be contacted to perform NLA. If you are an administrator on the remote computer, you can disable NLA by using the options on the remote tab of the System properties dialog box.

Also See: Windows RDP: ‘An authentication error has occurred’

Solution

Well the clue is in the error massage, RDP is enabled but it requires NLA authentication. e.g. This box has been selected.

Now, if you want NLA that’s fine, make sure your RDP client has been updated, and you, and the target, are domain authenticated, and can see a domain controller. But what if that computer is on a remote site, and you need to get on it? Or it’s in the server room downstairs and you’re lazy like me!

Well the simplest way to get on is to use a LOCAL account on that machine, (if you know the username and password for a LOCAL account,) like so;

WARNING/DISCLAIMER

This article was written at a time when clients may not have had up to date RDP clients that supported NLA, that’s no longer the case (If you are in a sole Windows environment, and you are updating your clients). Simply disabling NLA is NOT a solution. I’m really getting tired of people posting comments saying ‘This is a bad article’ and ‘I don’t understand’. Well how about you have 500 linux based thin clients that use RDP software that does not support NLA? Before posting a criticism please take some time to work in, and support a few different environments guys. And appreciate that you are here because you couldn’t fix it yourself, so you clicked on the link to come here, to read information that I’m providing for free, in my own time, to help you out.

Disable NLA Remotely (via Registry) 

Read above disclaimer before proceeding

The drawback of this method is it usually requires a reboot (which we can do remotely, but if it’s a production server that will mean some downtime).

Open Regedit > File > Connect Network Registry > Search for and select your target machine > OK.

Navigate to;

[box]HKLM  > SYSTEM > CurrentControlSet > Control  >Terminal Server > WinStations > RDP-Tcp[/box]

Locate the following two values, and set them to 0 (zero)

  • SecurityLayer
  • UserAuthentication

Give it a try now, but I found I needed to reboot the target first, using the ‘restart-computer’ PowerShell Commandlet.

Disable NLA Remotely (via PowerShell)

Read above disclaimer before proceeding

I prefer this method as it works instantly, and can be reversed just as quick! Open an administrative PowerShell command window. Execute the following two commands;

[box]

$TargetMachine = “Target-Machine-Name

(Get-WmiObject -class “Win32_TSGeneralSetting” -Namespace root\cimv2\terminalservices -ComputerName $TargetMachine -Filter “TerminalName=’RDP-tcp'”).SetUserAuthenticationRequired(0)

[/box]

Disable NLA Remote Desktop Requirement Through Group Policy

Read above disclaimer before proceeding

If you want to ‘blanket disable’ NLA then group policy is the way to go;

[box]Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Security[/box]

Locate the ‘Require user authentication for remote connections by using Network Level Authentication’ and set it to disabled.

Then Force a Domain Group Policy Refresh,

Related Articles, References, Credits, or External Links

NA

Windows Certificate Services ‘certsrv’ Website displays 403.14

KB ID 0001342 

Problem

I seem to get all the PKI/Certificate services problems! Yesterday I was trying to use the web enrolment portal on a certificate services server, and could not get in locally, (or remotely) via http, (or https) it simply showed me a 403.14 error.

HTTP Error 403.14 Forbidden

Solution

This was an odd one, in IIS Manager select the ‘Certsrv’ virtual directory > Advanced Options > And look at the ‘Path’.

Mine was missing the ‘en-us‘ folder from the end of the path!

Note: You will need to open an administrative command window, and then execute an iisreset command, before the change will take effect.

Related Articles, References, Credits, or External Links

NA

Exchange – Enable ‘Out Of Office’ For Another User

KB ID 0000843

Problem

Got in the office to find a colleague was going to be on long term sick this morning, the boss asked, “Can we turn on his out of office?”. I could have simply changed the users password and logged into OWA and done it, but executing some PowerShell would be more elegant.

Note: You must be in one of the following groups to carry out this procedure, Organizational Management, Recipient Management, or Help Desk.

Solution

Powershell Syntax

[box]

Set-MailboxAutoReplyConfiguration -Identity username -AutoReplyState Enabled/Disabled/Scheduled [-EndTime DateTime] [-ExternalAudience None/Known/All] [-ExternalMessage message] -InternalMessage message [-StartTime DateTime]

[/box]

Note: Remember the dates need to be in ‘American date format’ or the command will fail.

Example

[box]

Set-MailboxAutoReplyConfiguration -Identity 'PeteL' -StartTime '08/12/2013 08:00' -AutoReplyState Enabled -EndTime '12/31/2013 23:59' -InternalMessage 'Pete is currently out of the office' -ExternalMessage 'Pete is currently out of the office, please contact the helpdesk for technical assistance' -ExternalAudience 'All'

[/box]

 

Related Articles, References, Credits, or External Links

NA