diff --git a/README.md b/README.md index 12ebc891745d398c79c093156dd072c342d8730c..0c2fce77d2cefa318178a951175dc202a1112458 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,44 @@ -# depcyu +Description d’application: +Un logiciel qui ressemble certains scripts sur PowerShell pour configurer le système ou installer des logiciels. Quelques exemples de fonctionnalité des scripts: + - nettoyage de système + - licence (activation, changement de clé ou KMS à MAK) + - éditer de stratégie de groupe local + - installation des logiciels (pack Office, navigateurs, etc) + Plus des détails sera dans la Description des fonctionnalités: +Dans ce programme les scripts sont les objets parce que chaque script est dans fichier différent et qui exécuter sur menu de programme. C’est menu devise à deux parties. La première partie est le menu avec toutes fonctionnalités et deuxième partie est menu avec des fonctionnalités qui existent si on n’a pas de connexion à Internet (on peut dire que deuxième menu prends héritage de menu avec tout des fonctionnalités). + +Description des fonctionnalités: +En début d’exécution le programme fait un test de disponibilité accès à Internet. Après de ce test le programme va lancer le menu avec toutes les fonctionnalités s’il y a accès à Internet ou le menu court si on n’a pas d’accès au réseau. Le menu consiste de la liste avec les configurations souvent : + • nettoyage de système (avec certaines utiles de nettoyage telle que ...) + • licence (activation ou changement de clé ou KMS à MAK) + • éditer de stratégie de groupe local + • installation des logiciels (pack Office, navigateurs, etc) + • Définir les applications par défaut (importer un fichier XML) +Description de chaque fonctionnalité : +La vérification connexion : avant de lancer le menu le programme vérifie la connexion à Internet par ping au certain serveur (comme serveur de Google et Microsoft). Si le ping passe le programme lance le menu complet avec tous les fonctionnalités. Mais si le ping ne passe pas le programme lance le menu court avec fonctionnalités pour lesquels n’ont pas besoin d’Internet par exemple : éditer de stratégie de groupe local ou définir les applications par défaut etc. -## Getting started +Nettoyage de système : c’est module pour nettoyage le système par les outils souvent : -To make it easy for you to get started with GitLab, here's a list of recommended next steps. +######################################################################## -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! +L'instruction d'utilisation: +Pour léncer le le programme on doit activer le exéccution de script sur windows. Par défaut l'éxectution est désactive sur windows. +On peux pas integrer l'activation dans le programme parce que pour éxecuter le programme on doit activer de lencement de scrpit.(Voilà c'est une petite paradoxe.) +Pour ça on démarre Powershell, en tant qu’Administrateur et on doit taper la commande suivante : -## Add your files +set-executionpolicy unrestricted -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: +Valider par « O » (le o de oui). -``` -cd existing_repo -git remote add origin https://git.cyu.fr/ililicen/depcyu.git -git branch -M main -git push -uf origin main -``` +Après on peut démarer notre programme aussi en tant qu’Administrateur -## Integrate with your tools +https://openclassrooms.com/forum/sujet/powershell-avertissement-de-securite +https://itfordummies.net/2015/05/04/differents-way-to-unblock-file-with-powershell/ -- [ ] [Set up project integrations](https://git.cyu.fr/ililicen/depcyu/-/settings/integrations) +######################################################################### -## Collaborate with your team +Pour simplifier l'execution de programme j'ai utilisé le script PS2EXE pour créer le raccourci. C'est me permet de lancer le programme directement sur l'interface graphique. C'est juste attention on doit lancer le programme en tant qu’Administrateur -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +#################################### diff --git a/menuComplet.ps1 b/menuComplet.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..6f20b92eee60c5052365f2888b84934c50d42432 --- /dev/null +++ b/menuComplet.ps1 @@ -0,0 +1,31 @@ +set-executionpolicy RemoteSigned + +$continue = $true +while($continue -eq "true"){ # Continue jusqu'à la variable continue true + write-host “------------------- CYU déploiement --------------------†+ write-host “1. Mise à jour†+ write-host "2. Choix de la licence Windows" + Write-Host "3. Gpedit.msc (GPO Local)" + Write-Host "4. Nettoyage WinSxS" + Write-Host "5. Installation des logiciels" + Write-Host "7. Visionneuse d'image" + Write-Host "8. Definir les applications par defaut" + Write-Host "9. Installation FOG" + Write-Host "10. Sysprep" + write-host "x. exit" + write-host "--------------------------------------------------------" + $choix = read-host “faire un choix †#la variable choix pour lire de clavier + switch ($choix){ # une caisse de choix + 1{Start-Process powershell -Wait -NoNewWindow .\scripts\upgrade\upgrade.ps1} # Entre accolades la place pour le script + 2{Start-Process powershell -Wait -NoNewWindow .\scripts\activationWindows\choixLicence.ps1} + 3{Start-Process powershell -Wait -NoNewWindow .\scripts\gpedit.ps1} + 4{Start-Process powershell -Wait -NoNewWindow .\scripts\cleanWinsxs\cleanWinsxs.ps1} + 5{Start-Process powershell -Wait -NoNewWindow .\scripts\installSoftware\menuInstallSoftaware.ps1} + 7{Start-Process powershell -Wait -NoNewWindow .\scripts\fichiersSupplementaires\Restore_Photo_Viewer_Windows_10.reg} + 8{Start-Process powershell -Wait -NoNewWindow .\scripts\appDefault\appDefault.ps1} + 9{Start-Process powershell -Wait -NoNewWindow .\scripts\fog\fog.ps1} + 10{Start-Process powershell -Wait -NoNewWindow .\scripts\sysprep\sysprep.ps1} + "x" {$continue = $false} # la valeur x initaliser la variable continue comme false(Pour sortir) + default {Write-Host "Choix invalide"-ForegroundColor red} # si la valeur de choix n'existe pas affiche le message "Choix invalide" la coleur rouge + } +} diff --git a/menuPasComplet.ps1 b/menuPasComplet.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..6474648dca4e316717e337d6d80628916794d948 --- /dev/null +++ b/menuPasComplet.ps1 @@ -0,0 +1,30 @@ +set-executionpolicy RemoteSigned + +$continue = $true +while($continue){ # Continue jusqu'à la variable continue true + write-host “------------------- CYU déploiement sans Internet --------------------†+ Write-Host "3. Gpedit.msc (GPO Local)" + Write-Host "4. Nettoyage WinSxS" + Write-Host "5. Installation des logiciels" + Write-Host "7. Visionneuse d'image" + Write-Host "8. Definir les applications par defaut" + Write-Host "9. Installation FOG" + Write-Host "10. Sysprep" + write-host "x. exit" + write-host "--------------------------------------------------------" + $choix = read-host “faire un choix †#la variable choix pour lire de clavier + + switch ($choix){ # une caisse de choix + 1{Start-Process powershell -Wait -NoNewWindow .\scripts\miseAjour.ps1} # Entre accolades la place pour le script + 2{Start-Process powershell -Wait -NoNewWindow .\scripts\activationWindows\choixLicence.ps1} + 3{Start-Process powershell -Wait -NoNewWindow .\scripts\gpedit.ps1} + 4{Start-Process powershell -Wait -NoNewWindow .\scripts\cleanWinsxs\cleanWinsxs.ps1} + 5{Start-Process powershell -Wait -NoNewWindow .\scripts\installSoftware\menuInstallSoftaware.ps1} + 7{Start-Process powershell -Wait -NoNewWindow .\scripts\fichiersSupplementaires\Restore_Photo_Viewer_Windows_10.reg} + 8{Start-Process powershell -Wait -NoNewWindow .\scripts\appDefault\appDefault.ps1} + 9{Start-Process powershell -Wait -NoNewWindow .\scripts\fog\fog.ps1} + 10{Start-Process powershell -Wait -NoNewWindow .\scripts\sysprep\sysprep.ps1} + ‘x’ {$continue = $false} # la valeur x initaliser la variable continue comme false(Pour sortir) + default {Write-Host "Choix invalide"-ForegroundColor red} # si la valeur de choix n'existe pas affiche le message "Choix invalide" la coleur rouge + } +} diff --git a/run.exe b/run.exe new file mode 100644 index 0000000000000000000000000000000000000000..77d0559a418b08467b035769baef1683d813f72a Binary files /dev/null and b/run.exe differ diff --git a/scripts/activationWindows/choixLicence.ps1 b/scripts/activationWindows/choixLicence.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..216116ad8bf21f911cd3c07121449a9318363051 --- /dev/null +++ b/scripts/activationWindows/choixLicence.ps1 @@ -0,0 +1,17 @@ +$continue = $true +while($continue){ # Continue jusqu'a la variable continue true + write-host "------------------- Choix de la licence Windows --------------------" + write-host "1. Installer une licence KMS" + write-host "2. Installer une licence MAK" + write-host "3. Retour au menu precedent" + + write-host "--------------------------------------------------------" + $choix = read-host "faire un choix" #la variable choix pour lire de clavier + + switch ($choix){ # une caisse de choix + 1{Start-Process powershell -Wait -NoNewWindow .\scripts\activationWindows\licence\kms.ps1} # Entre accolades la place pour le script + 2{Start-Process powershell -Wait -NoNewWindow .\scripts\activationWindows\licence\mak.ps1} + 3{Start-Process powershell -Wait -NoNewWindow .\menuComplet.ps1} + + } +} \ No newline at end of file diff --git a/scripts/activationWindows/licence/kms.ps1 b/scripts/activationWindows/licence/kms.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..16d25804c52e6175cd4d244b088f6387bb6df30b --- /dev/null +++ b/scripts/activationWindows/licence/kms.ps1 @@ -0,0 +1 @@ +slmgr /skms snkms.unistra.fr \ No newline at end of file diff --git a/scripts/activationWindows/licence/mak.ps1 b/scripts/activationWindows/licence/mak.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..d4f4a3d77ebebbb9d801e6d5f0d6c4bbf7b77d4e --- /dev/null +++ b/scripts/activationWindows/licence/mak.ps1 @@ -0,0 +1 @@ +slmgr /ipk XDN98-JRDDK-9YWPH-3MD4C-RVXPC \ No newline at end of file diff --git a/scripts/appDefault/appDefault.ps1 b/scripts/appDefault/appDefault.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..06e0ba0416b3823f23cbac77759f22430b036606 --- /dev/null +++ b/scripts/appDefault/appDefault.ps1 @@ -0,0 +1,17 @@ +$continue = $true +while($continue){ # Continue jusqu'a la variable continue true + write-host "------------------- Definir/Verifier les applications par defaut + --------------------" + write-host "1. Exporter le fichier XML" + write-host "2. Importer le fichier XML" + write-host "3. Retour au menu precedent" + + write-host "--------------------------------------------------------" + $choix = read-host "faire un choix" #la variable choix pour lire de clavier + + switch ($choix){ # une caisse de choix + 1{Start-Process powershell -Wait -NoNewWindow .\scripts\appDefault\appDefaultExport.ps1} # Entre accolades la place pour le script + 2{Start-Process powershell -Wait -NoNewWindow .\scripts\appDefault\appDefaultImport.ps1} + 3{Start-Process powershell -Wait -NoNewWindow .\menuComplet.ps1} + + } +} \ No newline at end of file diff --git a/scripts/appDefault/appDefaultExport.ps1 b/scripts/appDefault/appDefaultExport.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..8d9b95b669b4ec39bf4d9dddbe53c715c70129dd --- /dev/null +++ b/scripts/appDefault/appDefaultExport.ps1 @@ -0,0 +1 @@ +dism /online /Export-DefaultAppAssociations:"C:\MesAssociations.xml" \ No newline at end of file diff --git a/scripts/appDefault/appDefaultImport.ps1 b/scripts/appDefault/appDefaultImport.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..978aca9c1653a986b9d1c9895a349cefffac0e88 --- /dev/null +++ b/scripts/appDefault/appDefaultImport.ps1 @@ -0,0 +1 @@ +dism /online /Import-DefaultAppAssociations:"C:\MesAssociations.xml" \ No newline at end of file diff --git a/scripts/cleanWinsxs/cleanWinsxs.ps1 b/scripts/cleanWinsxs/cleanWinsxs.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..fbe1afe4e66ef074dc703f7e40aa61ecc61f4e2d --- /dev/null +++ b/scripts/cleanWinsxs/cleanWinsxs.ps1 @@ -0,0 +1,16 @@ +$continue = "true" +while ($continue -eq "true") { + + + $res = Read-Host "Tapez 'y' pour confirmer la nettoyage ou 'x' pour quitter" + + if ($res -eq "y") { + + dism.exe /online /cleanup-image /startcomponentcleanup + } + if ($res -eq "x") { + $continue = "false" + } + +} + diff --git a/scripts/fichiersSupplementaires/Restore_Photo_Viewer_Windows_10.reg b/scripts/fichiersSupplementaires/Restore_Photo_Viewer_Windows_10.reg new file mode 100644 index 0000000000000000000000000000000000000000..d455987de667b2ceece8073cf1045686d8558326 Binary files /dev/null and b/scripts/fichiersSupplementaires/Restore_Photo_Viewer_Windows_10.reg differ diff --git a/scripts/fog/desactivationFog.ps1 b/scripts/fog/desactivationFog.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..ec7098b77d6496db329e27efbbed6807462d5dc8 --- /dev/null +++ b/scripts/fog/desactivationFog.ps1 @@ -0,0 +1,2 @@ +Stop-Service fog +Suspend-Service fog \ No newline at end of file diff --git a/scripts/fog/fog.ps1 b/scripts/fog/fog.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..1c6150ea4e0cc12aa973bec72b9841a1af74fa34 --- /dev/null +++ b/scripts/fog/fog.ps1 @@ -0,0 +1,14 @@ +write-host "------------------- FOG installation --------------------" +write-host "1. Installer FOG" +write-host "2. Desactiver FOG service" +write-host "3. Retour au menu precedent" + +write-host "--------------------------------------------------------" +$choix = read-host "faire un choix" #la variable choix pour lire de clavier + +switch ($choix){ # une caisse de choix + 1{Start-Process powershell -Wait -NoNewWindow .\scripts\fog\logiciel\SmartInstaller.exe} # Entre accolades la place pour le script + 2{Start-Process powershell -Wait -NoNewWindow .\scripts\fog\desactivationFog.ps1} + 3{Start-Process powershell -Wait -NoNewWindow .\menuComplet.ps1} + +} diff --git a/scripts/fog/logiciel/SmartInstaller.exe b/scripts/fog/logiciel/SmartInstaller.exe new file mode 100644 index 0000000000000000000000000000000000000000..aa9707cfdbff794048530897e492dd1178c7328e Binary files /dev/null and b/scripts/fog/logiciel/SmartInstaller.exe differ diff --git a/scripts/gpedit.ps1 b/scripts/gpedit.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..307ca9eff34352e2bc8c6fced9c3c61432985cbb --- /dev/null +++ b/scripts/gpedit.ps1 @@ -0,0 +1,75 @@ +Write-Host -ForegroundColor Red "Les elements suivants seront modifies: " +Write-Host "" +Write-Host "Afficher lanimation a la premiere connexion (D)" +Write-Host "Desactiver lacces au Store (A)" +Write-Host "Autoriser cortana (D)" +Write-Host "Desactiver l’ID de publicite (A)" +Write-Host "Supprimer la barre Contacts de la barre des taches (A)" +Write-Host "Supprimer les notifications et le centre de maintenance (A)" + +$continue = "true" +while ($continue -eq "true") { + + $res = Read-Host "Tapez 'y' pour confirmer du changement de gepedit ou 'x' pour quitter" + + if ($res -eq "y") { + + Write-Host "" + Write-host -ForegroundColor Green "Lancement gpedit config" + Write-Host "" + Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted + Write-Host "" + + Write-Host "Installing PolicyFileEditor V3" + Install-Module -Name PolicyFileEditor -RequiredVersion 3.0.0 -Scope CurrentUser + + $MachineDir = "$env:windir\system32\GroupPolicy\Machine\registry.pol" + + Write-Host "Suppression animation de premiere connexion" + $RegPath = 'Software\Microsoft\Windows\CurrentVersion\Policies\System' + $RegName = 'EnableFirstLogonAnimation' + $RegData = '0' + $RegType = 'DWord' + Set-PolicyFileEntry -Path $MachineDir -Key $RegPath -ValueName $RegName -Data $RegData -Type $RegType + + Write-Host "Desactivation recherche dans le store application pour type de fichier non gere" + $RegPath = 'Software\Policies\Microsoft\Windows\Explorer' + $RegName = 'NoUseStoreOpenWith' + $RegData = '1' + $RegType = 'DWord' + Set-PolicyFileEntry -Path $MachineDir -Key $RegPath -ValueName $RegName -Data $RegData -Type $RegType + + Write-Host "Desactivation Cortana" + $RegPath = 'SOFTWARE\Policies\Microsoft\Windows\Windows Search' + $RegName = 'AllowCortana' + $RegData = '0' + $RegType = 'DWord' + Set-PolicyFileEntry -Path $MachineDir -Key $RegPath -ValueName $RegName -Data $RegData -Type $RegType + + Write-Host "Desactivation identifiant publicitaire" + $RegPath = 'Software\Policies\Microsoft\Windows\AdvertisingInfo' + $RegName = 'DisabledByGroupPolicy' + $RegData = '1' + $RegType = 'DWord' + Set-PolicyFileEntry -Path $MachineDir -Key $RegPath -ValueName $RegName -Data $RegData -Type $RegType + + $UserDir = "$env:windir\system32\GroupPolicy\User\registry.pol" + + Write-Host "Cacher le bouton Contacts" + $RegPath = 'Software\Policies\Microsoft\Windows\Explorer' + $RegName = 'HidePeopleBar' + $RegData = '1' + $RegType = 'DWord' + Set-PolicyFileEntry -Path $UserDir -Key $RegPath -ValueName $RegName -Data $RegData -Type $RegType + + # apply the new policy immediately + gpupdate.exe /force + + } + if ($res -eq "x") { + $continue = "false" + } + +} + + diff --git a/scripts/installSoftware/chocoScripts/chocoUpgradeAll.ps1 b/scripts/installSoftware/chocoScripts/chocoUpgradeAll.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..1d387fcb1e6ea9708bc3507f04ccae8c6a49ca5e --- /dev/null +++ b/scripts/installSoftware/chocoScripts/chocoUpgradeAll.ps1 @@ -0,0 +1,2 @@ +Write-Host "Mettre à jour tous les programmes installés avec Chocolatey" +choco.exe upgrade all \ No newline at end of file diff --git a/scripts/installSoftware/chocoScripts/installListLogiciels.ps1 b/scripts/installSoftware/chocoScripts/installListLogiciels.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..ae3367147966123eff6a98a14e944b9931f9a249 --- /dev/null +++ b/scripts/installSoftware/chocoScripts/installListLogiciels.ps1 @@ -0,0 +1,21 @@ +Write-Host -ForegroundColor Red "Voici la liste des logiciels qui vont installer:" +Write-Host "" +Write-Host -ForegroundColor Green " 7zip.install adobedigitaleditions adobereader audacity autohotkey autohotkey.install autohotkey.portable autoit autoit.install chocolatey chocolatey-core.extension chocolatey-dotnetfx.extension chocolatey-windowsupdate.extension dellcommandupdate DotNet4.5 DotNet4.6.1 dotnet4.7.2 dotnetfx Firefox freeplane geogebra-classic.install gimp GoogleChrome InkScape jre8 KB2919355 KB2919442 KB2999226 KB3033929 KB3035131 krita libreoffice-still microsoft-edge microsoft-teams netfx-4.7.2 notepadplusplus.install openboard openshot PDFCreator PowerShell scratch Silverlight simple-sticky-notes treesizefree vcredist140 vcredist2015 vlc zoom zotero" +Write-Host "" + +$continue = "true" + +while ($continue -eq "true") { + + + $res = Read-Host "Pour continuer tapez 'y', pour quitter tapez 'x'" + + if ($res -eq "y") { + choco install -y 7zip.install adobedigitaleditions adobereader audacity autohotkey autohotkey.install autohotkey.portable autoit autoit.install chocolatey chocolatey-core.extension chocolatey-dotnetfx.extension chocolatey-windowsupdate.extension dellcommandupdate DotNet4.5 DotNet4.6.1 dotnet4.7.2 dotnetfx Firefox freeplane geogebra-classic.install gimp GoogleChrome InkScape jre8 KB2919355 KB2919442 KB2999226 KB3033929 KB3035131 krita libreoffice-still microsoft-edge microsoft-teams netfx-4.7.2 notepadplusplus.install openboard openshot PDFCreator PowerShell scratch Silverlight simple-sticky-notes treesizefree vcredist140 vcredist2015 vlc zoom zotero + } + + if ($res -eq "x") { + $continue = "false" + } +} + diff --git a/scripts/installSoftware/chocoScripts/installUnLogiciel.ps1 b/scripts/installSoftware/chocoScripts/installUnLogiciel.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..9c6ce01ce23d68c40b35ad7b5e3193c1ae29eff3 --- /dev/null +++ b/scripts/installSoftware/chocoScripts/installUnLogiciel.ps1 @@ -0,0 +1,12 @@ +$continue = $true +while ($continue) { + # Continue jusqu'a la variable $continue true + $nomLogiciel = Read-Host 'Saisissez le nom du logiciel pour installer OU pour quitter tapez "0"' + + if ($nomLogiciel -eq 0) { + $continue = $false # la valeur x initaliser la variable continue comme false(Pour sortir) + } + else { + choco.exe install $nomLogiciel + } +} diff --git a/scripts/installSoftware/chocoScripts/installerChoco.ps1 b/scripts/installSoftware/chocoScripts/installerChoco.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..296ebe34acc282babf0fa04258d50a0d439aa4a2 --- /dev/null +++ b/scripts/installSoftware/chocoScripts/installerChoco.ps1 @@ -0,0 +1,2 @@ +Write-Host "Installation Chocolatey" +Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) \ No newline at end of file diff --git a/scripts/installSoftware/chocoScripts/searchLogiciel.ps1 b/scripts/installSoftware/chocoScripts/searchLogiciel.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..af472d6e3a8a5974c0cd212a7c1f838549ba83a7 --- /dev/null +++ b/scripts/installSoftware/chocoScripts/searchLogiciel.ps1 @@ -0,0 +1,12 @@ +$continue = $true +while ($continue) { + # Continue jusqu'a la variable $continue true + $nomLogiciel = Read-Host "Saisissez le nom du logiciel ou 0 pour arreter" + + if ($nomLogiciel -eq 0) { + $continue = $false # la valeur x initaliser la variable continue comme false(Pour sortir) + } + else { + choco.exe search $nomLogiciel + } +} diff --git a/scripts/installSoftware/logiciels/office/office.exe b/scripts/installSoftware/logiciels/office/office.exe new file mode 100644 index 0000000000000000000000000000000000000000..7100d0003840fd40f64cae60aba714f966310df7 Binary files /dev/null and b/scripts/installSoftware/logiciels/office/office.exe differ diff --git a/scripts/installSoftware/menuInstallSoftaware.ps1 b/scripts/installSoftware/menuInstallSoftaware.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..519d36cb642113f8aad375e98fb72030e314e0b0 --- /dev/null +++ b/scripts/installSoftware/menuInstallSoftaware.ps1 @@ -0,0 +1,17 @@ +$continue = $true +while($continue){ # Continue jusqu'a la variable continue true + write-host "------------------- Installation des logiciels --------------------" + write-host "1. Installation des logiciels Local" + write-host "2. Installer des logiciels via Chocolatey" + write-host "3. Retour au menu precedent" + + write-host "--------------------------------------------------------" + $choix = read-host "faire un choix" #la variable choix pour lire de clavier + + switch ($choix){ # une caisse de choix + 1{Start-Process powershell -Wait -NoNewWindow .\scripts\installSoftware\menuInstallSoftawareLocal.ps1} # Entre accolades la place pour le script + 2{Start-Process powershell -Wait -NoNewWindow .\scripts\installSoftware\menuInstallSoftawareViaChoco.ps1} + 3{Start-Process powershell -Wait -NoNewWindow .\menuComplet.ps1} + + } +} diff --git a/scripts/installSoftware/menuInstallSoftawareLocal.ps1 b/scripts/installSoftware/menuInstallSoftawareLocal.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..114363ca62008c0ca0ea73d8a7f1aea7e336a0ca --- /dev/null +++ b/scripts/installSoftware/menuInstallSoftawareLocal.ps1 @@ -0,0 +1,15 @@ +$continue = $true +while($continue){ # Continue jusqu'a la variable continue true + write-host "------------------- Installation des logiciels --------------------" + write-host "1. Installer Microsoft Pack Office" + write-host "2. Retour au menu precident" + + write-host "--------------------------------------------------------" + $choix = read-host "faire un choix" #la variable choix pour lire de clavier + + switch ($choix){ # une caisse de choix + 1{Start-Process powershell .\scripts\installSoftware\logiciels\office\office.exe} # Entre accolades la place pour le script + 2{Start-Process powershell -Wait -NoNewWindow .\scripts\installSoftware\menuInstallSoftaware.ps1} + + } +} \ No newline at end of file diff --git a/scripts/installSoftware/menuInstallSoftawareViaChoco.ps1 b/scripts/installSoftware/menuInstallSoftawareViaChoco.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..d534524c227dc2105ce23bc10a750d4e51f9e31c --- /dev/null +++ b/scripts/installSoftware/menuInstallSoftawareViaChoco.ps1 @@ -0,0 +1,23 @@ +$continue = $true +while($continue){ # Continue jusqu'a la variable continue true + write-host "------------------- Installation des logiciels via Chocoltay --------------------" + write-host "1. Installer le Chocolatey" + write-host "2. Installer la liste des logiciels via Sylvain P." + write-host "3. Installer le logiciel par nom" + write-host "4. Chercher un logiciel" + write-host "5. Mettre à jour tous les programmes installes avec Chocolatey" + write-host "6. Retour au menu precident" + + write-host "--------------------------------------------------------" + $choix = read-host "faire un choix" #la variable choix pour lire de clavier + + switch ($choix){ # une caisse de choix + 1{Start-Process powershell .\scripts\installSoftware\chocoScripts\installerChoco.ps1} # Entre accolades la place pour le script + 2{Start-Process powershell .\scripts\installSoftware\chocoScripts\installListLogiciels.ps1} + 3{Start-Process powershell .\scripts\installSoftware\chocoScripts\installUnLogiciel.ps1} + 4{Start-Process powershell .\scripts\installSoftware\chocoScripts\searchLogiciel.ps1} + 5{Start-Process powershell .\scripts\installSoftware\chocoScripts\chocoUpgradeAll.ps1} + 6{Start-Process powershell -Wait -NoNewWindow .\scripts\installSoftware\menuInstallSoftaware.ps1} + + } +} \ No newline at end of file diff --git a/scripts/sysprep/scripts/copieFichier.ps1 b/scripts/sysprep/scripts/copieFichier.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..5ca9f8adfdb0ac1206046fbc2488f7b829cc45ea --- /dev/null +++ b/scripts/sysprep/scripts/copieFichier.ps1 @@ -0,0 +1,37 @@ + +$fichierExist = Test-Path -Path C:\Windows\System32\sysprep\unattend.xml + +if ($fichierExist -eq "true") { + Write-Host -BackgroundColor Red "Attention le fichier 'unattend.xml' est deja existe" + + $res = Read-Host "Pour recopie le fichier tapez 'r', pour appeller la cmd dir tapez 'd' ou pour quitter tapez 'x'. ('r','d','x')" + if ($res -eq "r") { + Copy-Item '.\scripts\sysprep\unattend\unattend.xml' -Destination "C:\Windows\System32\sysprep" + + } + if ($res -eq "d") { + Get-ChildItem C:\Windows\System32\sysprep + } + if ($res -eq "x") { + break + } +} + + +if ($fichierExist -ne "true") { + Write-Host "Copie de fichier ..." + Copy-Item '.\scripts\sysprep\unattend\unattend.xml' -Destination "C:\Windows\System32\sysprep" + + $fichierExist = Test-Path -Path C:\Windows\System32\sysprep\unattend.xml + + if ($fichierExist -eq "true") { + Write-Host "" + Write-Host -ForegroundColor Green "Le fichier copie avec succes" + } + + if ($fichierExist -ne "true") { + Write-Host "" + Write-Host -BackgroundColor Red "Le fichier n'a pas ete copie" + } +} + diff --git a/scripts/sysprep/scripts/lanceSysprep.ps1 b/scripts/sysprep/scripts/lanceSysprep.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..55124aeceef7982a4beaa4f8e6a8e30b4fa46afc --- /dev/null +++ b/scripts/sysprep/scripts/lanceSysprep.ps1 @@ -0,0 +1 @@ +C:\Windows\system32\sysprep\sysprep.exe /generalize /shutdown /unattend:unattend.xml \ No newline at end of file diff --git a/scripts/sysprep/sysprep.ps1 b/scripts/sysprep/sysprep.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..def21fdec9e616da90bf8dd3a1910004462a3cdf --- /dev/null +++ b/scripts/sysprep/sysprep.ps1 @@ -0,0 +1,17 @@ +$continue = $true +while($continue){ # Continue jusqu'a la variable continue true + write-host "------------------- Sysprep --------------------" + write-host "1. Copie du fichier de reponse unattend.xml" + write-host "2. Lancement de sysprep" + write-host "3. Retour au menu precedent" + + write-host "--------------------------------------------------------" + $choix = read-host "faire un choix" #la variable choix pour lire de clavier + + switch ($choix){ # une caisse de choix + 1{Start-Process powershell -Wait -NoNewWindow .\scripts\sysprep\scripts\copieFichier.ps1} # Entre accolades la place pour le script + 2{Start-Process powershell -Wait -NoNewWindow .\scripts\sysprep\scripts\lanceSysprep.ps1} + 3{Start-Process powershell -Wait -NoNewWindow .\menuComplet.ps1} + + } +} diff --git a/scripts/sysprep/unattend/unattend.xml b/scripts/sysprep/unattend/unattend.xml new file mode 100644 index 0000000000000000000000000000000000000000..a96fec6443207a53e6dc3d22c1214ba32043f28a --- /dev/null +++ b/scripts/sysprep/unattend/unattend.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="utf-8"?> +<unattend xmlns="urn:schemas-microsoft-com:unattend"> + <settings pass="generalize"> + <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SkipRearm>1</SkipRearm> + </component> + </settings> + <settings pass="specialize"> + <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <ExtendOSPartition> + <Extend>true</Extend> + </ExtendOSPartition> + </component> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <OEMInformation> + <SupportPhone>01.34.25.23.23</SupportPhone> + <SupportURL>https://monucp.u-cergy.fr</SupportURL> + </OEMInformation> + <TimeZone>Romance Standard Time</TimeZone> + <ComputerName>*</ComputerName> + <OEMName>DNUM</OEMName> + <RegisteredOrganization>CY Cergy Paris Université</RegisteredOrganization> + <RegisteredOwner>CY CPU</RegisteredOwner> + </component> + </settings> + <settings pass="oobeSystem"> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <UserAccounts> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Password> + <Value>NABkAG0AaQBuACwAcgAwADAANwBQAGEAcwBzAHcAbwByAGQA</Value> + <PlainText>false</PlainText> + </Password> + <DisplayName>assistance</DisplayName> + <Group>administrators</Group> + <Name>assistance</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <ProtectYourPC>3</ProtectYourPC> + </OOBE> + <AutoLogon> + <Password> + <Value>NABkAG0AaQBuACwAcgAwADAANwBQAGEAcwBzAHcAbwByAGQA</Value> + <PlainText>false</PlainText> + </Password> + <LogonCount>1</LogonCount> + <Username>assistance</Username> + <Enabled>true</Enabled> + </AutoLogon> + <FirstLogonCommands> + <SynchronousCommand wcm:action="add"> + <Order>1</Order> + <RequiresUserInput>true</RequiresUserInput> + <Description>Active le démarrage du service FOG</Description> + <CommandLine>sc config FOGService start= auto</CommandLine> + </SynchronousCommand> + <SynchronousCommand wcm:action="add"> + <CommandLine>shutdown -t 0 -r</CommandLine> + <Description>Redémarre l'ordinateur immédiatement</Description> + <Order>2</Order> + <RequiresUserInput>true</RequiresUserInput> + </SynchronousCommand> + </FirstLogonCommands> + </component> + <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <InputLocale>040c:0000040c</InputLocale> + <SystemLocale>fr-FR</SystemLocale> + <UILanguage>fr-FR</UILanguage> + <UILanguageFallback>fr-FR</UILanguageFallback> + <UserLocale>fr-FR</UserLocale> + </component> + </settings> + <cpi:offlineImage cpi:source="wim:c:/users/moi/desktop/ltsc_2021_x22-84422/sources/install.wim#Windows 10 Enterprise LTSC 2021" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> +</unattend> diff --git a/scripts/upgrade/scripts/getWindowsUpdate.ps1 b/scripts/upgrade/scripts/getWindowsUpdate.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..44f523178e5c33bfe9fd1bf85625f6806907fbff --- /dev/null +++ b/scripts/upgrade/scripts/getWindowsUpdate.ps1 @@ -0,0 +1,4 @@ +$find = Get-WindowsUpdate -BrowseOnly +write-host $find +Write-Host -ForegroundColor Green "Veuillez patienter le programme en train de cherher la mise a jour" +Get-WindowsUpdate \ No newline at end of file diff --git a/scripts/upgrade/scripts/installWindowsUpdate.ps1 b/scripts/upgrade/scripts/installWindowsUpdate.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..f612ce12d6357087363f955769cea0415609c5ab --- /dev/null +++ b/scripts/upgrade/scripts/installWindowsUpdate.ps1 @@ -0,0 +1,16 @@ +$continue = "true" + +while ($continue -eq "true") { + + $res = Read-Host "Tapez 'y' pour confirmer l'instalation de mise a jour ou 'x' pour quitter" + + if ($res -eq "y") { + Install-WindowsUpdate + } + + if ($res -eq "x") { + $continue = "false" + } + +} + diff --git a/scripts/upgrade/upgrade.ps1 b/scripts/upgrade/upgrade.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..54de34405cf4029e203663854165ad1e0b2700d2 --- /dev/null +++ b/scripts/upgrade/upgrade.ps1 @@ -0,0 +1,19 @@ +Install-Module PSWindowsUpdate +Import-Module PSWindowsUpdate + +$continue = $true +while($continue){ # Continue jusqu'a la variable continue true + write-host "------------------- CYU deploiement --------------------" + write-host "1. Verifier si il y a de mise a jour" + write-host "2. Faire de mise a jour" + write-host "3. Retour au menu precedent" + + write-host "--------------------------------------------------------" + $choix = read-host "faire un choix " #la variable choix pour lire de clavier + + switch ($choix){ # une caisse de choix + 1{Start-Process powershell -Wait -NoNewWindow .\scripts\upgrade\scripts\getWindowsUpdate.ps1} # Entre accolades la place pour le script + 2{Start-Process powershell -Wait -NoNewWindow .\scripts\upgrade\scripts\installWindowsUpdate.ps1} + 3{Start-Process powershell -Wait -NoNewWindow .\menuComplet.ps1} + } +} diff --git a/testConnexion.ps1 b/testConnexion.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..91f87a303b24cc63ea5b6c93f175372eabb3ad4a --- /dev/null +++ b/testConnexion.ps1 @@ -0,0 +1,17 @@ +Write-Output "Veuillez patienter pendant la verification de connexion a Internet." +if (Test-Connection 142.250.201.174 -count 3 -Quiet ) { + #condition si -Quiet True + Write-Output "Vous avez connexion a Internet" + Write-Output "Vous avez acces au menu complet" + + Start-Process powershell -Wait -NoNewWindow .\MenuComplet.ps1 +} +elseif (Test-Connection 142.250.201.174 -count 3 -Quiet) { + <# Action when this condition is true #> +} { + # Si -Quiet est False + Write-Output "Vous n'avez pas de connexion a Internet" + Write-Output "Vous avez acces seulement au menu pas complet" + + Start-Process powershell -Wait -NoNewWindow .\MenuPasComplet.ps1 +} \ No newline at end of file