Advertisement
Guest User

Domain Adding/removing

a guest
Sep 7th, 2016
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.88 KB | None | 0 0
  1. :: ###Add to Domain
  2. ::FJoinOptions=1  - ComputerName must be in AD - OU can be broad
  3. ::FJoinOptions=3 - ComputerName doesn't have to be in AD - Places ComputerName in the OU described.
  4.  
  5. ::wmic.exe /interactive:off ComputerSystem Where name="%computername%" call JoinDomainOrWorkgroup FJoinOptions=1 Name="matt.edu" UserName="matt\Matt" Password="Password" AccountOU="OU=test;DC=matt;DC=edu"
  6. ::wmic.exe /interactive:off ComputerSystem Where name="%computername%" call JoinDomainOrWorkgroup FJoinOptions=3 Name="matt.edu" UserName="matt\Matt" Password="Password" AccountOU="OU=test;DC=matt;DC=edu"
  7.  
  8.  
  9.  
  10. :: ###Remove from Domain and add to workgroup specified
  11. ::wmic.exe /interactive:off ComputerSystem Where "Name='%computername%'" Call UnJoinDomainOrWorkgroup FUnjoinOptions=0
  12. ::wmic.exe /interactive:off ComputerSystem Where "Name='%computername%'" Call JoinDomainOrWorkgroup name="WORKGROUP"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement