1 of 65

Advancing Remote Admin skills

  • COVID
  • Remote workers
  • Global workforce
  • Data Centers
  • Hosted Infrastructure 

1

2 of 65

Scenario # 1

2

3 of 65

Scenario # 1

  • Remote
    • WinRS
  • Chkdsk
  • Restart
  • How to chain multiple commands together for Sequential Processing 
  • How to chain multiple commands together  to create Conditional Processing 

3

4 of 65

Mastering Command-Shell Syntax

5 of 65

Syntax: 

5

Rules you have to know to play the game

6 of 65

You can learn your syntax now

Or waste time for the next 10 years learning command line syntax

6

7 of 65

Command line shells are unforgiving

  • Do it right or you again …. and again … and again

7

8 of 65

8

9 of 65

Windows has two command-line environments

PowerShell

Command Shell: CMD

9

Both are known as Command-line Shells

Both are case insensitive shells: FOO.txt = foo.txt = Foo.txt

10 of 65

PowerShell is both a CLI shell and scripting environment

  • PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. 

10

11 of 65

Now open-source, cross-platform

  • Windows PowerShell is built on the .NET Framework

  •  PowerShell Core was made open-source and cross-platform on 18 August 2016 built on .NET Core. 

11

12 of 65

Ubuntu and PowerShell?

12

13 of 65

Command Shell scripting

  • Batch files
  • Windows scripting 
    • cscript :  Starts a script to run in a command-line environment.
    • wscript Windows Script Host provides an environment in which users can execute scripts in a variety of languages that use a variety of object models to perform tasks.

13

14 of 65

PowerShell vs CMD

For the most robust, up-to-date Windows automation, Microsoft recommends using PowerShell instead of Windows Commands or Windows Script Host for Windows automation.

14

15 of 65

Developers are syntax masters��Many IT professionals have to learn the craft

15

16 of 65

Command Shell utilities: Server vs client

  • Many command shell utilities are found only on Server
  • A few only found on a boot "recovery environment" winre.wim
  • Some are assigned only to a server role
    • Network File System
    • Terminal Services (Remote Desktop Services)
    • Windows Server Backup
    • Print 

16

17 of 65

Help is not helpful if you do not know syntax rules

17

18 of 65

Command-line syntax explains how to use the software utility properly

chkdsk [<Volume>[[<Path>]<FileName>]] [/f] [/v] [/r] [/x] [/i] [/c] [/l[:<Size>]] [/b]

18

19 of 65

19

Brackets [  ]

Braces {  }

Back Slash  \

Slash /  

Angle brackets <  >

Vertical bar |   "pipe"

Space

Text without brackets or braces

20 of 65

Microsoft uses the "/" character 

  • The use of /  character is to indicate a parameter
  • Some Microsoft documentation still refers this as a switch

20

chkdsk [<volume>[[<path>]<filename>]]

[/f] [/v] [/r] [/x] [/i] [/c] [/l[:<size>]] [/b]

21 of 65

Unix/Linux ported utilities to Windows 

These utilities retain the use of a " "to indicate a parameter

  • cscript prncnfg {-g | -t | -x | -?} [-S <Servername>] [-P <Printername>]

  • Here are a few that run in command shell
    • arp
    • klist 
    • nfsadmin
    • prncnfg
    • tftp
    • Tlntadmn
    • Winrs
    • Manage-bde  (not ported but requires "-")
    • netstat

21

22 of 65

PowerShell choose " - " to indicate parameters

22

PowerShell broke with the command shell standard and moved instead to the use of the "-" for parameters

get-service -ComputerName "localhost" -name "ALG"

23 of 65

Arguments Switches or Parameters?

These terms are confusing regarding CLI shells

23

24 of 65

24

25 of 65

Some command-line utilities

Work without any parameters

25

26 of 65

Some command-line utilities

Will not work without a parameters

26

27 of 65

Some Command Shell utilities create their own shell

  • DiskPart
  • NSLookup
  • DiskShadow (server)
  • Telnet

27

28 of 65

Command-line syntax key

28

Notation

Description

Text without brackets or braces

Items you must type as shown.

Spaces

If you find a space in the command syntax, then you should use it while executing the actual command.

<Text inside angle brackets>

Placeholder for which you must supply a value.

[Text inside square brackets]

Optional items.

