-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDNSflush.ps1
47 lines (31 loc) · 978 Bytes
/
DNSflush.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<#
.SYNOPSIS
Think powershell think Mr-ITpro.com !!! FUN STUFF
.EXAMPLE
'one', 'two', 'three' TonyB_default.ps1
.EXAMPLE
TonyB_default.ps1 -computername localhost
.EXAMPLE
TonyB_default.ps1 -computername one, two, three
.EXAMPLE
get-content <Somelist.txt> or <anylist.csv> | TonyB_default.ps1
.PARAMETER computername
one or more computername, or IP address... peace to America!
.LINK
https://github.com/officecigar/windows_scripts/blob/master/serverhealth5.ps1
#>
[CmdletBinding(HelpURI='http://google.com')]
Param(
[Parameter(Mandatory=$true,ValuefromPipeline=$true)]
[string []]$DnsServers2ToFlush
)
#$DNSSrvToFlush= Get-Content c:\temp\DNSservertoflush.txt
Begin {
}
Process{
foreach ($servers in $DnsServers2ToFlush) {
Invoke-WmiMethod -class Win32_process -name Create -ArgumentList ("cmd.exe /c ipconfig /flushdns") -ComputerName $servers
}
}
End{
}