Compare commits

..

17 Commits

Author SHA1 Message Date
ec111816d5 Change stuff 2024-03-07 22:42:03 +01:00
Kawawete
8509174d91 Complete change of direction, now the form is made with VS 2022's WPF form builder and converted into a PS1 script with ConvertForm. Neat. 2024-03-07 21:14:50 +01:00
Kawawete
327bf76a52 mmmmmmm 2024-03-07 08:19:15 +01:00
6f04ad15ea Added functions to connect to and move files from one site to another 2024-03-06 22:54:29 +01:00
Kawawete
d03b93e554 Add project SharePoint Mover 2024-03-06 18:02:52 +01:00
8021f12d2c Update Misc/SendLogs.ps1 2023-12-28 15:44:52 +01:00
5139e8c598 Upload files to "Misc" 2023-12-28 15:44:13 +01:00
833dd4c4ce Update README.md 2023-12-28 15:43:36 +01:00
e721c304e5 Update readme.md > New URL 2023-12-15 15:10:40 +01:00
1194b87c71 Update README.md 2023-12-15 15:02:51 +01:00
44841d197c Update README.md 2023-12-15 15:01:54 +01:00
Sébastien QUEROL
3a5b3fa66c Update file SP-empty.ps1 2023-09-15 10:28:38 +00:00
Sébastien QUEROL
00a54cf299 Update file readme.md 2023-09-15 10:26:35 +00:00
Sébastien QUEROL
9927abaf81 Add new file 2023-09-15 10:24:30 +00:00
Sébastien QUEROL
7c18b41a56 Upload New File 2023-09-15 10:10:29 +00:00
Sébastien QUEROL
5eb68f1858 Update 5 files
- /Windows/getAcl.ps1
- /Windows/FirefoxAutoUpdate.ps1
- /Windows/get-bio.ps1
- /Intune/UpdateForensITXML-ProfWiz.ps1
- /Sharepoint/sharepoint-taille-trash.ps1
2023-05-22 12:51:19 +00:00
Sébastien QUEROL
d8a61d1aae Fixed links 2023-05-19 00:45:47 +00:00
14 changed files with 444 additions and 5 deletions

View File

@@ -0,0 +1,89 @@
# Check that AzureAD is installed
if (-Not (Get-Module -ListAvailable -Name AzureAD)) {
$install = Read-Host 'The AzureAD PowerShell module is not installed. Do you want to install it now? (Y/n)'
if($install -eq '' -Or $install -eq 'Y' -Or $install -eq 'Yes'){
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Write-Warning "Administrator permissions are needed to install the AzureAD PowerShell module.`nPlease re-run this script as an Administrator."
Exit
}
write-host "Installing"
Install-Module -Name AzureAD
}
else {
exit
}
}
# Create a temporary file to hold the unformatted results of our Get-AzureADUser query
$TempFile = New-TemporaryFile
#Go ahead and attempt to get the Azure AD user IDs, but catch the error if there is no existing connection to Azure AD
Try
{
Get-AzureADUser -All:$true | Export-Csv -Path $TempFile -NoTypeInformation -encoding Utf8
}
Catch [Microsoft.Open.Azure.AD.CommonLibrary.AadNeedAuthenticationException]
{
#Connect to Azure AD. This will show a prompt.
Connect-AzureAD | Out-Null
#Try again
Get-AzureADUser -All:$true | Export-Csv -Path $TempFile -NoTypeInformation -encoding Utf8
}
# Get the tennant details
$Tenant = Get-AzureADTenantDetail
# Get the unformatted data from the temporary file
$azureADUsers = import-csv $TempFile
# Create the XML file
$xmlsettings = New-Object System.Xml.XmlWriterSettings
$xmlsettings.Indent = $true
$xmlsettings.IndentChars = " "
$XmlWriter = [System.XML.XmlWriter]::Create("$((Get-Location).Path)\ForensiTAzureID.xml", $xmlsettings)
# Write the XML Declaration and set the XSL
$xmlWriter.WriteStartDocument()
$xmlWriter.WriteProcessingInstruction("xml-stylesheet", "type='text/xsl' href='style.xsl'")
# Start the Root Element
$xmlWriter.WriteStartElement("ForensiTAzureID")
# Write the Azure AD domain details as attributes
$xmlWriter.WriteAttributeString("ObjectId", $($Tenant.ObjectId))
$xmlWriter.WriteAttributeString("Name", $($Tenant.VerifiedDomains.Name));
$xmlWriter.WriteAttributeString("DisplayName", $($Tenant.DisplayName));
#Parse the data
ForEach ($azureADUser in $azureADUsers){
$xmlWriter.WriteStartElement("User")
$xmlWriter.WriteElementString("UserPrincipalName",$($azureADUser.UserPrincipalName))
$xmlWriter.WriteElementString("ObjectId",$($azureADUser.ObjectId))
$xmlWriter.WriteElementString("DisplayName",$($azureADUser.DisplayName))
$xmlWriter.WriteEndElement()
}
$xmlWriter.WriteEndElement()
# Close the XML Document
$xmlWriter.WriteEndDocument()
$xmlWriter.Flush()
$xmlWriter.Close()
# Clean up
Remove-Item $TempFile
write-host "Azure user ID file created: $((Get-Location).Path)\ForensiTAzureID.xml"

