70-740, Teil 1.2.3. Rollen und Funktionen auf Nanoserver implementieren

70-740, Teil 1.2.3.

Rollen und Funktionen auf Nanoserver implementieren

Ideen für die Recherche im Web:

technet nano server packages

technet Enable-WindowsOptionalFeature

technet nano server “dns” installieren

Zum Nachschlagen:

https://technet.microsoft.com/de-de/windows-server-docs/get-started/deploy-nano-server

https://technet.microsoft.com/de-de/library/dn376466.aspx

Übungen:

# Beispiel 1

Get-Command *-PackageProvider

#Get-Help Get-PackageProvider

Get-PackageProvider

#Get-Help Get-PackageProvider

Find-PackageProvider

#Get-Help Find-PackageProvider

Find-PackageProvider *NanoServer*

Find-PackageProvider NanoServerPackage

Find-PackageProvider

Install-PackageProvider NanoServerPackage

Get-Help Install-PackageProvider

get-command *-NanoServerPackage

Find-NanoServerPackage

Find-NanoServerPackage | Measure-Object

Find-NanoServerPackage *DNS*

Save-NanoServerPackage Microsoft-NanoServer-DNS-Package

Install-NanoServerPackage Microsoft-NanoServer-DNS-Package

Import-PackageProvider Microsoft-NanoServer-DNS-Package

Get-Help Import-PackageProvider

# Beispiel 2

Enter-PSSession -ComputerName wdN1

Get-PackageProvider

Find-PackageProvider

Find-PackageProvider -Name NanoServerPackage | fl

Install-Module -Name NanoServerPackage -SkipPublisherCheck -force

Install-NanoServerPackage Microsoft-NanoServer-DNS-Package -Culture de-de

Enable-WindowsOptionalFeature -Online -FeatureName DNS-Server-Full-Role

Import-Module DNSServer

Get-Command -Module DNSServer

Get-WindowsOptionalFeature -Online

###

# Beispiel 3

Get-VM wdN1

Stop-VM wdN1

Get-VM wdN1

Install-Module -Name NanoServerPackage -SkipPublisherCheck -force

Install-NanoServerPackage -Name Microsoft-NanoServer-Compute-Package -Culture de-de -ToVhd “C:\NanoServerImageGenerator\wdN1.vhdx”

Start-VM wdN1

Enter-PSSession -VMName wdN1

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

Get-WindowsOptionalFeature -online

Exit-PSSession

Stop-VM wdN1

Set-VMProcessor -VMName wdN1 -ExposeVirtualizationExtensions $true

Set-VMMemory wdN1 -DynamicMemoryEnabled $false

Set-VM -name wdN1 –MemoryStartupBytes 4GB

Get-VMNetworkAdapter -VMName wdN1 | Set-VMNetworkAdapter -MacAddressSpoofing On

Start-VM wdN1

Enter-PSSession -VMName wdN1

Get-VM

New-VM -NewVHDPath “V:\Virtuelle Festplatten\wdN1C1.vhdx” -NewVHDSizeBytes 32GB -Generation 2 -MemoryStartupBytes 2048MB -Name wdN1C1

get-vm

###

# Beispiel 4

Enter-PSSession -ComputerName wd2016nano1

Get-PackageProvider

Find-PackageProvider

Find-NanoServerPackage -Name *

Install-Module -Name NanoServerPackage -SkipPublisherCheck -force

Install-NanoServerPackage Microsoft-NanoServer-DNS-Package -Culture de-de

Enable-WindowsOptionalFeature -Online -FeatureName DNS-Server-Full-Role

Import-Module DNSServer

Get-Command -Module DNSServer

Get-WindowsOptionalFeature -Online

###

# Beispiel 5

Get-VM

Stop-VM wd2016nanoC6

Get-VM

Install-Module -Name NanoServerPackage -SkipPublisherCheck -force

Install-NanoServerPackage -Name Microsoft-NanoServer-Compute-Package -Culture de-de -ToVhd “C:\NanoServerImageGenerator\wd2016nanoC6\wd2016nanoC6.vhdx”

Start-VM wd2016nanoC6

Enter-PSSession -VMName wd2016nanoC6

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

Get-WindowsOptionalFeature -online

Exit-PSSession

Stop-VM wd2016nanoC6

Set-VMProcessor -VMName wd2016nanoC6 -ExposeVirtualizationExtensions $true

Set-VMMemory wd2016nanoC6 -DynamicMemoryEnabled $false

Set-VM -name wd2016nanoC6 –MemoryStartupBytes 8GB

Get-VMNetworkAdapter -VMName wd2016nanoC6 | Set-VMNetworkAdapter -MacAddressSpoofing On

Start-VM wd2016nanoC6

Enter-PSSession -VMName wd2016nanoC6

get-vm

New-VM -NewVHDPath “V:\Virtuelle Festplatten\wd2016nanoC6C1.vhdx” -NewVHDSizeBytes 32GB -Generation 2 -MemoryStartupBytes 1024MB -Name wd2016nanoC6C1New-VM -NewVHDPath wd2016nanoC6C1.vhdx -NewVHDSizeBytes 32GB -Generation 2 -MemoryStartupBytes 1024MB -Name wd2016nanoC6C1

get-vm

###

#Beispiel 6

dir D:\

Copy-Item D:\NanoServer\NanoServerImageGenerator -Destination C:\ -Recurse

cd C:\NanoServerImageGenerator

Get-ExecutionPolicy

# Bei Bedarf: Set-ExecutionPolicy RemoteSigned

Import-Module .\NanoServerImageGenerator -Verbose

New-NanoServerImage -DeploymentType Guest -Edition Datacenter -TargetPath .\wd-nano1A.vhdx -BasePath .\Base -ComputerName wd-nano1A -DomainName multi.media -EnableRemoteManagementPort -InterfaceNameOrIndex Ethernet -Ipv4Address 10.10.3.110 -Ipv4Dns 10.10.3.1 -Ipv4Gateway 10.0.3.1 -Ipv4SubnetMask 255.0.0.0 -ReuseDomainNode

$var_Switch = Get-VMSwitch -SwitchType External

$var_Switch.Name

New-VM -VHDPath .\wd-nano1A.vhdx -Generation 2 -MemoryStartupBytes 2GB -Name wd-nano1A -SwitchName $var_Switch.Name

Get-VM wd-nano1A

Start-VM wd-nano1A

$var_PSSession3_wd_nano1A = New-PSSession -ComputerName wd-nano1A

Get-PSSession | ft Name, VMName, ComputerName -AutoSize

Invoke-Command -Session $var_PSSession3_wd_nano1A -ScriptBlock {Get-WindowsOptionalFeature -Online}

Enter-PSSession -Session $var_PSSession3_wd_nano1A

Get-WindowsOptionalFeature -Online

Get-PackageProvider

Find-PackageProvider

Find-PackageProvider -Name NanoServerPackage | fl

Install-Module -Name NanoServerPackage -SkipPublisherCheck -force

Install-NanoServerPackage Microsoft-NanoServer-DNS-Package -Culture de-de

Enable-WindowsOptionalFeature -Online -FeatureName DNS-Server-Full-Role

Import-Module DNSServer

Get-Command -Module DNSServer

Get-WindowsOptionalFeature -Online

Exit-PSSession

###

#Zum Vergleich:
#https://docs.microsoft.com/de-de/powershell/module/nanoserverimagegenerator/edit-nanoserverimage?view=win10-ps
#Edit-NanoServerImage -MediaPath D:\ -BasePath .\Base -TargetPath .\NanoServer1.vhdx -Compute -ComputerName Nano1 -DomainName kaffee.pause