Advertisement
Guest User

Untitled

a guest
Jun 13th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. # Assumes the following:
  2. # Hostname: TEST1
  3. # Domain: EXAMPLE.COM (you probably don't want to use your public domain for your AD domain... but that's out of scope for this example)
  4. # Admin user: setupuser
  5. # Admin pass: He11oW0rld!
  6. # Machine will go into the default computers ou (root)
  7. # Domain admins will get local admin rights on login
  8. # All users will get mobile accounts (offline login)
  9. # All data will be stored locally (no UNC home dir)
  10. # Default shell will be bash
  11. # No DC preference for queries/logins
  12.  
  13. # Set the hostname
  14. scutil --set HostName TEST1.EXAMPLE.COM
  15.  
  16. # Enable NTP and set the server
  17. systemsetup -setusingnetworktime on
  18. systemsetup -setnetworktimeserver EXAMPLE.COM
  19.  
  20. # Reload the service and force run, just in case
  21. pkill -HUP ntpd
  22. ntpdate EXAMPLE.COM
  23.  
  24. # Add the mac to the domain
  25. dsconfigad -add "EXAMPLE.COM" -force -computer "TEST1" --domain "DC=EXAMPLE,DC=COM" -username "setupuser" -password "He11oW0rld!"
  26.  
  27. # Allow logins from any domain in the forest
  28. dsconfigad -alldomains enable
  29.  
  30. # Now make sure domain admins can login and get admin rights
  31. dsconfigad -groups "Domain admins"
  32.  
  33. # Enable mobile accounts
  34. dsconfigad -mobile enable
  35. dsconfigad -mobileconfirm disable
  36.  
  37. # Disable UNC paths
  38. dsconfigad -localhome enable
  39. dsconfigad -useuncpath disable
  40.  
  41. # Set the shell to something sensible
  42. dsconfigad -shell "/bin/bash"
  43.  
  44. # Enable encryption
  45. dsconfigad -packetsign require
  46. dsconfigad -packetencrypt require
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement