Get-ADComputer -filter {Enabled -eq $True} -Properties cn -SearchBase "OU=Production,DC=domain,DC=local" | select cn | ConvertTo-Csv -NoTypeInformation | Select-Object -skip 1 | Out-File <INSERT PATH TO .CSV FILE>
Alex's ICT Blog
Tuesday, April 27, 2021
Tuesday, July 21, 2015
Windows 10 Data Mining
Today I installed the latest (10240) Windows 10 Tech Preview build.
This is the RTM build that will be released to the general public on July 29.
A long time ago I made it a habit not to use Windows express settings … EVER.
Today it definitely paid up … after the build was installed, Windows went through the process of updating/optimizing all the apps on the computer and then took me through a short setup process.
Part of the process was customizing the Windows settings, with the standard two options: express or custom (this one in a smaller font somewhere at the bottom of the page).
Right on the first page there are some options that can be cataloged as Data Mining or key logging:
Fair to say that the vast majority of home/small business users will go for the express settings and in turn send vast amounts of personal/confidential data to Microsoft.
This begs the question of how the data is transmitted/stored (SSL, etc) and who’s got access to it.
Thursday, July 9, 2015
Use a Multiple Activation Key (MAK) instead of KMS activation
If KMS activation will not be used, and if there is no KMS server, the product key should be changed to a MAK. For Microsoft Developer Network (MSDN) the stock-keeping units (SKUs) that are listed below the media are usually volume licensed-media, and the product key that is supplied is an MAK key.
Change the product key to a MAK. To do this, follow these steps:
- Open an elevated Command Prompt
- If you are prompted for an administrator password or for confirmation, type the password or provide confirmation.
- At the command prompt, type the following command, and then press Enter:
slmgr -ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
Note In this command, the placeholder xxxxx-xxxxx-xxxxx-xxxxx-xxxxx represents your MAK product key.
- Next type the following commands:
slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr.vbs /ato
The first command will update the key.
The second command will activate Windows.
Export SCOM Management Packs
The script was tested with SCOM 2012 R2.
Add-PSSnapin Microsoft.EnterpriseManagement.OperationsManager.Client -ErrorAction SilentlyContinue -ErrorVariable Err
Get-SCOMManagementPack -Name * | Export-SCOMManagementPack -Path <INSERT PATH>
Export list of computers from an OU to a .csv file
Monday, July 6, 2015
Export AD group members to a .csv file
Add list of users (by Display Name) to AD group from .csv file
$ListOfUsers = Import-csv -Path <INSERT PATH TO .CSV FILE>
$ItemDetails = $NULL
foreach ($item in $ListOfUsers)
{
$a = $item.name
$ItemDetails = get-aduser -Filter {DisplayName -eq $a} -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
if (($ItemDetails.count) -gt 1)
{
Write-Host "Too many accounts with DisplayName $a" -ForegroundColor Yellow
}
else
{
if ($ItemDetails -eq $NULL)
{
Write-Host $a "does not exist in AD" -ForegroundColor Red
$ItemDetails = $NULL
}
else
{
Write-Host $a "does exist in AD" -ForegroundColor Green
$ItemDetails.DistinguishedName
$GroupToAddTo = get-adgroup -Identity "<INSERT GROUP NAME>"
Add-ADGroupMember -Identity $GroupToAddTo -Member $ItemDetails.DistinguishedName
$ItemDetails = $NULL
}
}
}