The Unit Tutorials Are from WEEK 2. a Few Key Points for Start-Up. 1
Total Page:16
File Type:pdf, Size:1020Kb
The unit tutorials are from WEEK 2. A few key points for start-up. 1. Blended learning approach Blended learning has been implemented for this unit, which refers to a strategic and systematic approach to combining times and modes of learning, integrating the best aspects of face-to-face and online interactions, using appropriate ICTs. So the relevant technique and skills involved in this unit will be presented/delivered in different ways, for instance, lecture notes, extra notes, practical exercises, in-class discussion, as well as emails etc. As there are no face-to-face lectures, some extra notes are provided to reinforce understanding. A few sets of extra notes have been posted in vUWS; new extra notes may be added in vUWS. In addition to the unit contents in vUWS, I may use emails to further clarify administrative policies, provide hints to practical activities, present extra/supplementary materials for your information. So please check your UWS emails regularly. For example, we are not able to cover VBS features in details during tutorial classes. I may use emails to give some hints on necessary VBS features used for the practical exercises. I consider this way even more flexible and handy. 2. Consultation via emails For personal enquiries, you can also email me directly - making sure you start the subject line with '300165 SAP' and then include a relevant subject. A staff member is typically teaching multiple units, if you don't tell him/her which unit is about in your email, the staff member is not able to answer your question clearly. For any unit related inquiries, you need to use your UWS student email account; we really should not correspondent with students via external email addresses as per the university policy since they are not verifiable. Failing to follow these, your emails might be filtered out. 3. Quick start-up: a primary set of scripting skills for Windows System Administration This unit has been designed in an easy way to learn - easy contents, convenient assessment, flexible learning scheme etc., but the system administration really has a broad coverage in skills and knowledge, and it is rather a challenging job. I'd like to draw students' attention to some extra skills. 1) Command-line utilities Traditional DOS commands and associated utilities are powerful and handy in system administration. e.g. driverquery lists the installed device drivers and their properties on the system. DRIVERQUERY [/S system [/U username [/P [password]]]][/FO format] [/NH] [/V] Parameters: /S system remote system /U [domain\]user User ID /P [password] Password /FO format TABLE, LIST OR SV ... ... Useful links: DOS HeadQuarters at http://dos.rsvs.net/, where you can check both internal and external DOS Commands, useful batch files, as well as many 'DOS resource and solutions' links (some are not active though). Commandlinefu at http://www.commandlinefu.com/. It offers a simple repository for storing and sharing great shell commands on various platforms. DOSBox at http://www.dosbox.com/. It emulates an Intel x86 PC, complete with sound, graphics, mouse, joystick, modem, etc., necessary for running many old MS-DOS games. Virtualization Fun at http://virtuallyfun.superglobalmegacorp.com/. Many very old applications may not be running on the modern day platforms, however you can create virtualization environment to get them back again - it's Yesterday Once More. Sysinternals utilities at http://live.sysinternals.com/, or https://technet.microsoft.com/en- us/sysinternals (bought by Microsoft; it is now called Microsoft Windows Sysinternals). Sysinternals utilities help manage, troubleshoot and diagnose Windows systems and applications. Blog articles in systems administration at http://www.catonrug.net/. Very rich set of skills in systems administration has been presented and explained. This is one of my often accessed blogs. 2) Unattended and silent installations e.g. Install IIS automatically with custom parameters. sysocmgr /i:%windir%\inf\sysoc.inf /u:IIS.txt IIS.txt : [Components] aspnet = on iis_asp = On iis_common = On Iis_inetmgr = On iis_serversideincludes = On Iis_www = On Inetprint = On ... ... sysocmgr.exe is a command-line utility associated with System Optional Component Manager from Microsoft. 3) SQL Server scripts e.g. Stored procedure for create_servers CREATE PROCEDURE create_servers AS if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Servers]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[Servers] CREATE TABLE [dbo].[Servers] ( [Servername] [varchar] (20) NOT NULL ) ON [PRIMARY] ALTER TABLE [dbo].[Servers] WITH NOCHECK ADD CONSTRAINT [PK_Servers] PRIMARY KEY CLUSTERED ( [Servername] ) ON [PRIMARY] GO ... ... 4) Kix scripting KiXtart is a free-format scripting language and has rich built-in functionality for easy scripting. It supports COM (providing access to ADSI, ADO, WMI, etc) and thus is easily extensible. Kix scripts are not supported by Microsoft. You can check details at http://www.kixtart.org/. 5) AutoIt scripting It started life as a simple automation tool; now it has functions and features that allow it to be used as a general purpose scripting language. Refer to https://www.autoitscript.com/site/. 6) Autohotkey scripting Before using AutoHotkey, you will need to download and install it. Once you have AutoHotkey installed, you will probably want it to do stuff. You will need to tell it what to do - this process is called "Scripting". 7) Windows PowerShell Microsoft's PowerShell is a powerful command-line interface (CLI) and scripting language for task automation and configuration management framework. E.g. Service-based cmdlets: Get-Service, Start-Service, Stop-Service, Suspend-Service, Resume- Service, and Restart-Service. 8) VB scripting WSH (Windows Script Host) is a layered architecture, which supports various scripting language implementations. VBS is one language engine running on WSH for systems administration, which offers much easier way for system admin automations than the command line operations in variable control, routine calling, output formatting, readability etc. WSH and VBS are a major part in this unit for Windows system administration tasks. This unit focuses on VB scripting and some command-line utilities; other scripting skills are for your information only. Only formally presented contents in the lectures/practicals are to be assessed. 4. Exercises 1) Open command window using cmd-here Some practical tasks need to be demonstrated in a command window. While there are different ways creating a 'shell' environment, opening a command window is straightforward. One method is to run cmd-here.cmd below (type the instructions into a file and save it as cmd- here.cmd), which will pop up the command window. @ECHO off REM an easy way to support any other command line tools REM %dp0 will report and add current directory path to global windows REM %path% variable just in current session. set path=%path%;%~dp0 %systemroot%\system32\cmd.exe /s /k pushd "%~dp0" 2) Open command window as administrator when mouse pointing on folder and right-click A short-cut to opening a command window as administrator is to configure the Windows registry key. To do this, simply run the batch file OpenCommandWindowAdministrator.cmd below (type the instructions into a file and save it as OpenCommandWindowAdministrator.cmd). Then you can open command window as administrator when mouse pointing on folder and right-click on it. reg add "HKLM\SOFTWARE\Classes\Directory\shell\runas" /ve /t REG_SZ /d "Open Command Window Here" /f reg add "HKLM\SOFTWARE\Classes\Directory\shell\runas\command" /ve /t REG_SZ /d "cmd.exe /s /k pushd \"%V\"" /f pause This has not been tested on the SCEM lab machines. If this is not working, a minor modification might be needed. 5. Bash shell on Windows 10 Microsoft is bringing the Bash shell to Win 10 … It seems not a Linux emulator; it's an implementation of Linux APIs directly tied to the Windows NT kernel. 6. Multiply your learning: from vbs to Powershell, from perl to Python, … … For effective systems administration programming, you likely require multiple custom scripting programming skills based on shells or stand-alone script engines. You are encouraged to explore and practise different scripting languages. Please study the week 2 extra slides ‘Shell or Script’ to summarise and understand the key features of the scripting languages listed. .