$servers="DEN-DC-01", "DEN-GW-01", "DEN-SRV-01","DEN-SRV-02","FTC-CL1-01"
Function get-UserAccountControl ($server)
{
$uac=(Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System).EnableLUA
if ($uac -eq 1 )
{
return( " uac is enabled")
}
else
{
return (" uac is disabled")
}
}
foreach ($srv in $servers)
{
write-host "The server is $srv"
$useraccount= get-UserAccountControl($srv)
write-output $useraccount
}I need to check on several servers whether user account control is disabled or not . when i check my script on windows 7 it works perfectly but when i try on server , though UAC is disabled on all servers , it says uac enabled. can anyone help me with this?