Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##Desativar placa Wireless Labin C
- $credencial = Get-Credential Administrador
- $computers = Get-Content C:\Users\eliel\Desktop\scritps_powershell\labin_c_pcs.txt
- $online = @()
- $offline = @()
- Foreach($pc in $computers) {
- if (Test-Connection -BufferSize 32 -Count 1 -ComputerName $pc -Quiet) {
- if (Test-WSMan -ComputerName $pc ) { $online += $pc }
- else { $offline += $pc }
- }
- else { $offline += $pc }
- }
- Write-Output "O comando sera executado nos seguintes computadores: " $online
- Write-Output "Total de computadores ligados: " $online.Count
- Invoke-Command -ComputerName $online { $sem_fio = Get-WmiObject -Class win32_networkadapter -Filter "Name LIKE '%Adaptador de rede 802.11n%'" ; if($?){$sem_fio.Disable()} } -Credential $credencial
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement