door Bvandeglind | apr 12, 2023 | Handig, naslag
The script below reads an input file from the command line and then checks if it exists. If not found it keeps prompting for a correct filename. FileToRead = Read-Host “Please enter the filename” $Found = “N” Do { if (Test-Path -LiteralPath...
door Bvandeglind | apr 12, 2023 | Handig, naslag
This script checks if an Active Directory domain exists. If found it continues. If not it exits the script. $Domain = Read-Host “Please enter the domain name” try { Get-ADDomain -Identity $Domain | Out-Null Write-Host “[INFO] Domain found....
door Bvandeglind | apr 12, 2023 | Handig, naslag
This script reads (non-unique) departments from a CSV file with user records and transforms it into a unique list. It then create OU’s in Active Directory based on the departments in the file. Replace <RootOU>, <DomainName> and “MyCity” for...
door Bvandeglind | apr 12, 2023 | Handig, naslag
hort instruction about how to install the GPO Administrative Template for Microsoft Edge. On your Active Directory Domain Controller, go to: https://www.microsoft.com/en-us/edge/business/download Select version, build and platform Click on Get Policy...
door Bvandeglind | apr 12, 2023 | Handig, naslag
et-ADGroup -Filter * -SearchBase “OU=PFAfdelingen,DC=FORMAPOLI,DC=local” | Select-Object Name, DistinguishedName | Format-Table
door Bvandeglind | apr 12, 2023 | Handig, naslag
Sometimes when you work with objects in Powershell and want to concatenate field as output you need to get rid of spaces. Below is an example on how to deal with that. The cmdlets below import records from the file C:\CSV-files\Userlist.txt, filters on Achternaam =...