Posts Tagged ‘environmental variable’

Check the value of an Environmental Variable on Multiple servers

Warning: count(): Parameter must be an array or an object that implements Countable in /home/fbsqlcom/public_html/ on line 31

Here’s one powershell method for how to check the value of an environment variable on multiple servers; ?View Code POWERSHELL$computers = @("server1", "server2", "server3");   foreach ($c in $computers) { Get-WmiObject -ComputerName $c -Class Win32_Environment -Filter "Username = ‘<SYSTEM>’ AND Name = ‘VAR_NAME’"; } Output will be similar to below… VariableValue Name UserName ————- —- […]