-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDelete_HostKeys.ps1
More file actions
20 lines (17 loc) · 913 Bytes
/
Delete_HostKeys.ps1
File metadata and controls
20 lines (17 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
##############################################################################
# Script : Delete_HostKeys.dat
# Purpose : "@(#) Purpose: Delete HostKeys.dat file from Active server"
# Contributor : 2016 United Natural Foods, Inc.
# Control : "@(#) Revision: 1.0.0"
# Description : Deletes the HostKeys.dat file from the Active server if needed
# History : 2016/01/15 - 1.0.0 - PWM - Created
##############################################################################
# Load the JAMS module
import-module jams
# Retrieve the current failover status
$status = get-jamsfailoverstatus -server localhost
# Only perform this activity if this is the ACTIVE node
if ($status.Status.Trim(" ") = "Active") {
# Search and delete the HostKeys.dat file on the local system
Get-ChildItem -Path "C:\ProgramData\IsolatedStorage" -Recurse -File -Force -Filter 'HostKeys.dat' | Remove-Item
}