zoukankan      html  css  js  c++  java
  • Join/remove server into/from windows domain PS script

    Join server into windows domain PS script

    $username = "ad-domainadmin"
    $Password = "mypassword"
    $pwd = $Password | ConvertTo-SecureString -asPlainText -Force
    $credential = New-Object System.Management.Automation.PSCredential($UserName,$pwd)
    $Domain = "ad.domain.com"
    Add-Computer -DomainName $Domain -Credential $credential –Restart

    Remove server from windows domain PS script

    $username = "ad-domainadmin"
    $Password = "mypassword"
    $pwd = $Password | ConvertTo-SecureString -asPlainText -Force
    $credential = New-Object System.Management.Automation.PSCredential($UserName,$pwd)
    $Domain = "ad.domain.com"
    Remove-Computer -UnjoinDomaincredential $credential -Force –Restart
  • 相关阅读:
    Docker
    Docker
    VIM
    Python
    Python
    VIM
    Python
    其他
    Java
    Java
  • 原文地址:https://www.cnblogs.com/oskb/p/9414661.html
Copyright © 2011-2022 走看看