Hi guys,
i would like to check if a specified mac address is present on the server, if it doesn' t the script exit.
i wrote this:
$Mac1 = "00-0A-A7-7B-AC-E2"
$ServerMacs = Get-CimInstance win32_networkadapterconfiguration | select description, macaddress
IF ($ServerMacs.macaddress -contains $Mac1)
{
Write-Host -ForegroundColor Green "RUNNING SCRIPT"
}
ELSE {Write-Host -ForegroundColor Magenta "SCRIPT EXITING"}
I think that problem is when compare the string..