Skip to content

Instantly share code, notes, and snippets.

View vannmangel's full-sized avatar

Stian Myhre Olsen vannmangel

View GitHub Profile
@vannmangel
vannmangel / DisableAndMoveComputerObjects.ps1
Last active February 3, 2016 12:59
Disable and move Active Directory computer objects to a specified OU.
<#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2015 v4.2.99
Created on: 03.02.2016 13.58
Created by: Stian Myhre
Organization: Amedia Teknologi AS
Filename: DisableAndMoveComputerObjects.ps1
===========================================================================
.Synopsis
@vannmangel
vannmangel / Add-AllPackageIDsToDistributionPointGroup.ps1
Last active January 27, 2016 14:22
SCCM 2012 R2 - Fetches the PackageID from all applications, packages, boot images, OS images and driver packages and puts them in a DP group.
#Requires -version 3
<#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2015 v4.2.95
Created on: 28.10.2015 16.18
Created by: Stian Myhre (including some "stealing with pride" from Kaido Järvemets, CoreTech)
Organization: Amedia Teknologi
Filename: Add-AllPackageIDsToDistributionPointGroup.ps1
===========================================================================
@vannmangel
vannmangel / Get-VMwareServers.ps1
Last active October 17, 2016 07:19
Fetches all servers in AD, filters only VMware nodes and writes the computer names to a text file.
Get-ADComputer -Filter {OperatingSystem -like "*Server*"} -properties * -OutVariable nodes
foreach ($node in $nodes.Name)
{
if (Test-Connection -Quiet -Count 1 -ComputerName $node)
{
if ((gwmi Win32_BIOS -ComputerName $node).serialnumber -match "VMware")
{
Add-Content "\\path-to-txt\txt.txt" "`r$node is running VMmware" -PassThru
}
@vannmangel
vannmangel / Remove-SkypeAds.ps1
Last active January 14, 2021 11:54
Remove ads in skype
# start as admin!
# prompt for username
$SkypeUserName = Read-Host -Prompt "What is your Skype username?"
# stop skype-process
try{
if(Get-Process | ? {$_.Name -like 'skype'}) {Stop-Process -Name skype}
# commit changes to hosts file
$hostfile = "C:\Windows\System32\Drivers\etc\hosts"