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
<# | |
.DESCRIPTION | |
Adds defined item to the PendingFileRenameOperations value in Registry to be deleted on next reboot. | |
.EXAMPLE | |
If item to be removed is a file | |
Remove-ItemOnReboot -Item "C:\Temp\image.wim" | |
If item to be removed is a directory | |
Remove-ItemOnReboot -Item "C:\Temp\" |
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
<# | |
.DESCRIPTION | |
Simple script to run AzureADSync. | |
Compiling using PS2EXE-GUI (https://gallery.technet.microsoft.com/scriptcenter/PS2EXE-GUI-Convert-e7cb69d5) to an exe makes an easy tool to quickly trigger an Azure AD Sync. | |
.EXAMPLE | |
AzureADSync.ps1 | |
#> |
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
<# | |
.DESCRIPTION | |
This script set external NTP to NTP.ORG then resync the time. | |
#> | |
# Set W32Time to Automatic start if not already enabled | |
Get-Service w32time | ` | |
%{If($_.StartType -ne "Automatic"){Set-Service w32time -StartType Automatic}} | ` | |
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
# Config | |
$Username = "Robert" | |
$Password = "rob" | |
$LocalFile = "C:\Temp\Test2.exe" | |
$RemoteFile = "ftp://ftphost/test.exe" | |
# Create a FTPWebRequest | |
$FTPRequest = [System.Net.FtpWebRequest]::Create($RemoteFile) | |
$FTPRequest.Credentials = New-Object System.Net.NetworkCredential($Username,$Password) | |
$FTPRequest.Method = [System.Net.WebRequestMethods+Ftp]::DownloadFile |