14
Misc/SendLogs.ps1 Normal file
View File

@@ -0,0 +1,14 @@
#Connexion au Sharepoint (necessaire pour l'utilisation de l'API graph)
Connect-PnPOnline -url https://site.sharepoint.com -interactive
#On precise les parametres basiques, on peut envoyer de n'importe quelle adresse mail du moment qu'elle fait partie du tenant.
$EmailParams = @{
From = "mail"
To = "mail"
Subject = "Script envoi de mails" #Titre du mail
BodyContentType = "HTML" #Type de contenu du mail
Body = "Test" #Contenu du corps du mail, on peut mettre ce qu'on veut
Attachments = "logsTest.log" #On peut attacher n'importe quel fichier
}
Send-PnPMail @EmailParams #On envoie

View File

@@ -14,9 +14,10 @@ I added lots of comments and READMEs for all of them, the creation of a wiki und
## Categories ## Categories
- [Active Directory](https://git.kawawete.xyz/kawa/ps-scripts/AD) - [Active Directory](https://git.azuze.fr/kawa/ps-scripts/src/branch/main/AD)
- [Anti Bloatware](https://git.kawawete.xyz/kawa/ps-scripts/Anti-Bloat) - [Anti Bloatware](https://git.azuze.fr/kawa/ps-scripts/src/branch/main/Anti-Bloat)
- [Intune](https://git.kawawete.xyz/kawa/ps-scripts/Intune) - [Intune](https://git.azuze.fr/kawa/ps-scripts/src/branch/main/Intune)
- [Windows](https://git.kawawete.xyz/kawa/ps-scripts/Windows) - [Windows](https://git.azuze.fr/kawa/ps-scripts/src/branch/main/Windows)
- [Sharepoint](https://git.kawawete.xyz/kawa/ps-scripts/Sharepoint) - [Sharepoint](https://git.azuze.fr/kawa/ps-scripts/src/branch/main/Sharepoint)
- [Misc](https://git.azuze.fr/kawa/ps-scripts/src/branch/main/Misc)

64
Sharepoint/SP-empty.ps1 Normal file
View File

@@ -0,0 +1,64 @@
#Config Parameters
$SiteURL = Read-Host -Prompt "Entrez l'adresse du site Sharepoint"
$VersionsToKeep = 5
Try {
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Interactive
#Get the Context
$Ctx= Get-PnPContext
#Exclude certain libraries
$ExcludedLists = @("Form Templates", "Preservation Hold Library","Site Assets", "Pages", "Site Pages", "Images",
"Site Collection Documents", "Site Collection Images","Style Library")
#Get All document libraries
$DocumentLibraries = Get-PnPList | Where-Object {$_.BaseType -eq "DocumentLibrary" -and $_.Title -notin $ExcludedLists -and $_.Hidden -eq $false}
#Iterate through each document library
ForEach($Library in $DocumentLibraries)
{
Write-host "Processing Document Library:"$Library.Title -f Magenta
#Get All Items from the List - Exclude 'Folder' List Items
$ListItems = Get-PnPListItem -List $Library -PageSize 2000 | Where {$_.FileSystemObjectType -eq "File"}
#Loop through each file
ForEach ($Item in $ListItems)
{
#Get File Versions
$File = $Item.File
$Versions = $File.Versions
$Ctx.Load($File)
$Ctx.Load($Versions)
$Ctx.ExecuteQuery()
Write-host -f Yellow "`tScanning File:"$File.Name
$VersionsCount = $Versions.Count
$VersionsToDelete = $VersionsCount - $VersionsToKeep
If($VersionsToDelete -gt 0)
{
write-host -f Cyan "`t Total Number of Versions of the File:" $VersionsCount
$VersionCounter= 0
#Delete versions
For($i=0; $i -lt $VersionsToDelete; $i++)
{
If($Versions[$VersionCounter].IsCurrentVersion)
{
$VersionCounter++
Write-host -f Magenta "`t`t Retaining Current Major Version:"$Versions[$VersionCounter].VersionLabel
Continue
}
Write-host -f Cyan "`t Deleting Version:" $Versions[$VersionCounter].VersionLabel
$Versions[$VersionCounter].DeleteObject()
}
$Ctx.ExecuteQuery()
Write-Host -f Green "`t Version History is cleaned for the File:"$File.Name
}
}
}
}
Catch {
write-host -f Red "Error Cleaning up Version History!" $_.Exception.Message
}

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,14 @@
20240307 08:51:28: ForEach-Object: C:\Users\SebastienQUEROL\git.azuze.fr\ps-scripts\Sharepoint\gui\spmover\Functions.ps1:43:31 Line | 43 | $Xml.Attributes | ForEach-Object { | ~~~~~~~~~~~~~~~~ | Exception setting "Image": "Cannot convert the "System.Drawing.Bitmap" value of type "System.String" to type "System.Drawing.Image"."
20240307 09:27:01: New-Object: C:\Users\SebastienQUEROL\git.azuze.fr\ps-scripts\Sharepoint\gui\spmover\Functions.ps1:33:71 Line | 33 | … ) {$newControl = New-Object System.Windows.Forms.$($Xml.ToString())} | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Cannot find type [System.Windows.Forms.Image]: verify that the assembly containing this type is loaded.
20240307 09:28:50: New-Object: C:\Users\SebastienQUEROL\git.azuze.fr\ps-scripts\Sharepoint\gui\spmover\Functions.ps1:33:71 Line | 33 | … ) {$newControl = New-Object System.Windows.Forms.$($Xml.ToString())} | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Cannot find type [System.Windows.Forms.Image]: verify that the assembly containing this type is loaded.
20240307 09:34:41: ForEach-Object: C:\Users\SebastienQUEROL\git.azuze.fr\ps-scripts\Sharepoint\gui\spmover\Functions.ps1:43:31 Line | 43 | $Xml.Attributes | ForEach-Object { | ~~~~~~~~~~~~~~~~ | Exception setting "Image": "Cannot convert the "System.Drawing.Bitmap" value of type "System.String" to type "System.Drawing.Image"."
20240307 09:34:53: ForEach-Object: C:\Users\SebastienQUEROL\git.azuze.fr\ps-scripts\Sharepoint\gui\spmover\Functions.ps1:43:31 Line | 43 | $Xml.Attributes | ForEach-Object { | ~~~~~~~~~~~~~~~~ | Exception setting "Image": "Cannot convert the "System.Drawing.Bitmap" value of type "System.String" to type "System.Drawing.Image"."
20240307 09:38:58: ForEach-Object: C:\Users\SebastienQUEROL\git.azuze.fr\ps-scripts\Sharepoint\gui\spmover\Functions.ps1:43:31 Line | 43 | $Xml.Attributes | ForEach-Object { | ~~~~~~~~~~~~~~~~ | Exception setting "Image": "Cannot convert the "System.Drawing.Bitmap" value of type "System.String" to type "System.Drawing.Image"."
20240307 09:40:53: ForEach-Object: C:\Users\SebastienQUEROL\git.azuze.fr\ps-scripts\Sharepoint\gui\spmover\Functions.ps1:43:31 Line | 43 | $Xml.Attributes | ForEach-Object { | ~~~~~~~~~~~~~~~~ | Exception setting "Image": "Cannot convert the "System.Drawing.Bitmap" value of type "System.String" to type "System.Drawing.Image"."
20240307 09:41:31: ForEach-Object: C:\Users\SebastienQUEROL\git.azuze.fr\ps-scripts\Sharepoint\gui\spmover\Functions.ps1:43:31 Line | 43 | $Xml.Attributes | ForEach-Object { | ~~~~~~~~~~~~~~~~ | Exception setting "Image": "Cannot convert the "System.Drawing.Image" value of type "System.String" to type "System.Drawing.Image"."
20240307 09:44:00: ForEach-Object: C:\Users\SebastienQUEROL\git.azuze.fr\ps-scripts\Sharepoint\gui\spmover\Functions.ps1:43:31 Line | 43 | $Xml.Attributes | ForEach-Object { | ~~~~~~~~~~~~~~~~ | Exception setting "Image": "Cannot convert the "System.Drawing.Bitmap" value of type "System.String" to type "System.Drawing.Image"."
20240307 09:44:41: ForEach-Object: C:\Users\SebastienQUEROL\git.azuze.fr\ps-scripts\Sharepoint\gui\spmover\Functions.ps1:43:31 Line | 43 | $Xml.Attributes | ForEach-Object { | ~~~~~~~~~~~~~~~~ | Exception setting "Image": "Cannot convert the "System.Drawing.Bitmap" value of type "System.String" to type "System.Drawing.Image"."
20240307 09:45:56: ForEach-Object: C:\Users\SebastienQUEROL\git.azuze.fr\ps-scripts\Sharepoint\gui\spmover\Functions.ps1:43:31 Line | 43 | $Xml.Attributes | ForEach-Object { | ~~~~~~~~~~~~~~~~ | Exception setting "Image": "Cannot convert the "System.Drawing.Bitmap" value of type "System.String" to type "System.Drawing.Image"."
20240307 09:47:04: ForEach-Object: C:\Users\SebastienQUEROL\git.azuze.fr\ps-scripts\Sharepoint\gui\spmover\Functions.ps1:43:31 Line | 43 | $Xml.Attributes | ForEach-Object { | ~~~~~~~~~~~~~~~~ | Exception setting "Image": "Cannot convert the "System.Drawing.Bitmap" value of type "System.String" to type "System.Drawing.Image"."
20240307 09:48:25: ForEach-Object: C:\Users\SebastienQUEROL\git.azuze.fr\ps-scripts\Sharepoint\gui\spmover\Functions.ps1:43:31 Line | 43 | $Xml.Attributes | ForEach-Object { | ~~~~~~~~~~~~~~~~ | Exception calling "Add" with "2" argument(s): "Item has already been added. Key in dictionary: 'lbl_byWho' Key being added: 'lbl_byWho'"
20240307 11:16:28: InvalidOperation: Line | 45 | $Script:refs['btn_Start'].Add_Click($eventSB['btn_Start'].Cli … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Cannot index into a null array.

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,186 @@
################################################################################
#
# Name : SharePoint Mover
# Version : 0.1
# Author :
# Date : 07/03/2024
#
# Generated with ConvertForm module version 2.0.0
# PowerShell version 7.4.1
#
# Invocation Line : Convert-Form -Path $Source -Destination $Destination -Encoding ascii -force
# Source : C:\Users\SebastienQUEROL\source\repos\sharepointmover-gui\Form1.Designer.cs
################################################################################
function Get-ScriptDirectory
{ #Return the directory name of this script
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
Split-Path $Invocation.MyCommand.Path
}
$ScriptPath = Get-ScriptDirectory
# Chargement des assemblies externes
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$FMain = New-Object System.Windows.Forms.Form
$components = New-Object System.ComponentModel.Container
$menuStrip1 = New-Object System.Windows.Forms.MenuStrip
$Mconnexion = New-Object System.Windows.Forms.ToolStripMenuItem
$MConnexionSharepoint = New-Object System.Windows.Forms.ToolStripMenuItem
$Mquestion = New-Object System.Windows.Forms.ToolStripMenuItem
$MQuestionApropos = New-Object System.Windows.Forms.ToolStripMenuItem
$MQuestionWiki = New-Object System.Windows.Forms.ToolStripMenuItem
$Bgo = New-Object System.Windows.Forms.Button
$CBsourceSite = New-Object System.Windows.Forms.ComboBox
$CBdestSite = New-Object System.Windows.Forms.ComboBox
$progressBar1 = New-Object System.Windows.Forms.ProgressBar
$sourceInfo = New-Object System.Windows.Forms.ToolTip($components)
$label1 = New-Object System.Windows.Forms.Label
$label2 = New-Object System.Windows.Forms.Label
#
# menuStrip1
#
$menuStrip1.Items.AddRange(@(
$Mconnexion,
$Mquestion))
$menuStrip1.Location = New-Object System.Drawing.Point(0, 0)
$menuStrip1.Name = "menuStrip1"
$menuStrip1.Size = New-Object System.Drawing.Size(800, 24)
$menuStrip1.TabIndex = 0
$menuStrip1.Text = "menuStrip1"
#
# Mconnexion
#
$Mconnexion.DropDownItems.AddRange(@(
$MConnexionSharepoint))
$Mconnexion.Name = "Mconnexion"
$Mconnexion.Size = New-Object System.Drawing.Size(77, 20)
$Mconnexion.Text = "Connexion"
#
# MConnexionSharepoint
#
$MConnexionSharepoint.CheckOnClick = $true
$MConnexionSharepoint.Name = "MConnexionSharepoint"
$MConnexionSharepoint.Size = New-Object System.Drawing.Size(131, 22)
$MConnexionSharepoint.Text = "Sharepoint"
#
# Mquestion
#
$Mquestion.DropDownItems.AddRange(@(
$MQuestionApropos,
$MQuestionWiki))
$Mquestion.Name = "Mquestion"
$Mquestion.Size = New-Object System.Drawing.Size(24, 20)
$Mquestion.Text = "?"
#
# MQuestionApropos
#
$MQuestionApropos.Name = "MQuestionApropos"
$MQuestionApropos.Size = New-Object System.Drawing.Size(131, 22)
$MQuestionApropos.Text = "A propos..."
#
# MQuestionWiki
#
$MQuestionWiki.Name = "MQuestionWiki"
$MQuestionWiki.Size = New-Object System.Drawing.Size(131, 22)
$MQuestionWiki.Text = "Wiki"
#
# Bgo
#
$Bgo.ForeColor = [System.Drawing.Color]::White
$Bgo.Location = New-Object System.Drawing.Point(688, 155)
$Bgo.Name = "Bgo"
$Bgo.Size = New-Object System.Drawing.Size(75, 23)
$Bgo.TabIndex = 1
$Bgo.Text = "GO"
$Bgo.UseVisualStyleBackColor = $true
#
# CBsourceSite
#
$CBsourceSite.ForeColor = [System.Drawing.Color]::White
$CBsourceSite.FormattingEnabled = $true
$CBsourceSite.Location = New-Object System.Drawing.Point(27, 131)
$CBsourceSite.Name = "CBsourceSite"
$CBsourceSite.Size = New-Object System.Drawing.Size(587, 21)
$CBsourceSite.TabIndex = 2
#
# CBdestSite
#
$CBdestSite.ForeColor = [System.Drawing.Color]::White
$CBdestSite.FormattingEnabled = $true
$CBdestSite.Location = New-Object System.Drawing.Point(27, 182)
$CBdestSite.Name = "CBdestSite"
$CBdestSite.Size = New-Object System.Drawing.Size(587, 21)
$CBdestSite.TabIndex = 3
#
# progressBar1
#
$progressBar1.Location = New-Object System.Drawing.Point(12, 345)
$progressBar1.Name = "progressBar1"
$progressBar1.Size = New-Object System.Drawing.Size(776, 23)
$progressBar1.TabIndex = 4
#
# label1
#
$label1.AutoSize = $true
$label1.Location = New-Object System.Drawing.Point(27, 112)
$label1.Name = "label1"
$label1.Size = New-Object System.Drawing.Size(62, 13)
$label1.TabIndex = 5
$label1.Text = "Site Source"
#
# label2
#
$label2.AutoSize = $true
$label2.Location = New-Object System.Drawing.Point(27, 166)
$label2.Name = "label2"
$label2.Size = New-Object System.Drawing.Size(81, 13)
$label2.TabIndex = 6
$label2.Text = "Site Destination"
#
# FMain
#
$FMain.BackColor = [System.Drawing.SystemColors]::ControlText
$FMain.ClientSize = New-Object System.Drawing.Size(800, 450)
$FMain.Controls.Add($label2)
$FMain.Controls.Add($label1)
$FMain.Controls.Add($progressBar1)
$FMain.Controls.Add($CBdestSite)
$FMain.Controls.Add($CBsourceSite)
$FMain.Controls.Add($Bgo)
$FMain.Controls.Add($menuStrip1)
$FMain.ForeColor = [System.Drawing.Color]::Snow
$FMain.MainMenuStrip = $menuStrip1
$FMain.Name = "FMain"
$FMain.Text = "SharePoint Mover GUI"
$CBsourceSite.SelectedIndex = 0
$CBtargetSite.SelectedIndex = 0
$MConnexionSharepoint.add_click({
Connect-PnPOnline -Url $tenantURL -Interactive
###############On recupere puis stocke la liste des sites dans les box
$ComboboxList = (Get-SPOSite | Select Url).name
$CBsourceSite.Items.AddRange($ComboboxList)
$ComboboxList = (Get-SPOSite | Select Url).name
$CBtargetSite.Items.AddRange($ComboboxList)
###############
})
$Bgo.add_click({
Move-PnPFile -SiteRelativeUrl $srcSite -TargetUrl $destSite -Force -AllowSchemaMismatch
})
$FMain.ShowDialog()

4
Sharepoint/readme.md Normal file
View File

@@ -0,0 +1,4 @@
# Scripts Sharepoint
- [Verifier la taille des corbeilles du Sharepoint](https://git.azuze.fr/kawa/ps-scripts/src/branch/main/Sharepoint/sharepoint-taille-trash.ps1)
- [Nettoyer toutes les versions de fichier en conservant les 5 dernieres](https://git.azuze.fr/kawa/ps-scripts/src/branch/main/Sharepoint/SP-empty.ps1)

View File

@@ -0,0 +1,11 @@
#On rentre l'URL du site Sharepoint
$SiteURL = Read-Host -Prompt "Entrez l'URL du site "
#On s'y connecte
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)
#On additionne la taille de tous les objets de la corbeille
$RecycleBinSize = Get-PnPRecycleBinItem -RowLimit 500000 | Where-Object { $_.ItemState -eq "FirstStage" }| Measure-Object -Property Size -Sum
#On recupere la taille en format lisible
Write-host "Recycle Bin Size (GB):" ([Math]::Round($RecycleBinSize.Sum/1GB,2))

View File

@@ -0,0 +1,29 @@
# On verifie quelle version est installée
if (Test-Path "C:\Program Files\Mozilla Firefox\firefox.exe") {
$installedVersion = (Get-ItemProperty "HKLM:\Software\Mozilla\Mozilla Firefox" -Name "CurrentVersion").CurrentVersion
Write-Host "Version installee: $installedVersion"
} else {
Write-Host "Firefox n'est pas installe."
}
# On récupère la dernière version
$r = Invoke-WebRequest -Uri "https://www.mozilla.org/fr-FR/firefox/new/"
$latestVersion = $r.Content.Split([Environment]::NewLine) | Select-String 'data-latest-firefox' |
ForEach-Object { $_.ToString().Split('"')[9] }
# On fait le comparo entre la version installée et la dernière disponible
if ($installedVersion -lt $latestVersion) {
Write-Host "Nouvelle version disponible: $latestVersion"
# On DL la nouvelle version
$url = "https://download.mozilla.org/?product=firefox-latest-ssl&os=win64&lang=fr-FR"
$output = "C:\Users\$env:USERNAME\Downloads\FirefoxSetup.exe"
Invoke-WebRequest -Uri $url -OutFile $output
# On installe silencieusement
Start-Process -FilePath $output -ArgumentList "/S" -Wait
Write-Host "Firefox a bien ete passe en version $latestVersion."
} else {
Write-Host "Firefox est a jour. Version: $installedVersion"
}

2
Windows/get-bio.ps1 Normal file
View File

@@ -0,0 +1,2 @@
#On recupere la liste des peripheriques biometriques
Get-PnpDevice -PresentOnly -Class Biometric

25
Windows/getAcl.ps1 Normal file
View File

@@ -0,0 +1,25 @@
#On demande à l'user de rentrer le chemin source
$entPath = Read-Host "Chemin vers le dossier a examiner : "
#et le chemin cible
$outPath = Read-Host "Ou stocker le CSV : "
#On active la recursion
$FolderPath = dir -Directory -Path "$entPath" -Recurse -Force
$Report = @()
#Une petite boucle pour recuperer les ACL de tous les dossiers
Foreach ($Folder in $FolderPath) {
$Acl = Get-Acl -Path $Folder.FullName
foreach ($Access in $acl.Access)
{
$Properties = [ordered]@{'FolderName'=$Folder.FullName;'AD
Group or
User'=$Access.IdentityReference;'Permissions'=$Access.FileSystemRights;'Inherited'=$Access.IsInherited}
$Report += New-Object -TypeName PSObject -Property $Properties
}
}
#On stocke le rapport la ou l'user veut
$Report | Export-Csv -path "$outPath"