{"id":222,"date":"2018-08-09T22:08:05","date_gmt":"2018-08-09T22:08:05","guid":{"rendered":"http:\/\/certcent.io\/?p=222"},"modified":"2018-08-09T22:08:05","modified_gmt":"2018-08-09T22:08:05","slug":"windows-server-2016-exam-powershell-commands-to-know-70-740","status":"publish","type":"post","link":"https:\/\/certcent.io\/index.php\/2018\/08\/09\/windows-server-2016-exam-powershell-commands-to-know-70-740\/","title":{"rendered":"Windows Server 2016 Exam &#8211; PowerShell Commands to Know (70-740)"},"content":{"rendered":"<p>Here&#8217;s a short list of PS commands that you may not know now, but they have a high likelihood of showing up on the exam:<br \/>\n<strong>NANOSERVER<\/strong><br \/>\nNew-NanoServerImage:<br \/>\nThis module is imported from the Windows 2016 ISO D:\\NanoServer\\NanoServerImageGenerator<strong>\\NanoServerImageGenerator.psm1<\/strong><br \/>\nCommands that are included with this module:<br \/>\n<strong>gcm -module<\/strong><br \/>\n<strong>Edit-NanoServerImage, Get-NanoServerPackage, and New-NanoServerImage.<\/strong><br \/>\nCreating a new image:<\/p>\n<pre class=\"lang:default decode:true \">new-nanoserverimage -deploymenttype guest -edition standard -mediapath d:\\ -targetpath\nc:\\temp\\nanoserver1.vhdx -computername nano1<\/pre>\n<p><strong>Different packages for different features:<\/strong><br \/>\n<strong>Microsoft-NanoServer-DSC-Package<\/strong> Installs the Desired State Configuration<br \/>\n(DSC) package on the image specified by the TargetPath variable.<br \/>\n<strong>Microsoft-NanoServer-DNS-Package<\/strong> Installs the DNS Server role on the image<br \/>\nspecified by the TargetPath variable.<br \/>\n<strong>Microsoft-NanoServer-IIS-Package<\/strong> Installs the IIS role on the image specified<br \/>\nby the TargetPath variable.<br \/>\n<strong>Microsoft-NanoServer-SCVMM-Package<\/strong> Installs the System Center Virtual<br \/>\nMachine Manager agent on the image specified by the TargetPath variable.<br \/>\n<strong>Microsoft-NanoServer-SCVMM-Compute-Package<\/strong> Installs the Hyper-V role &#8211; Can you use the -compute switch when created a new NanoServer Image.<br \/>\non the image specified by the TargetPath variable, so that is it manageable with<br \/>\n<strong>Microsoft-NanoServer-NPDS-Package<\/strong> Installs the Network Performance<br \/>\nDiagnostics Service on the image specified by the TargetPath variable.<br \/>\n<strong>Microsoft-NanoServer-DCB-Package<\/strong> Installs Data Center Bridging on the<br \/>\nimage specified by the TargetPath variable.<br \/>\n<strong>Microsoft-NanoServer-SecureStartup-Package<\/strong> Installs Secure Startup on the<br \/>\nimage specified by the TargetPath variable.<br \/>\n<strong>Microsoft-NanoServer-ShieldedVM-Package<\/strong> Installs the Shielded Virtual<br \/>\nMachine package on the image specified by the TargetPath variable (Datacenter<br \/>\nedition only).<br \/>\nAdding a package to an existing image:<\/p>\n<pre class=\"lang:default decode:true \">edit-nanoserverimage -basepath c:\\nanoserver\\base -targetpath\nc:\\nanoserver\\nano1.vhdx\n-packages microsoft-nanoserver-iis-package<\/pre>\n<p><strong>Get-WindowsOptionalFeature &#8211; <\/strong>This can be used to check what roles on installed inside the PS session.<br \/>\n<strong>Find-NanoServer Package: <\/strong>Searches online for nano package.<br \/>\n<strong>Install-PackageProvider (part of PowerShell Gallery)  <\/strong>and <strong>Save-NanoServerPackage &#8211; <\/strong>Use this two modules to download and save a nano server package to install.<br \/>\n<strong>NanoServer-Storage-Package <\/strong>&#8211; Install package to allow formatting of ReFS.<br \/>\n<strong>CLUSTERING<\/strong><br \/>\n<strong>Move-ClusterGroup: <\/strong>Move a VM from one server to another minimizing downtime.   Nodes are both members of a cluster.<br \/>\n<strong>Convert-VHD: <\/strong>To use a virtual disk as a shared virtual disk for a guest fail-over cluster.<br \/>\n<strong>Get-ClusterLog &#8211; <\/strong>View logs of cluster, e.g., server fails and you need to identify the cause.<br \/>\n<strong>(Get-Cluster).AutoBalancerLevel &#8211; <\/strong>Change load balancing for a cluster.<br \/>\n<strong>wmic ComputerSystem Set Workgroup =&#8217;workgroupb&#8217; <\/strong>and <strong>New-Cluster-Name Cluster1 -Node Server1,Server2 -AdministrativeAccessPoint DNS <\/strong>&#8211; Create a fail-over cluster in a workgroup mode.<br \/>\n<strong>NETWORKING<br \/>\n<\/strong><strong>Set-VMNetworkAdapter &#8211; <\/strong>Limit the maximum network bandwidth available to a VM.<br \/>\n<strong>Set-NetQosPolicy &#8211; <\/strong>Use to limit traffic bandwidth between servers.<br \/>\n<strong>Set-VMNetworkAdapter -MacAddressSpoofing On\/Off &#8211; <\/strong>Ensure machines inside a nested Hyper-V can communicate with each other<br \/>\n<strong>Set-VMSwitch &#8211; <\/strong>Ensure VMs can communicate with each other.<br \/>\n<strong>Add-VMNetworkAdapterAcl &#8211; <\/strong>resource metering of traffic to track amount of network traffic VMs send between each other.<br \/>\n<strong>Storage<br \/>\n<\/strong><strong>Set-SRPartnership &#8211; <\/strong>A server fails in a replica, from another server you can ensure access is still available.<br \/>\n<strong>Optimize-VHD &#8211; <\/strong>Limit the amount of space used by a VHD.<br \/>\n<strong>Resize-VirtualDisk &#8211; <\/strong>Extend a partition in a storage pool.<br \/>\n<strong>Resize-IscsiVirtualDisk &#8211; <\/strong> change size of an iSCSI disk on a server.<br \/>\n<strong>Set-SmbBandwidthLimit &#8211; <\/strong>Ensure that the replication between servers is limited to a maximum of 100 Mbps.<br \/>\n<strong>New-SRPartnership &#8211; <\/strong>asynchronously replicate volumes on two different servers.<br \/>\n<strong>New-NetQosPolicy &#8211; <\/strong>Configure replication policy between servers<br \/>\nCreating, mounting, initializing, partitioning, and formatting a new VHDX all in one line of Powershell:<\/p>\n<pre class=\"lang:default decode:true \" title=\"New VHDX\">new-vhd -path c:\\data\\disk1.vhdx -sizebytes 256gb -dynamic |\nmount-vhd -passthru |\ninitialize-disk -passthru | new-partition -driveletter x -\nusemaximumsize | format-volume\n-filesystem ntfs -filesystemlabel data1 -confirm:$false -force<\/pre>\n<p>New SMB Share:<\/p>\n<pre class=\"lang:default decode:true \" title=\"New SMB Share\">new-smbshare \u2013name sharename -path pathname [-fullaccess\ngroupname] [-readaccess\ngroupname] [-changeaccess groupname] [-noaccess groupname]<\/pre>\n<p>&nbsp;<br \/>\n<strong>Hyper-V<br \/>\n<\/strong><strong>Set-VMProcesser &#8211; <\/strong>Use to enable nested virtualization.<br \/>\n<strong>Export-VM<\/strong>, and then <strong>Import-VM &#8211; <\/strong>Create multiple copies of VMs to use on a Hyper-V Host.<br \/>\n<strong>Set-VMHost &#8211; <\/strong>Ensure virtual machines use all available networks to perform a live migration.<br \/>\n<strong>Set-IpamConfiguration &#8211; <\/strong>Modify GPO prefix by IPAM.<br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a short list of PS commands that you may not know now, but they have a high likelihood of showing up on the exam: NANOSERVER New-NanoServerImage: This module is imported from the Windows 2016 ISO D:\\NanoServer\\NanoServerImageGenerator\\NanoServerImageGenerator.psm1 Commands that are included with this module: gcm -module Edit-NanoServerImage, Get-NanoServerPackage, and New-NanoServerImage. Creating a new image: new-nanoserverimage&hellip; <a class=\"more-link\" href=\"https:\/\/certcent.io\/index.php\/2018\/08\/09\/windows-server-2016-exam-powershell-commands-to-know-70-740\/\">Continue reading <span class=\"screen-reader-text\">Windows Server 2016 Exam &#8211; PowerShell Commands to Know (70-740)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/posts\/222"}],"collection":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/comments?post=222"}],"version-history":[{"count":0,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/posts\/222\/revisions"}],"wp:attachment":[{"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/media?parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/categories?post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/certcent.io\/index.php\/wp-json\/wp\/v2\/tags?post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}