Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #
  2. # AD Manager
  3. #
  4.  
  5. $VERSION = "1.0"
  6.  
  7. # Module Active Directory
  8. #Import-Module ActiveDirectory
  9.  
  10. $SERVER = "ad"
  11.  
  12.  
  13. Function Show-ADMenu()
  14. {
  15. Clear-Host
  16. Write-Output("","AD Manager V$VERSION","")
  17. Write-Output("[1] - Gestion des utilisateurs")
  18. Write-Output("[2] - Gestion des unités d'organisation")
  19. Write-Output("[0] - Quitter","")
  20.  
  21. $choice = Read-Host "AD Manager"
  22.  
  23. switch($choice)
  24. {
  25. 0 { }
  26. 1 { Set-ADCreateUsers }
  27. 2 { Set-ADCreateOU }
  28. }
  29.  
  30. }
  31.  
  32. Function Set-ADCreateUsers()
  33. {
  34. Clear-Host
  35.  
  36. Invoke-Command -ComputerName $SERVER -Credential "GSB\admin.gsb" { Restart-Computer -ComputerName $SERVER }
  37.  
  38. }
  39.  
  40. Function Set-ADCreateOU()
  41. {
  42.  
  43.  
  44. }
  45.  
  46. Show-ADMenu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement