Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

check user account control enabled or not ?

$
0
0
$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?

Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>