New filters on the Home Feed, take a look!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
Quick and dirty Petya/NoPetya vaccination
Post Body

Hi,

you can decide yourself if the 'vaccination' may help or not. This is my quick and dirty approach ...

Run as a user account that has access to the \C$ admin share of the remote computer

# enabled AD Computers
$Servers = Get-ADComputer -filter {(enabled -eq $True)} | Select-Object -ExpandProperty DnsHostName

# path to source file
$path_src_perfc = '\\share\perfc'

Try {

    Foreach ($ComputerName in $Servers) {

        $path_adminshare = '\\{0}\C$' -f $ComputerName
        $path_dst_perfc = Join-Path -Path $path_adminshare -ChildPath '\Windows\perfc'

        if (Test-Path -Path $path_adminshare) {

            Write-Verbose "[*][$ComputerName] Access to $path_adminshare" -Verbose

            if (Test-Path -Path $path_dst_perfc) {

                Write-Verbose "[ ][$ComputerName] $path_dst_perfc already exists" -Verbose

            }
            else {

                Write-Verbose "[*][$ComputerName] Copy perfc to $path_dst_perfc" -Verbose
                Copy-Item -Path $path_src_perfc -destination $path_dst_perfc

                if (Test-Path -Path $path_dst_perfc) {

                    Write-Verbose "[ ][$ComputerName] Copy success" -Verbose

                }
                else{ 

                    Write-Verbose "[-][$ComputerName] Copy failed" -Verbose

                }

            }

        }
        else {
            Write-Verbose "[-][$ComputerName] No Access to $path_adminshare" -Verbose
        }

    }
}
Catch{
    $_
}

Author
Account Strength
90%
Account Age
15 years
Verified Email
Yes
Verified Flair
No
Total Karma
4,540
Link Karma
3,347
Comment Karma
1,193
Profile updated: 4 days ago
Posts updated: 6 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
7 years ago