Hello,
I am new to PS and I am writing some simple scripts and need help. Once each item is successful I would like it to write- host -ForegroundColor Green or Red if it failed. I am sure this is simple, just looking for some help.
#######################################################
# Disable NetBIOS over TCP/IP
$nic = Get-WmiObject Win32_NetworkAdapterConfiguration -filter "ipenabled = 'true'"
$nic.SetTcpipNetbios(2)
#######################################################
# Uncheck "Register this connection's addressed in DNS
(Get-WmiObject Win32_NetworkAdapter -Filter "NetEnabled=True").GetRelated('Win32_NetworkAdapterConfiguration').SetDynamicDNSRegistration($false,$false)
#######################################################
# Set WinRM to Automatic
Set-Service -Name WinRM -StartupType Automatic -Status Running
#######################################################
# Nightly Reboot Task (Change Path to XML)
schtasks.exe /Create /XML "C:Base Build Files\Task\Nightly_Reboot.xml" /tn "Nightly Reboot"
#######################################################
# Disable IPv6
netsh interface ipv6 set global randomizeidentifiers=disabled