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

Elevate powershell script automatically

$
0
0
$wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'" 
$DNSServers = "8.8.8.8","4.2.2.2"  
$wmi.SetDNSServerSearchOrder($DNSServers)

Hello All,

I need to have this script run at log on. I can configure it to run with group policy but most of the users do not have admin rights.  It does not run at logon if the user does have have admin rights to their machine.  How can I add in this script to elevate permissions to run as admin?

Thanks,


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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