Search This Blog

Use \\?\UNC\ on A UNC Name to Work Around Windows 260 Characters File Name Limit

Prefixing the file name with “\\?\” can work around the Windows 260 characters (up to 32,000 characters) file name limit in some command line utilities. For example, for local file, dir \\?\c:\longfilename.txt.

However, the syntax is different on a UNC name, it needs to be \\?\UNC\servername\share\longfilename.txt. For example, dir \\?\UNC\fileserver\dept\it\longfilename.txt.

Not all the command line utilities support this syntax.

  • Icacls - support
  • PowerShell (get-acl) - not support, because of .NET

For more info see

Long Paths in .NET, Part 1 of 3

Remove OneDrive from File Explorer Side Panel in Windows 10

On my work PC, I use OneDrive for Business instead of OneDrive. By default Windows 10 includes an OneDrive shortcut in File Explorer side panel.

OneDrive.01OneDrive.02

Change the following registry key to remove it.

  • {HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}
  • In the subkey System.IsPinnedToNameSpaceTree change the DWORD from 1 to 0
  • No reboot required.

Source: Microsoft TechNet Forums

Use Sigcheck and VirusTotal to Scan Files for Malware

Sigcheck is a tool to check files digital signature, and recently is updated to auidt the root CA stores. And it can also be used to scan files for malware via VirusTotal.

Unless the -vs option is used, sigcheck only compares the hash of a file in VirusTotal’s database to determine whether the file contains malware.

  • Download the latest version of Sigcheck (as of 01/26/2016, v.2.42)
  • Unzip the zip file to a folder
  • Open Command Prompt as Administrator, and change to the folder
  • Run sigcheck.exe -vt, and enter y to agree the VirusTotal policy
  • To scan a file: sigcheck.exe -v <filename>
  • To upload a file that is not previously scanned to VirtualTotal; the file size is up to 128MB: sigcheck.exe -vs <filename>
  • To scan a folder and subfolder: sigcheck.exe -v -s <foldername>
  • To scan and create a CSV report: sigcheck.exe -v -s -c <foldername> > <report.csv>
    • Check the VT detection column for the number of antivirus engine deteted a malware and used
    • Open the URL in VT link in a browser to get the detail of the analysis - which antivirus engine and type of malware

Fix A VSAN Host Shows 0 of 0 Disks In Use

We have three hosts running on VSAN 6.1. Today the Disk Management in vSphere Client shows one of the hosts 0 of 0 Disk in Use.

VSAN.Disk.Missing.01

And in VSAN General, it shows the warning of Mixed On-disk Format Version, and there is an upgrade button next to it. (Do Not Click It - I didn’t click it, and am not sure what the impact would be). Because our VSAN environment is built from scratch with VSAN 6.1, it is not upgrade from VSAN 5.5. It does not make sense the disk format requires an upgrade.

VSAN.Disk.Missing.02

Troubleshoot

  • Run VSAN Health check, everthing is green.

VSAN.Disk.Missing.03

  • The affected host shows all the disks under its Manage, Storage, Storage Devices.

VSAN.Disk.Missing.04

Solution

  • Click the first icon under Storage Devices to refresh the host’s storage information.

VSAN.Disk.Missing.05

Now the Disk Management and On Disk Fromat are back to normal.

VSAN.Disk.Missing.06

VSAN.Disk.Missing.07

Configure ESXi Network Dump Collector

When booting the ESXi from a SD, you probably need to reconfigure the ESXi dump collector location to a persistent datastore or a network dump collector.

The reason is the ESXi installer puts the scratch partition in “/tmp/scratch” on the local ramdisk. see the quote below from Booting ESXi off USB/SD.

3.  Where does the scratch partition get placed when booting from USB?

Because USB/SD devices are sensitive to high amounts of I/O the installer will not place the scratch partition on a USB/SD device.  Instead, the installer first scans for a local 4GB vfat partition, if it doesn’t find one it will then scan for a local VMFS volume on which to create a scratch directory.  If no local vfat partition or VMFS volume is found, as a last resort the installer will put the scratch partition in “/tmp/scratch” (i.e. put scratch on the local ramdisk).  If this happens it’s a good idea to manually reconfigure the scratch partition after the install.

The persistent store can be any available datastore (NFS, FC, iSCSI, local), except the VSAN datastore. If the ESXi host is a VSAN host, it’s likely you need to use the network dump collector instead of the persistent datastore.

There are two parts to set up the network dump collector:

  1. On the VCSA: Enable VMware vSphere ESXi Dump Collector service via vSphere Web Client
    • Administration, System Configurations, Services, VMware vSphere ESXi Dump Collector
    • Actions, Edit Startup Type, Automatic
    • Actions, Start
    • Note: the coredump file location is /var/core/netdumps
  2. On each ESXi host:
    • SSH to the ESXi host
    • esxcli system coredump network get
    • esxcli system coredump network set --interface-name <vmk0> --server-ipv4 <VCSA-IP-Address> --server-port 6500
    • esxcli system coredump network set --enable true
    • esxcli system coredump network check
      • or check the VCSA log file /var/log/vmware/netdumper/netdumper.log
    • /sbin/auto-backup.sh
      • to save the configuration file to persist after a reboot

See more info from “Booting ESXi off USB/SD”, KB2002955, Configure and Test of ESXi Dump Collector.

Use Telnet to Send HTTP Request

  • Launch Command Prompt
  • telnet <web-server> <port>
  • HEAD / HTTP/1.0
  • press Enter twice

Or

  • Launch Command Prompt
  • telnet <web-server> <port>
  • GET / HTTP/1.1
  • host: <web-server-hostname>
  • press Enter twice

Note: the HTTP commands in bold are case-sensitive, must be entered in the uppercase.

Removing Snapshots Can Cause VM Unresponsive

The first thing to remember is not to keep a VM snapshot for a long time – e.g. a few days for a busy VM. Because it

  • Can impact the VM performance and
  • Can cause the VM unresponsive when removing the snapshot (see KB1002836)

The second thing to remember is that removing or consolidating VM snapshots (particular a VM with a large snapshot file) when the VM is not busy.

Use WinSCP to Transfer Files in vCSA 6.7

This is a quick update on my previous post “ Use WinSCP to Transfer Files in vCSA 6.5 ”. When I try the same SFTP server setting in vCSA 6.7...