• 常用的Powershell命令


    打开Powershell (run as administrator)

    • get-command: 搜索相关命令   eg:get-command "*VM" 搜索包含 VM的命令
    • update -help :将帮助文档更新到最新版本      (同:help -update)
    • help  new-VM: 获取new-VM 帮助文档     help new-VM -examples  查看示例
    • ipconfig /all  查看IP地址   Get-NetIPconfiguration  -detailed   查看ip的详细信息
    • Get-NetAdapter: 查看网卡信息   Get-NetAdapterStatistics (Recieved/send package number)      Get -NetIpAddress
    • 配置IP地址  :New-NetIPAddress    netsh interface : 网路配置命令行      help  New-NetAddress -examples      get-command "*IPAddress"   获取含有ipAddress 命令
    • 配置DNS: Set-DNSClientServerAddress    
      • 网络查错:   ping  Tracert 或 Telnet 判断路由或者端口是否打开

                  tracert: 路由跟踪 telnet: 远程访问

      • ping 远程服务器  Test-NetConnection  www.baidu.com
      • telnet  端口:    Test-NetConnection  8.8.8.8 -port:53
      • 跟踪路径:         Test-NetConnection  8.8.8.8 -traceroute 103.235.46.39 -TraceRoute
    • 重启服务   restart -service
    • 获取当前服务   get-service |out-gridview
      • out-gridview 输出格式  所有的PS命令通用。可以把结果用表格形式输出来
    • 停止开始 配置服务
      • stop-service  停止服务
      • start-service 开启服务
      • set-service  设置服务
    • AD 和域的操作
      •   Rename-computer  ***
    • 重启电脑  restart -computer
      •   shutdown /r/f/t
    • 关机       shutdown -computer
    • 加入域    Add-computer -domainname  test.com
    • 修复AD(active Directory)的信任关系 
      • AD 存储了有关网络对象的信息并让管理员和用户能够轻松查找和使用信息。 一般退出域 重启 重新加域 重启回判断  True 表示OK Flase 表示 无法连接AD 需要提供管理员密码修复
      • 命令:Test-computersecureChannel -credential domainadmin -repair 
    • 配置防火墙 profile
      • set-netfirewallprofile
      • Set-netfirewallprofile -Profile Domain, public, Private, -Enabled true  打开 Domain public private 的防火墙
    • 配置防火墙策略
      • New-netfirewallrule
    • 添加role 和feature
      • install -windowsfeature
      • install -windowsfeature  net-framework-core -source d:sources sxs
    • 重启AD用户密码
      • Convert -securestring  设置一个加密密码
    • 定位 FSMO(flexible single master operation)灵活单主机操作
      • Get-ADForest test.com|FT SchemaMaster (架构主机)
      • Get-ADForest test.com|FT RidMaster(获取域 test.com 的Rid 主机)
    • 迁移FSMO (营运主机)
      • Move-ADDirectoryServer OperationMasterRole
    • 查看hotfix
      • get-hotfix
    • Hyper-v 下powershell 命令
      • get-command -module Hyper-v "*VM*"|measure
    • 配置虚拟网络 (创建VM后 分配虚拟网络)
      • Get-VM
      • Get-VMNetworkAdapter
      • connnect-VMNetWorkAdapter
    • 创建还原点
      • get-VM|checkpoint -VM               

     

          

     

       

         

  • 相关阅读:
    等待通知--wait notify
    表单重复提交与解决
    Cookie Session 与Token
    springMVC实现登陆
    第11章 AOF持久化
    第10章 RDB持久化
    MyBatis动态SQL
    第4章 网络层
    第9章 数据库
    代理设计模式
  • 原文地址:https://www.cnblogs.com/dongtian/p/5621234.html
Copyright © 2020-2023  润新知