Categories: PowerShell

Windows PowerShell Commands in Win12 Server core

PowerShell commands every Windows admin should know

· RPC Server is unavailable
You need to change the Firewall rules on both machines (NOT only the Hyper-V Server)
o NetSh advfirewall firewall set rule group=”Remote Volume Management” new enable=yes
· Opening Network Connection
o NCPA.CPL
· Managing Features ( Add & Remove )
o Show Features List: Get-WindowsFeature
o Add/Install Feature: Install-WindowsFeature (Feature name)
o Install many features: Install-WindowsFeature (Feature name),(2nd Feature name)
o Install All feature tools: Get-WindowsFeature (Feature name)* |Add-WindowsFeature
o Install Feature Remotely: Install-WindowsFeature (Feature name) –ComputerName –Credential
o Install Feature Using Path: Install-WindowsFeature (Feature Name) (Source)
o Install Feature Offline using VHD : Install-WindowsFeature (Feature Name) –VHD (Storage Path)
o Un-Install Feature: Un-install-WindowsFeature (Feature Name) –Remove
· Exporting & Deleting & Importing Features And Migrate to New One
o Exporting: Export- SmigServerSetting –FeatureID DHCP –Group IPConfig –Path (Storage Path) –Verbose
o Deleting : NetSh DHCP delete server (FQDN) (IP)
o Importing: Import –SmigServerSetting FeatureID DHCP –Group IPConfig –SourcePhysicalAddress (MAC)
-TargetPhysicalAddress (MAC) –Path (Storage Path) –Verbose
o Start Service: Start-Service DHCPServer
o Authorize: NetSh DHCP Server (FQDN) (IP)
· Show & Change Machine IP Address
o Show Config: NetSh Int IPv4 Show Config
o Show Route: NetSh Int IPv4 Show Route
o Change Config: NetSh Int IPv4 Set Address Name= (Int No.) Static (IP) (MASK) (GATEWAY)
o Add DNS: NetSh Int IPv4 add DNSServer Name= (Int No.) Address=(IP) Index=(Primary =1 Secondary =2)
· Remote Management Using PowerShell
o Manage Using Pop-up Credential : Enter-PSSession –ComputerName DC1 –Credential $Cred
o Manage Using Not Listed in Trust ( Not Joined ) :
o To Show > WinRM get WinRM/Config/Client
o To ADD : Set-Item WSman:\LocalHost\TrustedHosts (PC Name) – Concatenate –Force
· Show All Modules for Hyper -V & Get Help
o Show : GCM -Module Hyper-V
o Try Help: Help (Module Name)
o Try Full Help: Help (Module Name) –Full
o Get-Command *Part of Command*
· Install Active Directory with All Features
o Install-WindowsFeature –Name AD-Domain-Services –IncludeManagementTools
· IFM : Install Domain Controller From Media Using PowerShell
Exporting
o NTDSUtill
o IFM >> For Help?
o Create Sysvol Full E:\IFM
Importing
o Install-ADDsDomainController –InstallationMediaPath E:\IFM –Credential (Get-Credential DS\Admin)
· Resolve DNS Srv Issues
o DCDiag /Fix
o OR : Net Stop Net Logon & Net Start Net Logon
o Or : Replicate From Other DC using AD Service
· Adding Machine to Event Log Reader
o Net LocalGroup “Event Log Readers” (PC NAME)$ /add

The Rubik’s Cube makes a perfect gift for any occasion. Learn how to solve the cube on Ruwix.

Mahmoud A. ATALLAH

Microsoft MVP | Speaker | Azure Service Delivery Lead at Bespin Global MEA, helping customers build successful Azure practices. Talks about #AzureCloud and #AI

Recent Posts

Gitex – Ensuring a Secure & Scalable AI-powered Solution with Azure

In this session, we will explore the architecture and best practices for building secure and…

1 month ago

Part 4: Data Exfiltration Playbook – Azure WAF Security Lab

Introduction Welcome to our comprehensive series on Azure Web Application Firewall (WAF) security! In this…

3 months ago

Part 3: Vulnerability Exploitation Playbook – Azure WAF vs XSS

Introduction Welcome to the third installment of our Azure Web Application Firewall (WAF) Security Lab…

3 months ago

Part 2: Reconnaissance Playbook – Testing Azure WAF Protection

Introduction Welcome to the second installment of our Azure Web Application Firewall (WAF) Security Lab…

4 months ago

Part 1: Lab Setup – Building Your Azure WAF Testing Environment

Introduction Welcome to the first installment of our four-part Azure Web Application Firewall (WAF) Security…

4 months ago

Azure Web Application Firewall: A Hands-on Security Lab Series

Introduction In today's digital landscape, protecting web applications from sophisticated attacks is crucial. Azure Web…

4 months ago