Useful commands for Dell servers M1000E CMC

Here are some commands that may come in handy for Dell systems.  

Diagnostic log-gathering commands for an M1000e enclosure

  • racadm dumplogs – Hidden command. Useful but VERY verbose logs
  • racadm racdump – Less verbose than dumplogs
  • racadm getsel – Grab the SEL (System Event Log) from the chassis
  • racadm getraclog – Similar to getting syslog output
  • racadm clrsel / clrraclog –  Clear SEL or raclog. They do fill up

To capture the output of these commands, do something like:

ssh mym1000ehostname dumplogs > /tmp/thelogfile

Current M1000e status

  • racadm getmodinfo – Health, presence, service tags of chassis, blades, switches, etc.
  • racadm getmacaddress – Grab MAC addresses for every ethernet interface on the blades and chassis
  • racadm getsensorinfo – Fan speeds, chassis ambient temperature, power supply status
  • racadm getpbinfo / getpminfo – Power status
  • racadm getversion – Get blade iDRAC versions and blade types
  • racadm getversion -c – Get blade CPLD versions
  • racadm getversion -b – Get blade BIOS versions

(Just type “?” for more information and look at the get commands.  These are the ones I use frequently or ones that are very useful yet may not be well-known)

Powerful M1000e commands

  • racadm racreset -m server-12 – Reset the iDRAC on blade 12 from the CMC (safe for the OS).  If the iDRAC is still alive, it can also be done with ipmitool -H remote-idrac.example.com -I lan mc reset cold
  • racadm serveraction -m server-3 powerdown – Hard power off server 3
  • racadm ? serveraction – Get list of other actions to control power to blades
  • racadm serveraction -m server-4 -f reseat – Virtual reseat a blade. Not safe to do with the OS up since it’s the same as suddenly pulling the power plug.  This fixes many problems.
  • racadm serveraction -a powerup – Power up all blades. (Power up is staggered by the CMC)
  • racadm racreset – Reboot the CMC. Safe operation for the blades. Wear ear plugs.
  • racadm chassisaction -m switch-2 reset –  reset switch 2 from the CMC command line.

Change BIOS settings on Dell servers
The Dell Deployment Toolkit can do all sorts of fun things.  The syscfg command queries and changes BIOS settings such as C-states, C1E, turbo mode, virtualization, hyperthreading/SMT, power loss/recovery boot action, boot order, USB port accessibility, memory node interleaving, and much more.

For desktops and laptops, try Dell’s Client Configuration Toolkit (CCTK) which works in Windows and Linux.

There is an unfortunate bug in Dell’s software depending on how you install it.  For us, running dsetchanges /etc/omreg.cfg to something that then breaks syscfg.  Keep a backup copy and change it back after running dset.  I’m sure we can change the installation paths to make it work… Maybe one of these days.

A few examples (changes usually require a reboot):

  • racadm syscfg -h – List all the options for syscfg
  • racadm syscfg -h –somecommandname – Description of a command
  • racadm syscfg –cstates=enable – Enable C-states
  • racadm syscfg –virtualization – Query current virtualization setting
  • racadm syscfg –bootseq=usbfloppy.slot.1,usbcdrom.slot.1,nic.emb.1,hdd.emb.0 – Change bootorder

 

Source: http://tech.ryancox.net/2010/12/useful-commands-for-dell-servers.html

Enterprise Root CA can’t issue more than 2-year certificate

If you want to issue a certificate with 20 years expiration, run this commands:

certutil -setreg ca\ValidityPeriodUnits 20

certutil -setreg ca\ValidityPeriod "Years"

net stop certsvc

net start certsvc

 

To issues a certificate with a template, run this command

certreq -submit -attrib "CertificateTemplate:CertificateTemplateName" CSRfile.csr

 

 

Found OEM product information

If you need to found OEM product information in Windows, you can run this powershell command.

Such as serial number / product type / product type or Vendor.

gwmi win32_ComputerSystem | select OEMStringArray
wmic csproduct list /format:list
Get-WmiObject Win32_BIOS | Select-Object SerialNumber

 

List all enabled user in Active Directory

How to list all enabled user in active directory:

Get-ADUser -filter {Enabled -eq $True} -Properties "DisplayName","emailaddress" | select name,emailaddress

How to list all enabled user in active directory, for a given OU:

Get-ADUser -SearchBase "OU=Accounts,OU=RootOU,DC=ChildDomain,DC=RootDomain,DC=com" -filter {Enabled -eq $True} -Properties "DisplayName","emailaddress","title" | select name,emailaddress

 

MSTSC – File not found

Today I have this problem that I could connect from a machine, running windows 7.
The error I got was:
The system cannot find the file specified.
C:\Windows\system32\<LANG_NAME>\mstsc.exe.MUI

I then search for mstsc.exe, and right click on it, and choice properties, and choice tab Details, look for language. In my example, my computer was a Danish computer, but MSTSC, was in English.
Look also for the version, if it 6.2 it is a 8.0 version, and if it 6.3 it’s a 8.1 version.
Then download the English version of mstsc (in the right version) on yours computer:
version 8: https://support.microsoft.com/en-us/kb/2592687
version 8.1: https://support.microsoft.com/en-us/kb/2923545 
And install it.

Edit an Group Policy object

If you receive this warning in Group Policy Management, when you are trying to edit an Group policy object:

Failed to open the Group Policy Object. You may not have appropriate rights.

Details:
The system cannot find the path specified.

This warning can happen, when one of the following folders are missing:
  • %SystemRoot%\Sysvol\Sysvol\DomainName
  • %SystemRoot%\Sysvol\Sysvol\DomainName\Policies
  • %SystemRoot%\Sysvol\Sysvol\DomainName\Policies\{GUID}
  • %SystemRoot%\Sysvol\Sysvol\DomainName\Policies\{GUID}\Machine
  • %SystemRoot%\Sysvol\Sysvol\DomainName\Policies\{GUID}\User

In my case, I was missing the Machine folder. I just created that folder, and then i could edit the object again.

Deny Dropbox from running with GPO

Start Group Policy Management Editor
Go to:
Computer Configuration\Policies\Windows Settings\Security Settings\Software Restriction Policies

If you see:

Dropbox1

On the right screen, then you need to right click on Software Restriction Policies, and choice “New Software Restricition Policies” first.

Right click on
Additional Rules, and choice “New Path Rule…”

Path should be:
%AppData%\Dropbox\bin\*.exe
Set security level to Disallowed
Dropbox2

Make a another new Path rule, and set path to:
%AppData%\Roaming\Dropbox\bin\*.exe

Set security level to Disallowed

To update GPO right away:
Run CMD as Administrator, and type: gpupdate /force
Dropbox3

This will update the group policy on the machine this command is run at.

Get a list of all VM in a cluster, that dosen’t hve Limit CPU For migration set to true

Get a list of all VM in a cluster, that dosen’t hve Limit CPU For migration set to true:

Import-Module -Name "virtualmachinemanager"
Get-Vmmserver localhost
$hc = Get-VMHostCluster -Name CLUSTERNMAE
$hosts =get-vmhost -VMHostCluster $hc
foreach($h in $hosts) {
	get-vm -vmhost $h |Where { $_.LimitCPUForMigration –eq $FALSE } | select Name
}

 

Shring SQL log file

USE [TestDb]
GO
ALTER DATABASE [TestDb] SET RECOVERY SIMPLE WITH NO_WAIT
DBCC SHRINKFILE([TestDb_Log], 1)
ALTER DATABASE [TestDb] SET RECOVERY FULL WITH NO_WAIT
GO

 

Where TestDB, is the database name, and TestDB_Log is the SQL Log file name.