Friday, October 26, 2018

Get a list of VMs set to upgrade tools at power cycle


I needed to know what was set to upgrade at power cycle to verify a change request so with a little googling I got a good foundation and modified it to this.


Get-View -ViewType VirtualMachine -SearchRoot (Get-Cluster "Your_Cluster").id -Filter @{'Config.Tools.ToolsUpgradePolicy' = 'UpgradeAtPowerCycle' } | Select-Object name, @{N='ToolsUpgradePolicy';E={$_.Config.Tools.ToolsUpgradePolicy } }

Thursday, July 12, 2018

Move a List of PCs to a new OU


I needed to move 400 machine to a different OU and was provided a list.  So I spent 5 min and put this together.  Hope it helps someone.


Import-Csv "C:\temp\DistinguishedNames.csv" | ForEach-Object { Move-ADObject -Identity $_.DistinguishedName -TargetPath "OU=Computers,DC=YourDomain,DC=com" -Confirm:$false }