Windows Server 2019 Automation with PowerShell Cookbook
上QQ阅读APP看书,第一时间看更新

Introduction

Windows Server 2019 provides a range of features that allows access to a wide variety of storage and storage devices. Windows supports spinning disks, USB memory sticks, and SSD devices (including MVMe SSD devices).

Before a disk can be used, you need to create partitions or volumes on the device, then format the volume. When you first initialize a disk, you need to define which partitioning method to use. You have two choices: Master Boot Record (MBR) or GUID Partition Table (GPT). For a good discussion of the differences between these two mechanisms, see: https://www.howtogeek.com/193669/whats-the-difference-between-gpt-and-mbr-when-partitioning-a-drive/.

With a volume created, you can then format the disk volume. Windows supports five key filesystems you can use: ReFS, NTFS, exFAT, UDF, and FAT32. For details of the latter four, see: https://docs.microsoft.com/en-us/windows/desktop/fileio/filesystem-functionality-comparison. The ReFS filesystem is newer and is based on NFTS, but lacks some features a file server might need (it has no encrypted files). For a comparison between the ReFS and NTFS filesystems, see: https://www.iperiusbackup.net/en/refs-vs-ntfs-differences-and-performance-comparison-when-to-use/. You examine partitioning and formatting volumes in the Managing physical disks and disk volumes recipe.

NTFS (and ReFS) volumes allow you to create access control lists (ACLs) that control access to files and folders stored in Windows volumes. Managing ACLs is somewhat difficult and lacks rich PowerShell support. To manage ACLs on NTFS volumes, as you will see in the Managing NTFS permissions recipe, you can download and use a third-party module, NTFSecurity.

The Windows File Server Resource Manager (FSRM) feature in Windows Server 2019 helps you to manage filestore resources. With FSRM, you can set Filestore quotas. With soft quotas, users can exceed their Filestore quota and administrators are notified when this occurs. With hard quotas, users are prohibited from storing more than their allocated quotas. You'll work with quotas in the Managing Filestore quotas recipe.

FSRM also supports detailed file server reporting, which you examine in the Using filesystem reporting recipe. These reports, and the supporting XML files, can provide assistance in managing and controlling file servers.

This chapter, specifically the Managing Filestore quotas recipe, makes use of a free email account from Sendgrid.com. This enables you to set up the Windows SMTP server to forward mail to SendGrid for onward transmission. This could be a great way to test reporting or to avoid issues with internal SMTP servers.