This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
robocopy "Source" "DEST" /MIR /NDL /NP /FFT /Z /R:3 /W:10 /LOG+:C:\Log.txt | |
/mir Reflète une arborescence de répertoires (équivalent à /e plus /purge) | |
/ndl Spécifie que les noms des répertoires ne doivent pas être journalisés. | |
/np Spécifie que la progression de l’opération de copie (le nombre de fichiers ou de répertoires copiés jusqu’à présent) ne s’affiche pas. | |
/fft Suppose l’heure des fichiers FAT (précision de deux secondes). | |
/z Copie les fichiers en mode redémarrable. | |
/r : <N > Spécifie le nombre de nouvelles tentatives en cas d’échec de copies. La valeur par défaut de N est 1 million (1 million nouvelles tentatives). | |
/w : <N > Spécifie le délai d’attente entre les tentatives, en secondes. La valeur par défaut de N est 30 (temps d’attente de 30 secondes). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
net use * /delete /yes | |
net use p: \\COMPUTER_NAME\d$\... /user:USER PASSWORD | |
robocopy "P:" "DEST" /MIR /NDL /NP /FFT /Z /R:3 /W:10 /LOG+:C:\Log.txt | |
net use * /delete /yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this script will show how to get the total size of the blobs in a container | |
# before running this, you need to create a storage account, create a container, | |
# and upload some blobs into the container | |
# note: this retrieves all of the blobs in the container in one command. | |
# if you are going to run this against a container with a lot of blobs | |
# (more than a couple hundred), use continuation tokens to retrieve | |
# the list of blobs. | |
# these are for the storage account to be used | |
$resourceGroup = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy" | |
$PSTFile = "\\SRV01\PSTImport" | |
$AzureStore = "AZ_BLOB_URL" | |
$LogFile = "C:\importPST.txt" | |
& .\AzCopy.exe /Source:$PSTFile /Dest:$AzureStore /V:$LogFile /Y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example for Windows Backup Feature | |
# Get info for the desired Feature | |
Dism /online /Get-FeatureInfo /FeatureName:WindowsServerBackup | |
# Mount an WinSxs folder from other server with net use. You can use credentials | |
net use p: \\SERVER_PATH\c$\Windows\WinSxS /user:USERNAME PASSWORD | |
# Finally, you can restore the feature | |
DISM /Online /Enable-Feature /FeatureName:WindowsServerBackup /All /LimitAccess /Source:P: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#For DC on Hyper-V, Disable the TimeSync service. | |
#On DC | |
w32tm /config /update /manualpeerlist:"time.windows.com,0x8" /syncfromflags:MANUAL | |
Restart-Service w32time | |
#Verify on DC and Computer | |
w32tm /query /source | |
w32tm /resync | |
w32tm /query /status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$OU_path = "OU_PATH" | |
$Base_Folder = "RUN_FOLDER" | |
$users = get-aduser -SearchBase $OU_path -filter * -Properties UserPrincipalName | % { $_.UserPrincipalName.Split('@')[0] } | |
$users | ForEach { | |
$folder = join-path -path $Base_Folder -childpath $_ | |
If (!(Test-Path -Path $folder )) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Droits admin nécessaire | |
#Afficher le profil actif | |
$ProfileName = Get-NetConnectionProfile | |
# Changer la catégorie du profil actif (valeurs acceptées : Public, Private, DomainAuthenticated) | |
Set-NetConnectionProfile -Name $ProfileName.Name -NetworkCategory Private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$jobname = "Windows_Backup_Teams" | |
$action = New-ScheduledTaskAction –Execute "@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -File C:\Windows_Backup_Teams_Report.ps1" | |
$trigger = New-ScheduledTaskTrigger -daily -At 7am | |
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable -DontStopOnIdleEnd | |
Register-ScheduledTask -TaskName $jobname -Action $action -Trigger $trigger -RunLevel Highest -Settings $settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
"C:\Program Files (x86)\Kaspersky Lab\Kaspersky Small Office Security 17.0.0\avp.com" EXIT /password=BugK@sos2019 | |
"C:\Program Files (x86)\Kaspersky Lab\Kaspersky Small Office Security 17.0.0\avp.com" START /password=BugK@sos2019 |