{Text inside braces}

Set of required items. You must choose one.

Vertical bar (|)

Separator for mutually exclusive items. You must choose one.

Ellipsis (…)

Items that can be repeated and used multiple times.

29 of 65

Text outside  brackets

  • Text Outside Brackets: Any text outside of the brackets must be used and should be used “as is” while executing the commands.

29

30 of 65

Text outside  brackets

  • Text Outside Brackets: Any text outside of the brackets must be used and should be used “as is” while executing the commands.

30

31 of 65

space

  • Spaces:  If you find a space in the command syntax, then you should use it while executing the actual command.

31

32 of 65

Brackets

  • Brackets “[ ]”: Any items or parameters inside brackets are optional

32

33 of 65

Braces

  • Braces “{ }”: Any items or parameters inside braces are a set of choices where a user should choose one

33

34 of 65

<Text inside angle brackets> 

  • Angle brackets Placeholder for which you must supply a value. 

34

35 of 65

Ellipsis ….

  • Ellipsis (“…”): Ellipsis is not so common in any syntax, but if you see an ellipsis, then it means that the item or parameter can be repeated endlessly.

35

36 of 65

Pipe

  • Pipes (Vertical Bars): Pipes or vertical bars are used to show the various parameters that you can use inside the brackets or braces. It has the same meaning as “either…or,”

36

37 of 65

Command-line syntax key

37

Notation

Description

Text without brackets or braces

Items you must type as shown.

Spaces

If you find a space in the command syntax, then you should use it while executing the actual command.

<Text inside angle brackets>

Placeholder for which you must supply a value.

[Text inside square brackets]

Optional items.

{Text inside braces}

Set of required items. You must choose one.

Vertical bar (|)

Separator for mutually exclusive items. You must choose one.

Ellipsis (…)

Items that can be repeated and used multiple times.

38 of 65

Syntax gives you powerful options

38

CommandA & CommandB (the second command is run directly after the first)

CommandA && CommandB (the second command is only run if the first was successful)

Command A || CommandB (the second command is only run if the first was not successful)

CommandA && CommandB || CommandC (the second command is only run if the first was successful, otherwise the third command is run)

39 of 65

39

Conditional 

Processing

&&

Command1 is success then Command2 runs

Command1 && Command2

||

if Command1 fails then Command2 runs

Command1 || Command2

Grouping Sets of Commands

&   &&

Command3 is run only if Command1/2 are successful

(Command1&Command2) && Command3

||  &

Command2 and Command3 run only if Command1 fails

(Command1 || Command2) & Command3

40 of 65

Chkdsk's online docs

40

chkdsk [<volume>[[<path>]<filename>]]

[/f] [/v] [/r] [/x] [/i] [/c] [/l[:<size>]] [/b]

41 of 65

Errors in documentation and  online help

41

42 of 65

Mistakes between online help and online docs

42

43 of 65

"&" allows multiple commands

43

44 of 65

44

45 of 65

45

46 of 65

46

47 of 65

Need to execute complex commands?

  • Cscript 

47

48 of 65

48

49 of 65

Command-line errors

49

50 of 65

More ways to find an error code

