Advertisement
Guest User

Untitled

a guest
Jun 8th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. #buscar fichero
  2. $fichero="c:\opciones.txt"
  3. if (-FilePath $fichero){
  4. $opcion=(Get-Content $fichero)[0]
  5. if ($opcion=2)
  6. $opcion2=(Get-Content $fichero)[4]
  7. if ($opcion=1){
  8. #Unir a dominio
  9. $nombre=(Get-Content $fichero)[1]
  10. $user=(Get-Content $fichero)[2]
  11. $password=(Get-Content $fichero)[3]
  12. $secpasswd = ConvertTo-SecureString $password -AsPlainText -Force
  13. $mycreds = New-Object System.Management.Automation.PSCredential ($user, $secpasswd)
  14. add-computer -domainname imim.es -Credential $mycreds -ComputerName $nombre
  15. rm c:\opciones.txt
  16. Invoke-Reboot
  17. }
  18. else
  19. {
  20. $nombre=(Get-Content $fichero)[1]
  21. #Modificar Nombre maquina
  22. Rename-Computer -NewName $nombre
  23. Invoke-Reboot
  24. }
  25. }
  26. else
  27. {
  28. Seleccione una opcion:
  29.  
  30. 1-Instalar software
  31. 2-Software i dominio
  32. 3- Salir
  33.  
  34. $opcion= read-host
  35. $opcion | Out-File -FilePath $fichero
  36.  
  37. if ($opcion=1)
  38. {
  39. write-output "Introduce nombre Usuario"
  40. $user= read-host
  41. $user | Out-File -FilePath $fichero -Append
  42. write-output "Introduce password"
  43. $password= read-host
  44. $password | Out-File -FilePath $fichero -Append
  45.  
  46. Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
  47. Enable-RemoteDesktop
  48.  
  49. cinst firefox
  50. cinst gimp
  51. cinst cdburnerxp
  52. cinst filezilla
  53. cinst peazip
  54. cinst vlc
  55. cinst jre8
  56. cinst googlechrome
  57. cinst flashplayerplugin
  58. cinst flashplayeractivex
  59. cinst flashplayerppapi
  60. cinst adobereader
  61. cinst winscp
  62. cinst notepadplusplus
  63. cinst cloudstation
  64. cinst pdfcreator
  65. net use M: \\folder\NTINSTALL /user:$user $password
  66. copy M:\MicrosoftOffice\off.1.0.0.nupkg c:\
  67. choco install c:\off.1.0.0.nupkg
  68. net use M: /delete
  69. rm c:\off.1.0.0.nupkg
  70. cinst dotnet4.5.1
  71. cinst powershell
  72. rm c:\opciones.txt
  73. }
  74. else
  75. {
  76. if($opcion=2)
  77. {
  78.  
  79. write-output "Introduce nombre maquina"
  80. $nombre= read-host
  81. $nombre | Out-File -FilePath $fichero -Append
  82. write-output "Introduce nombre Usuario"
  83. $user= read-host
  84. $user | Out-File -FilePath $fichero -Append
  85. write-output "Introduce password"
  86. $password= read-host
  87. $password | Out-File -FilePath $fichero -Append
  88.  
  89. Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
  90. Enable-RemoteDesktop
  91.  
  92. cinst firefox
  93. cinst gimp
  94. cinst cdburnerxp
  95. cinst filezilla
  96. cinst peazip
  97. cinst vlc
  98. cinst jre8
  99. cinst googlechrome
  100. cinst flashplayerplugin
  101. cinst flashplayeractivex
  102. cinst flashplayerppapi
  103. cinst adobereader
  104. cinst winscp
  105. cinst notepadplusplus
  106. cinst cloudstation
  107. cinst pdfcreator
  108. net use M: \\folder\NTINSTALL /user:$user $password
  109. copy M:\MicrosoftOffice\off.1.0.0.nupkg c:\
  110. choco install c:\off.1.0.0.nupkg
  111. net use M: /delete
  112. rm c:\off.1.0.0.nupkg
  113. cinst dotnet4.5.1
  114. cinst powershell
  115. Invoke-Reboot
  116. }
  117. else
  118. {
  119. if($opcion=3)
  120. {
  121. rm c:\opciones.txt
  122. }
  123. }
  124. }
  125. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement