Common PowerShell commands

Source: Internet
Author: User
Tags administrator password

Open PowerShell (Run as Administrator)

    • Get-command: Search for related commands    eg:get-command "*VM" search for commands that contain VMS
    • update-help: Update the Help documentation to the latest version    ;    (same as: help-update)
    • help  new-vm: Get NEW-VM Help document      assist NEW-VM- examples  View Example
    • ipconfig/all  view IP address    get-netipconfiguration -detailed    View IP details
    • get-netadapter: View network card information    get-netadapterstatistics (recieved/send package number) & nbsp;     get-netipaddress
    • Configure IP address  :new-netipaddress    netsh Interface:  Network configuration command line       help  new-netaddress-examples       Get-command "*ipaddress"    get IPAddress command
    • configuration dns:set-dnsclientserveraddress  & nbsp; 
      • Network error:   ping  Tracert or Telnet to determine whether the route or port is open

Tracert: Route tracking telnet: remote Access

    • Ping remote server test-netconnection www.baidu.com
    • Telnet port: Test-netconnection 8.8.8.8-port:53
    • Trace path: test-netconnection 8.8.8.8-traceroute 103.235.46.39-traceroute
  • Restart Service Restart-service
  • Get current service Get-service |out-gridview
    • Out-gridview output Format All PS commands are generic. You can output the results in tabular form.
  • Stop Start Configuration service
    • Stop-service Stop Service
    • Start-service Open Service
    • Set-service Setting up services
  • Operations for AD and domain
    • Rename-computer * * *
  • Restart your computer restart-computer
    • shutdown/r/f/t
  • Shutdown Shutdown-computer
  • Join Domain Add-computer-domainname test.com
  • To repair the trust relationship for AD (active Directory)
      • AD stores information about network objects and makes it easy for administrators and users to find and use information. General exit domain Restart re-add domain reboot back to determine True means OK Flase indicates unable to connect AD requires Administrator password repair
      • Command: Test-computersecurechannel-credential Domain\admin-repair
  • Configure Firewall Profile
      • Set-netfirewallprofile
      • Set-netfirewallprofile-profile domain, public, private,-enabled True to open the firewall for Domain public Private
  • Configuring firewall Policies
    • New-netfirewallrule
  • Add role and feature
    • Install-windowsfeature
    • Install-windowsfeature Net-framework-core-source d:\sources \sxs
  • Restart the ad user password
    • convert-securestring Setting an encryption password
  • Positioning FSMO (Flexible Single master operation) flexible one-master operation
      • Get-adforest test.com|ft schemamaster (schema master)
      • Get-adforest test.com|ft ridmaster (get rid Master of domain test.com)
  • Migrating FSMO (operating host)
      • Move-addirectoryserver Operationmasterrole
  • View Hotfix
    • Get-hotfix
  • Hyper-V under PowerShell command
    • Get-command-module Hyper-V "*vm*" |measure
  • Configuring virtual networks (Assigning virtual networks after VM creation)
    • Get-vm
    • Get-vmnetworkadapter
    • Connnect-vmnetworkadapter
  • To create a restore point
    • Get-vm|checkpoint-vm

   

Common PowerShell commands

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.