PowerShell advanced function (cmdlet) – Report all VMs with disconnected NICs in the specified Virtual Machine Manager

This is very simple function to report all virtual machines in the defined System Center Virtual Machine Manager (SCVMM) with disconnected network adapters or with network adapters without specified VLAN. Examples Report Get-RvSCVirtualNetworkAdapter -VMMServer firstVMM, secondVMM, thirdVMM -NoVMNetworkOrNoVLan | Out-GridView Code Function Get-RvSCVirtualNetworkAdapter { <# .SYNOPSIS Get network adapters of virtual machine on defined SCVMM […]

PowerShell Tip – How to remove AD OU and all child objects (another OUs, users, groups, computers)?

How to remove Active Directory Organizational Unit with all child objects (another OUs, users, groups, computers)? It is simple. The trick is to use Remove-ADObject -Recursive. Get-ADOrganizationalUnit -Identity ‘OU=ToDelete,DC=ad,DC=fabrikam,DC=com’ | Set-ADOrganizationalUnit -ProtectedFromAccidentalDeletion:$false -PassThru | Remove-ADObject -Recursive -Confirm:$false