Private/Helper/Test-IsDomainController.ps1
<#
Copyright © 2024 Integris. For internal company use only. All rights reserved. #> FUNCTION Test-IsDomainController { <# .SYNOPSIS Determines if the operating system is a domain controller. .DESCRIPTION This function checks the product type of the operating system to determine if it is a domain controller. .PARAMETER None .EXAMPLE Test-IsDomainController .NOTES The function uses the Get-CIMInstance cmdlet to get the product type of the operating system. #> $ProductType = (Get-CIMInstance Win32_OperatingSystem).ProductType IF ($ProductType -eq 2) { RETURN $True } RETURN $False } |