50

  • Use the Microsoft Error Lookup Tool.
  • Install the Debugging Tools for Windows, load a memory dump file, and then run the !err <code> command.
  • Search the Microsoft Protocols site for the raw text or error code. For more information, see [MS-ERREF]: Windows Error Codes.   You can also download a 497 page list of searchable error messages!  (PDF or DOCX

51 of 65

Download and use the error tool

C:\Tools>Err_6.4.5.exe c000021a

# for hex 0xc000021a / decimal -1073741286

STATUS_SYSTEM_PROCESS_TERMINATED                ntstatus.h 

# {Fatal System Error} 

# The %hs system process terminated unexpectedly with a 

# status of 0x%08x (0x%08x 0x%08x). 

# The system has been shut down. 

# as an HRESULT: Severity: FAILURE (1), FACILITY_NULL (0x0), Code 0x21a 

# for hex 0x21a / decimal 538 

ERROR_ABIOS_ERROR                               winerror.h 

# An error occurred in the ABIOS subsystem. 

# 2 matches found for "c000021a"

51

Be sure to keep your "Error Lookup Tool" up-to-data, download the latest version often.

52 of 65

TechSavvyProductions.com

Understand Secure Boot

52

How secure boot works in Windows 10. Secure boot allows protection from "root-kit" attacks on both clients and servers. Secure provide a trusted path to boot devices. An in-depth look at the technology that allows a validated boot process. Learn about ELAM. A quick look at how Hyper-V supports secure boot.

53 of 65

TechSavvyProductions.com

Troubleshooting Hard Disks

53

Troubleshooting non-booting PCs/Laptops, how to test quickly for HD failures. Troubleshooting flash drives and external hard drives. Understanding SMART data and how to use Seagate and Western Digital hard drive diagnostics.

YouTube: https://youtu.be/_UeT7YFdlUs

54 of 65

TechSavvyProductions.com

Troubleshooting Windows 10 Startup: Learn about Startup Settings

54

How to fix many Windows 10 boot failures. How to access advanced Windows 10 troubleshooting tools options "Startup Settings". How to access Windows Recovery, understanding the startup settings, and how to troubleshoot using them.

What is a recovery partition and how to use it? How to use the command line or PowerShell to help you get your PC working. Fixing the BCD registry key. The power of Safe Mode.

55 of 65

55

Windows Recovery is designed to allow support technicians or help desk to repair various boot problems, file system corruption, system file repair, restore your registry files, and bare metal recovery of your operating system via backups. Windows Recovery allows many command-line tools and even automated tools to run. We will explain WinRE and how to access these repair options. We demonstrate and show how to use many tools and many lesser-known ways of accessing WinRE.

TECHSAVVYPRODUCTIONS.COM

Windows Recovery Environment WinRE: Explained

56 of 65

56

Steps to solve difficult Windows 10 boot and startup failure. We will explore from POST to how Windows boot the operating system. How to solve the different problems that cause boot and startup failure.

Understand screen error messages and learn how to use them to point you to the problem. How to use "Startup Repair", "System Restore" and other boot failure tools. Understanding the files critical to boot and where the files can be found on the hard disk.

TECHSAVVYPRODUCTIONS.COM

Windows 10 startup problems: Fixing Boot Problems

57 of 65

TechSavvyProductions.com

Getting Data off prior to fixing a non-booting PC

57

Getting data off a Laptop or PC when Windows fails to boot properly is critical. A mistake often made is to attempt to repair … DON’T. Get the data or a copy of, off the device prior to working on the boot problem. We will walk you step by step on getting your data off safely using two well tested methods.

We will use a Windows 10 installation flash drive or a Linux bootable flash drive. You can also download our video notes and check out many other options to getting your data safe.

58 of 65

58

We will cover OM1-OM4 multimode cables, introduce the new OM5 cable for 100-400G. Understand cable connectors used in LAN and today's Data Centers. Build a modern transceiver, learn about SerDez and the critical ASIC chips that drive higher speeds in the Data Center.

A critical view of the cost/benefits of transceiver options. Look at the MPO/MTP connectors and how they transform fiber density.

TECHSAVVYPRODUCTIONS.COM

Fiber Optics in the LAN and Data Center

59 of 65

SOCIAL MEDIA

CREDITS

  • Social media logos and “Tech Savvy Productions” teaser created by The 11th Hour: https://www.youtube.com/user/The11thH...

59

60 of 65

Become a member

60

61 of 65

Check out our website: �https://www.techsavvyproductions.com

61

62 of 65

Want an easy and free way to support this Channel?Please Subscribe!�80% of the individuals who watch our content do not subscribe.�

62

63 of 65

We have subtitles for the following languages:

We translate subtitles on our videos into the following languages: عربى, българскиB, 简体中文), 中國傳統的), Nederlands, Suomalainen, français, Deutsche, हिंदी , , bahasa Indonesia, 日本語, 한국어, norsk, Polskie, português, Română, український, eesti keel, Española, lietuvių, latviski , Svenska, čeština, dansk, Ελληνικά, հայերեն, shqiptare, and Tiếng Việt

63

64 of 65

�A BIG THANK YOU TO ALL OF OUR VIEWERS AND SUBSCRIBERS!�

64

65 of 65

65

От Иоанна 3:16

16 Бо так сильно полюбив Бог цей світ, що віддав Свого Єдиного Сина заради того, щоб кожен, хто в Нього вірує, не був загублений, а здобув вічне життя.