I have written the following script to deploy Petya vaccination files on all Active Directory domain members. These files are simple text file deployed on the destination system folder C:\Windows. This technic has been discovered by Amit Serper and it
List domain controllers forest wide with OS version
This powershell script will allow you to get a list of your domain controllers and their operating system versions. This script uses information stored in the Active Directory database using the cmdlet get-adcomputer $list = (Get-ADForest).GlobalCatalogs $domainnames = (Get-ADForest).Domains $domainnames_arr
Retrieve Active Directory domain controller OS forest wide
List DNS conditional forwarders Active Directory forest wide
Different ways of getting AD group members
I will show you, in the scripts below, different ways of getting Active Directorw group members with Powershell. Scripts ADSI method $root=([ADSI]””).distinguishedName $Group = [ADSI](“LDAP://CN=Domain Admins, CN=Users,”+ $root) $Group.member Get-ADGroupMember cmdlet $root = (get-ADDomain).Distinguishedname $group = “CN=Domain Admins, CN=Users,”+$root (Get-ADGroupMember
List the GPO GUID
Retrieve the Active Directory functional levels
You can retrieve the Active Directory forest functional level with the powershell cmdlet Get-ADForest import-module activedirectory Get-ADForest | select forestmode For the domain functional level, you can use the powershell cmdlet Get-ADDomain Get-ADDomain | select domainmode Reference Get-ADForest Syntax Get-ADForest