Protect OU from accidental deletion

Activate protection on a specific OU and all sub OUs

Get-ADOrganizationalUnit -SearchBase ‘OU=myOU,DC=domain,DC=net’ -filter * -Properties ProtectedFromAccidentalDeletion | Set-ADOrganizationalUnit -ProtectedFromAccidentalDeletion $true

Deactivate protection on a specific OU and all sub OUs

Get-ADOrganizationalUnit -SearchBase ‘OU=myOU,DC=domain,DC=net’ -filter * -Properties ProtectedFromAccidentalDeletion | Set-ADOrganizationalUnit -ProtectedFromAccidentalDeletion $false

Removing SID-History

Single User

Get-ADUser USERNAME -properties sidhistory | foreach {Set-ADUser $_ -remove @{sidhistory=$_.sidhistory.value}}

Single group

Get-ADGroup GROUPNAME -properties sidhistory | foreach {Set-ADGroup$_ -remove @{sidhistory=$_.sidhistory.value}}

All Users within a OU with an SID History

Get-ADUser -SearchBase “OU=Accounts,DC=mydomain,DC=com” -Filter {sidhistory -like “*”} -properties sidhistory | foreach {Set-ADUser $_ -remove @{sidhistory=$_.sidhistory.value}}

All Groups within a OU with an SID History

Get-ADGroup -SearchBase “OU=Accounts,DC=mydomain,DC=com” -Filter {sidhistory -like “*”} -properties sidhistory | foreach {Set-ADGroup $_ -remove @{sidhistory=$_.sidhistory.value}}

Upgrade to Windows 10

Windows 8There are three ways to update your current Windows 7, Windows 8 or Windows 8.1 to the new Windows 10 operating system:

  • Reserve your Windows 10 Installation and wait for it – not what you actually want 🙂
  • Force the update by cleaning up your Windows Update Download folder and execute a command
  • Download it, Create a bootable USB stick or DVD by using the Media Creation Tool

One important information is missing everywhere: Do not use the “Media Creation Tool” to make a blank installation before any upgrade. You’ll not be able to activate your Windows 10! Microsoft updates their Product Key Database during the upgrade and that can take up to three days (information from Microsoft technical support).

Force the update

  1. Make sure your current installation is fully updated (Windows Updates)
  2. Delete the content of the folder “C:\Windows\SoftwareDistribution\Download”
  3. Press Start, enter “cmd” and run the Command line tool as Administrator
  4. Enter “wuauclt.exe /updatenow”
  5. At this point, Windows Update should download Windows 10 and let you install it afterwards.

Media Creation Tool

  1. Download the Media Creation Tool from https://www.microsoft.com/software-download/windows10
  2. Run the tool and choose to update your current computer, create a bootable USB stick, DVD or download the ISO file for later usage.

Reinstallation

After a successful upgrade and activation of your Windows 10, a reinstallation can be done without any problems (tested twice with two different computers and its OEM license).

  1. Download the Media Creation Tool from https://www.microsoft.com/software-download/windows10
  2. Run the tool and create a bootable USB stick or DVD
  3. Startup your computer and boot from the USB stick or DVD
  4. Choose custom installation to remove current partition layout of your harddisk to make a clean installation.

Powershell FTP upload

#Cmetro-powershell-logoonfigure the folder where the files are which should be uploaded
$Directory=”C:\MyFolder”

#FTP server configuration
$ftpserver = “ftp://myftpserver.myurl.com/optionalpath/”
$username = “FTPUSER”
$password = “FTPPASS”

$webclient = New-Object System.Net.WebClient

$webclient.Credentials = New-Object System.Net.NetworkCredential($username,$password)

#Copy each file which type is *.tx*
foreach($file in (dir $Directory “*.tx*”)){
“Uploading $file…”
$uri = New-Object System.Uri($ftpserver+$file.Name)
$webclient.UploadFile($uri, $file.FullName)
}